@esfx/collection-core-shim Package

    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<T>
      • ReadonlyIndexedCollection<T>
      • Collection<T>
      • IndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Uint8Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Uint8ClampedArray implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Uint16Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Uint32Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Int8Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Int16Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Int32Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Float32Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Float64Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • BigUint64Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • BigInt64Array implements:
      • ReadonlyCollection<T>
      • ReadonlyIndexedCollection<T>
      • FixedSizeIndexedCollection<T>
    • Set implements:
      • ReadonlyCollection<T>
      • Collection<T>
    • Map implements:
      • ReadonlyKeyedCollection<K, V>
      • KeyedCollection<K, V>
    • WeakSet implements:
      • ReadonlyContainer<T>
      • Container<T>
    • WeakMap implements:
      • ReadonlyKeyedContainer<K, V>
      • KeyedContainer<K, V>
    • Improve this Doc
    Generated by DocFX