0.1.1 • Published 3 years ago

record-map v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.