Package @esfx/collection-core-shim

    Provides a global shim to add default @esfx/collection-core behaviors to global objects.

    Installation

    npm i @esfx/collection-core-shim
    

    Usage

    • TypeScript
    • JavaScript (CommonJS)
    import "@esfx/collection-core-shim"; // triggers global-scope side effects
    import { Collection } from "@esfx/collection-core";
    
    [1, 2, 3][Collection.size]; // 3
    
    require("@esfx/collection-core-shim"); // triggers global-scope side effects
    const { Collection } = require("@esfx/collection-core");
    
    [1, 2, 3][Collection.size]; // 3
    

    Remarks

    The global shim adds a default implementation the collection interfaces to the following global objects:

    • Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • Collection
      • IndexedCollection
      • FixedSizeIndexedCollection
    • Uint8Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Uint8ClampedArray implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Uint16Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Uint32Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Int8Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Int16Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Int32Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Float32Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Float64Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • BigUint64Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • BigInt64Array implements:
      • ReadonlyCollection
      • ReadonlyIndexedCollection
      • FixedSizeIndexedCollection
    • Set implements:
      • ReadonlyCollection
      • Collection
    • Map implements:
      • ReadonlyKeyedCollection
      • KeyedCollection
    • WeakSet implements:
      • ReadonlyContainer
      • Container
    • WeakMap implements:
      • ReadonlyKeyedContainer
      • KeyedContainer
    • Improve this Doc
    Generated by DocFX