Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
record-tuple-convert
Advanced tools
Readme
As the record and tuple proposal is still in it's early stages, this package is not using a finalized API, so breaking changes might be frequent.
Since Babel still yet doesn't have a transform for Records and Tuples, you'll need to use @bloomberg/record-tuple-polyfill.
const convertToRecord = require('record-tuple-convert').convertToRecord;
const convertToTuple = require('record-tuple-convert').convertToTuple;
// Convert simple objects
convertToRecord({ foo: 'bar' }); // -> #{ foo: 'bar' }
// Convert deep objects
convertToRecord({
foo: {
bar: 'baz'
}
}); // #{ foo: #{ bar: 'baz' } }
// Convert simple arrays
convertToTuple(['foo', 'bar']); // -> #['foo', 'bar']
// Convert nth-dimensional arrays
convertToTuple(['foo', ['bar', ['baz']]]); // -> #['foo', #['bar', #['baz']]]
// Mix and match!
convertToRecord({ foo: ['bar'], baz: true }); // -> #{ foo: #['bar'], baz: true }
convertToTuple(['foo', { bar: 'baz' }]) // -> #['foo', #{ bar: 'baz' }]
This repo is open to issues and PRs, they are even encouraged!
To get setup, clone the repo, run npm install
and follow the instructions at @bloomberg/record-tuple-polyfill to install the polyfill.
To run the tests, run npm test
.
FAQs
Easily convert deep Objects and Arrays to Records and Tuples.
The npm package record-tuple-convert receives a total of 4 weekly downloads. As such, record-tuple-convert popularity was classified as not popular.
We found that record-tuple-convert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.