myio-js-library 0.1.85 → 0.1.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2244,15 +2244,33 @@ var MyIOSelectionStoreClass = class {
2244
2244
  };
2245
2245
  var MyIOSelectionStore;
2246
2246
  if (typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined") {
2247
- if (globalThis.window.MyIOSelectionStore) {
2248
- console.log("[SelectionStore] \u{1F504} REUSING existing global instance");
2247
+ const descriptor = Object.getOwnPropertyDescriptor(globalThis.window, "MyIOSelectionStore");
2248
+ if (descriptor && !descriptor.configurable) {
2249
+ console.log("[SelectionStore] \u{1F504} REUSING locked global instance");
2249
2250
  MyIOSelectionStore = globalThis.window.MyIOSelectionStore;
2251
+ } else if (globalThis.window.MyIOSelectionStore) {
2252
+ console.log("[SelectionStore] \u{1F512} LOCKING existing instance");
2253
+ MyIOSelectionStore = globalThis.window.MyIOSelectionStore;
2254
+ Object.defineProperty(globalThis.window, "MyIOSelectionStore", {
2255
+ value: MyIOSelectionStore,
2256
+ writable: false,
2257
+ configurable: false,
2258
+ enumerable: true
2259
+ });
2250
2260
  } else {
2251
2261
  console.log("[SelectionStore] \u{1F195} Creating new global singleton instance");
2252
2262
  MyIOSelectionStore = new MyIOSelectionStoreClass();
2253
- globalThis.window.MyIOSelectionStore = MyIOSelectionStore;
2263
+ Object.defineProperty(globalThis.window, "MyIOSelectionStore", {
2264
+ value: MyIOSelectionStore,
2265
+ writable: false,
2266
+ configurable: false,
2267
+ enumerable: true
2268
+ });
2269
+ console.log("[SelectionStore] \u{1F512} Instance locked and ready");
2270
+ }
2271
+ if (!globalThis.window.MyIOSelectionStoreClass) {
2272
+ globalThis.window.MyIOSelectionStoreClass = MyIOSelectionStoreClass;
2254
2273
  }
2255
- globalThis.window.MyIOSelectionStoreClass = MyIOSelectionStoreClass;
2256
2274
  } else {
2257
2275
  MyIOSelectionStore = new MyIOSelectionStoreClass();
2258
2276
  }
package/dist/index.js CHANGED
@@ -2156,15 +2156,33 @@ var MyIOSelectionStoreClass = class {
2156
2156
  };
2157
2157
  var MyIOSelectionStore;
2158
2158
  if (typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined") {
2159
- if (globalThis.window.MyIOSelectionStore) {
2160
- console.log("[SelectionStore] \u{1F504} REUSING existing global instance");
2159
+ const descriptor = Object.getOwnPropertyDescriptor(globalThis.window, "MyIOSelectionStore");
2160
+ if (descriptor && !descriptor.configurable) {
2161
+ console.log("[SelectionStore] \u{1F504} REUSING locked global instance");
2161
2162
  MyIOSelectionStore = globalThis.window.MyIOSelectionStore;
2163
+ } else if (globalThis.window.MyIOSelectionStore) {
2164
+ console.log("[SelectionStore] \u{1F512} LOCKING existing instance");
2165
+ MyIOSelectionStore = globalThis.window.MyIOSelectionStore;
2166
+ Object.defineProperty(globalThis.window, "MyIOSelectionStore", {
2167
+ value: MyIOSelectionStore,
2168
+ writable: false,
2169
+ configurable: false,
2170
+ enumerable: true
2171
+ });
2162
2172
  } else {
2163
2173
  console.log("[SelectionStore] \u{1F195} Creating new global singleton instance");
2164
2174
  MyIOSelectionStore = new MyIOSelectionStoreClass();
2165
- globalThis.window.MyIOSelectionStore = MyIOSelectionStore;
2175
+ Object.defineProperty(globalThis.window, "MyIOSelectionStore", {
2176
+ value: MyIOSelectionStore,
2177
+ writable: false,
2178
+ configurable: false,
2179
+ enumerable: true
2180
+ });
2181
+ console.log("[SelectionStore] \u{1F512} Instance locked and ready");
2182
+ }
2183
+ if (!globalThis.window.MyIOSelectionStoreClass) {
2184
+ globalThis.window.MyIOSelectionStoreClass = MyIOSelectionStoreClass;
2166
2185
  }
2167
- globalThis.window.MyIOSelectionStoreClass = MyIOSelectionStoreClass;
2168
2186
  } else {
2169
2187
  MyIOSelectionStore = new MyIOSelectionStoreClass();
2170
2188
  }
@@ -2162,15 +2162,33 @@
2162
2162
  };
2163
2163
  exports.MyIOSelectionStore = void 0;
2164
2164
  if (typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined") {
2165
- if (globalThis.window.MyIOSelectionStore) {
2166
- console.log("[SelectionStore] \u{1F504} REUSING existing global instance");
2165
+ const descriptor = Object.getOwnPropertyDescriptor(globalThis.window, "MyIOSelectionStore");
2166
+ if (descriptor && !descriptor.configurable) {
2167
+ console.log("[SelectionStore] \u{1F504} REUSING locked global instance");
2167
2168
  exports.MyIOSelectionStore = globalThis.window.MyIOSelectionStore;
2169
+ } else if (globalThis.window.MyIOSelectionStore) {
2170
+ console.log("[SelectionStore] \u{1F512} LOCKING existing instance");
2171
+ exports.MyIOSelectionStore = globalThis.window.MyIOSelectionStore;
2172
+ Object.defineProperty(globalThis.window, "MyIOSelectionStore", {
2173
+ value: exports.MyIOSelectionStore,
2174
+ writable: false,
2175
+ configurable: false,
2176
+ enumerable: true
2177
+ });
2168
2178
  } else {
2169
2179
  console.log("[SelectionStore] \u{1F195} Creating new global singleton instance");
2170
2180
  exports.MyIOSelectionStore = new MyIOSelectionStoreClass();
2171
- globalThis.window.MyIOSelectionStore = exports.MyIOSelectionStore;
2181
+ Object.defineProperty(globalThis.window, "MyIOSelectionStore", {
2182
+ value: exports.MyIOSelectionStore,
2183
+ writable: false,
2184
+ configurable: false,
2185
+ enumerable: true
2186
+ });
2187
+ console.log("[SelectionStore] \u{1F512} Instance locked and ready");
2188
+ }
2189
+ if (!globalThis.window.MyIOSelectionStoreClass) {
2190
+ globalThis.window.MyIOSelectionStoreClass = MyIOSelectionStoreClass;
2172
2191
  }
2173
- globalThis.window.MyIOSelectionStoreClass = MyIOSelectionStoreClass;
2174
2192
  } else {
2175
2193
  exports.MyIOSelectionStore = new MyIOSelectionStoreClass();
2176
2194
  }