record-map
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Actions Status Actions Status Actions Status Test Coverage Maintainability Packages npm version

Returns a Map implementation over a plain object! This is useful if you have a project that can receive a Map or a Record, but you want to access it's properties seamless

How to Install

npm i record-map

How to use it

Just pass the Record/plain object or Map to recordMap:

const result = recordMap(myMapOrPlainObject);

result will be an instance of Map!

But why not just use new Map(Object.entries(plainObject))?

The following command also converts a plain object do Map:

const result = new Map(Object.entries(plainObject))

But the advantage of recordMap is that no overload with a loop through plainObject properties is made. Making this conversion much more efficient!

License

Licensed under MIT.

/record-map/

    Package Sidebar

    Install

    npm i record-map

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    8.69 kB

    Total Files

    6

    Last publish

    Collaborators

    • pedrosodre
    • danielcarvalho
    • gustavobeavis
    • paulododt
    • fgabrielsilva
    • danielgaleni
    • farenheith
    • jeocoutinho