{"_id":"@bloomberg/record-tuple-polyfill","_rev":"2836783","name":"@bloomberg/record-tuple-polyfill","description":"A polyfill for the Record and Tuple Stage 2 ECMAScript proposal.","dist-tags":{"latest":"0.0.4"},"maintainers":[{"name":"bbgbuilder","email":""},{"name":"bloomberg-oss","email":""}],"time":{"modified":"2022-09-06T15:38:43.000Z","created":"2020-10-07T14:54:48.555Z","0.0.4":"2021-10-26T19:41:00.850Z","0.0.3":"2020-11-02T17:39:43.787Z","0.0.2":"2020-10-07T15:39:20.844Z","0.0.1":"2020-10-07T14:54:48.555Z"},"users":{},"author":{"name":"Rick Button","email":"rbutton2@bloomberg.net"},"repository":{"type":"git","url":"git+https://github.com/bloomberg/record-tuple-polyfill.git"},"versions":{"0.0.4":{"name":"@bloomberg/record-tuple-polyfill","version":"0.0.4","description":"A polyfill for the Record and Tuple Stage 2 ECMAScript proposal.","main":"lib/index.umd.js","module":"lib/index.esm.js","scripts":{"clean":"rm -rf ./lib"},"repository":{"type":"git","url":"git+https://github.com/bloomberg/record-tuple-polyfill.git"},"keywords":["record","tuple","record and tuple","polyfill","ecmascript"],"author":{"name":"Rick Button","email":"rbutton2@bloomberg.net"},"contributors":[{"name":"Robin Ricard","email":"rricard2@bloomberg.net"},{"name":"Nicolò Ribaudo","email":"nribaudo1@bloomberg.net"}],"license":"Apache-2.0","publishConfig":{"access":"public"},"gitHead":"61ab72bc792f71d9779894cc2cd9df5429614799","bugs":{"url":"https://github.com/bloomberg/record-tuple-polyfill/issues"},"homepage":"https://github.com/bloomberg/record-tuple-polyfill#readme","_id":"@bloomberg/record-tuple-polyfill@0.0.4","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"shasum":"9ef3df44e472ceb9a0a2010d858a526f2021fefa","size":11289,"noattachment":false,"key":"/@bloomberg/record-tuple-polyfill/-/@bloomberg/record-tuple-polyfill-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@bloomberg/record-tuple-polyfill/download/@bloomberg/record-tuple-polyfill-0.0.4.tgz"},"_npmUser":{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},"directories":{},"maintainers":[{"name":"bbgbuilder","email":""},{"name":"bloomberg-oss","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/record-tuple-polyfill_0.0.4_1635277260672_0.4303316034988902"},"_hasShrinkwrap":false,"publish_time":1635277260850,"_cnpm_publish_time":1635277260850,"_cnpmcore_publish_time":"2021-12-16T15:54:21.178Z"},"0.0.3":{"name":"@bloomberg/record-tuple-polyfill","version":"0.0.3","description":"A polyfill for the Record and Tuple Stage 2 ECMAScript proposal.","main":"lib/index.umd.js","module":"lib/index.esm.js","scripts":{"clean":"rm -rf ./lib"},"repository":{"type":"git","url":"git+https://github.com/bloomberg/record-tuple-polyfill.git"},"keywords":["record","tuple","record and tuple","polyfill","ecmascript"],"author":{"name":"Rick Button","email":"rbutton2@bloomberg.net"},"contributors":[{"name":"Robin Ricard","email":"rricard2@bloomberg.net"},{"name":"Nicolò Ribaudo","email":"nribaudo1@bloomberg.net"}],"license":"Apache-2.0","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/bloomberg/record-tuple-polyfill/issues"},"homepage":"https://github.com/bloomberg/record-tuple-polyfill#readme","_id":"@bloomberg/record-tuple-polyfill@0.0.3","_nodeVersion":"15.0.1","_npmVersion":"7.0.3","dist":{"shasum":"0b03d18b88a30894caab14abd669b1cbbf47b843","size":11103,"noattachment":false,"key":"/@bloomberg/record-tuple-polyfill/-/@bloomberg/record-tuple-polyfill-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@bloomberg/record-tuple-polyfill/download/@bloomberg/record-tuple-polyfill-0.0.3.tgz"},"maintainers":[{"name":"bbgbuilder","email":""},{"name":"bloomberg-oss","email":""}],"_npmUser":{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/record-tuple-polyfill_0.0.3_1604338783631_0.8047486832928579"},"_hasShrinkwrap":false,"publish_time":1604338783787,"_cnpm_publish_time":1604338783787,"_cnpmcore_publish_time":"2021-12-16T15:54:21.438Z"},"0.0.2":{"name":"@bloomberg/record-tuple-polyfill","version":"0.0.2","description":"A polyfill for the Record and Tuple Stage 2 ECMAScript proposal.","main":"lib/index.umd.js","module":"lib/index.esm.js","scripts":{"clean":"rm -rf ./lib"},"repository":{"type":"git","url":"git+https://github.com/bloomberg/record-tuple-polyfill.git"},"keywords":["record","tuple","record and tuple","polyfill","ecmascript"],"author":{"name":"Rick Button","email":"rbutton2@bloomberg.net"},"contributors":[{"name":"Robin Ricard","email":"rricard2@bloomberg.net"},{"name":"Nicolò Ribaudo","email":"nribaudo1@bloomberg.net"}],"license":"Apache-2.0","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/bloomberg/record-tuple-polyfill/issues"},"homepage":"https://github.com/bloomberg/record-tuple-polyfill#readme","_id":"@bloomberg/record-tuple-polyfill@0.0.2","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"shasum":"129aff7fe790961e9996bfd31be286d2b77f9cc3","size":10840,"noattachment":false,"key":"/@bloomberg/record-tuple-polyfill/-/@bloomberg/record-tuple-polyfill-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@bloomberg/record-tuple-polyfill/download/@bloomberg/record-tuple-polyfill-0.0.2.tgz"},"maintainers":[{"name":"bbgbuilder","email":""},{"name":"bloomberg-oss","email":""}],"_npmUser":{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/record-tuple-polyfill_0.0.2_1602085160704_0.23131013051252025"},"_hasShrinkwrap":false,"publish_time":1602085160844,"_cnpm_publish_time":1602085160844,"_cnpmcore_publish_time":"2021-12-16T15:54:21.624Z"},"0.0.1":{"name":"@bloomberg/record-tuple-polyfill","version":"0.0.1","description":"A polyfill for the Record and Tuple Stage 2 ECMAScript proposal.","main":"lib/index.umd.js","module":"lib/index.esm.js","scripts":{"clean":"rm -rf ./lib"},"repository":{"type":"git","url":"git+https://github.com/bloomberg/record-tuple-polyfill.git"},"keywords":["record","tuple","record and tuple","polyfill","ecmascript"],"author":{"name":"Rick Button","email":"rbutton2@bloomberg.net"},"contributors":[{"name":"Robin Ricard","email":"rricard2@bloomberg.net"},{"name":"Nicolò Ribaudo","email":"nribaudo1@bloomberg.net"}],"license":"Apache-2.0","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/bloomberg/record-tuple-polyfill/issues"},"homepage":"https://github.com/bloomberg/record-tuple-polyfill#readme","_id":"@bloomberg/record-tuple-polyfill@0.0.1","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"shasum":"1ec7e86b8cce728b351c5ecfe66c18413899e9a5","size":9415,"noattachment":false,"key":"/@bloomberg/record-tuple-polyfill/-/@bloomberg/record-tuple-polyfill-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@bloomberg/record-tuple-polyfill/download/@bloomberg/record-tuple-polyfill-0.0.1.tgz"},"maintainers":[{"name":"bbgbuilder","email":""},{"name":"bloomberg-oss","email":""}],"_npmUser":{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/record-tuple-polyfill_0.0.1_1602082488437_0.2994603136315519"},"_hasShrinkwrap":false,"publish_time":1602082488555,"_cnpm_publish_time":1602082488555,"_cnpmcore_publish_time":"2021-12-16T15:54:21.856Z"}},"readme":"# Record & Tuple Polyfill\nThe [Record and Tuple](https://github.com/tc39/proposal-record-tuple) ECMAScript proposal introduces new deeply immutable value types to JavaScript\nthat have similar access idioms to objects and arrays.\n\nThis is an **experiemental and explicitly not production ready** polyfill for the `Record and Tuple` proposal, and a [babel](https://babeljs.io) transform to support using the literal syntax.\n\nThe polyfill and transform are **constant works in progress** and are not the source of truth for the proposal.\n\n# Requirements\n\nIn order to use the syntax transform, [babel](https://babeljs.io) must be installed with at least version `7.9.0`.\n\nIn order to use the polyfill, the environment must support `WeakMap`, [`WeakRef`, and `FinalizationRegistry`](https://github.com/tc39/proposal-weakrefs). If implementations of these features are not provided, an error will be thrown.\n\n# Installation\n\n> Note: the Babel transform described below is not currently published on NPM, [as it is awaiting review](https://github.com/babel/babel/pull/12145).\n> If you really want to try the Babel transform plugin in it's packaged state, publishing locally via [verdaccio](https://verdaccio.org/) is an excellent option.\n\nTo install the transform and polyfill:\n\n```\n# install the babel transform as a dev dependency, only needed at compile time\nnpm install -D @bloomberg/babel-plugin-proposal-record-tuple\n\n# install the polyfill as a regular dependency, needed at runtime\nnpm install --save @bloomberg/record-tuple-polyfill\n```\n\nNext, add the plugin to your `babel` configuration. Example:\n\n```json\n{\n    \"plugins\": [[\"@bloomberg/babel-plugin-proposal-record-tuple\", { \"syntaxType\": \"hash\" }]]\n}\n```\n\n> Note, the `syntaxType` option is required, and must be set to either `hash` or `bar`.\n\n# Usage\n\nIf the `babel` transform and the polyfill are setup, you can start using the `Record and Tuple` literal syntax.\n\n```js\nconsole.log(#{ a: 1 } === #{ a: 1 });\nconsole.log(#[1, 2, 3] === #[1, 2, 3]);\n```\n\nIf you want to use the Record or Tuple global objects, you can import them from the polyfill directly.\n\n```js\nimport { Record, Tuple } from \"@bloomberg/record-tuple-polyfill\";\n\nconst record = Record({ a: 1 });\nconst tuple = Tuple(1, 2, 3);\nconst array = [1,2,3];\n\nconsole.log(Record.isRecord(record));\nconsole.log(Record.keys(record));\nconsole.log(Tuple.from(array));\n```\n\n# Unsupported Features\n\n`typeof` will return an incorrect value when provided a `Record` or `Tuple`.\nThis is because the polyfill implements the proposal via [interning](https://en.wikipedia.org/wiki/String_interning) frozen objects.\n\n# Playground\n\nThe Record and Tuple polyfill has been deployed in an easy to use REPL [here](https://rickbutton.github.io/record-tuple-playground/).\n\n## Supported Environments/Browsers\n\nThe Record and Tuple polyfill requires several JavaScript features that are only available experimentally in browsers, specifically `WeakRef` and `FinalizationRegistry`.\n\nThe following environments support these experimental features out-of-the-box.\n\n| environment     | supported                                |\n|-----------------|------------------------------------------|\n| [Chrome Canary](https://www.google.com/chrome/canary/)   | :heavy_check_mark:                       |\n\n\nIn order to use these experimental features other browsers, you must run the browser/environment with specific flags:\n\n| environment     | flags                                    |\n|-----------------|------------------------------------------|\n| node            | --harmony-weak-refs                      |\n| Chrome          | --js-flags=\"--harmony-weak-refs\"         |\n| Firefox Nightly | javascript.options.experimental.weakrefs |\n","_attachments":{},"homepage":"https://github.com/bloomberg/record-tuple-polyfill#readme","bugs":{"url":"https://github.com/bloomberg/record-tuple-polyfill/issues"},"license":"Apache-2.0"}