@esfx/collection-core-shim
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@esfx/collection-core-shim

The @esfx/collection-core-shim package provides a global shim to add default @esfx/collection-core behaviors to global objects.

Overview

Installation

npm i @esfx/collection-core-shim

Usage

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

  • Array implements:
    • ReadonlyCollection
    • Collection
    • ReadonlyIndexedCollection
    • FixedSizeIndexedCollection
    • IndexedCollection
  • 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

To install the global shim, import @esfx/collection-core-shim:

import "@esfx/collection-core-shim"; // triggers global-scope side effects

[1, 2, 3][Collection.size]; // 3

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @esfx/collection-core-shim

    Weekly Downloads

    16

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    60 kB

    Total Files

    8

    Last publish

    Collaborators

    • rbuckton