snipe/web/node_modules/@acemir/cssom/lib/CSSOM.js
pyr0ball 7a704441a6 feat(snipe): Vue 3 frontend scaffold + Docker web service
- web/: Vue 3 + Vite + UnoCSS + Pinia, dark tactical theme (amber/#0d1117)
- AppNav, ListingCard, SearchView with filters/sort, composables
  (useSnipeMode, useKonamiCode, useMotion), Pinia search store
- Steal shimmer, auction countdown, Snipe Mode easter egg all native in Vue
- docker/web/: nginx + multi-stage Dockerfile (node build → nginx serve)
- compose.yml: api (8510) + web (8509) services
- Dockerfile CMD updated to uvicorn for upcoming FastAPI layer
- Clean build: 0 TS errors, 380 modules
2026-03-25 15:11:35 -07:00

58 lines
1.8 KiB
JavaScript

var CSSOM = {
/**
* Creates and configures a new CSSOM instance with the specified options.
*
* @param {Object} opts - Configuration options for the CSSOM instance
* @param {Object} [opts.globalObject] - Optional global object to be assigned to CSSOM objects prototype
* @returns {Object} A new CSSOM instance with the applied configuration
* @description
* This method creates a new instance of CSSOM and optionally
* configures CSSStyleSheet with a global object reference. When a globalObject is provided
* and CSSStyleSheet exists on the instance, it creates a new CSSStyleSheet constructor
* using a factory function and assigns the globalObject to its prototype's __globalObject property.
*/
setup: function (opts) {
var instance = Object.create(this);
if (opts.globalObject) {
if (instance.CSSStyleSheet) {
var factoryCSSStyleSheet = createFunctionFactory(instance.CSSStyleSheet);
var CSSStyleSheet = factoryCSSStyleSheet();
CSSStyleSheet.prototype.__globalObject = opts.globalObject;
instance.CSSStyleSheet = CSSStyleSheet;
}
}
return instance;
}
};
function createFunctionFactory(fn) {
return function() {
// Create a new function that delegates to the original
var newFn = function() {
return fn.apply(this, arguments);
};
// Copy prototype chain
Object.setPrototypeOf(newFn, Object.getPrototypeOf(fn));
// Copy own properties
for (var key in fn) {
if (Object.prototype.hasOwnProperty.call(fn, key)) {
newFn[key] = fn[key];
}
}
// Clone the .prototype object for constructor-like behavior
if (fn.prototype) {
newFn.prototype = Object.create(fn.prototype);
}
return newFn;
};
}
//.CommonJS
module.exports = CSSOM;
///CommonJS