{"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":{"integrity":"sha512-WETlA0/zRd8PzEZIuSHJ08bZRMTkc0QRuUGvrnqvBsj4coWIBs4yuJPl2KvLSmiDNGuutnkvWP9EQ4gu/WRPwQ==","shasum":"1ec7e86b8cce728b351c5ecfe66c18413899e9a5","tarball":"http://registry-npm.ywwl.com/@bloomberg/record-tuple-polyfill/download/@bloomberg/record-tuple-polyfill-0.0.1.tgz","fileCount":3,"unpackedSize":56273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffda4CRA9TVsSAnZWagAAuUAP/R0Y2rgH3uNsArg/2LEZ\nBotFDU1CYtN3xdSX622vkPAEzVuRCkr3moDo/8Vjhb86srn0/m0Wfwo6EuXP\n/9+gXzsoeL8rCrLtFKOPJ562oaNhUrwwmXHhBJohg8AByP8WaWjt/pZeT4jp\n6CFWRQGeewcBVUod78hI0NW6C5K5pCHKnQJg1GgBBRTH2280nO7dV7cJkz0B\nhJmfYrmHniUOicoO8uzclUqOzcUdtpldxO7Fjk98YxleEfo3Mo3f/vTjEfNS\neRzDVn4roLCy+4DYXim/9Y9zbQX4J30fJadyHNwe/f47Pa8PPFndF0G1WMhA\nrGrlvHafLzowgOpXYkSRQaFiPa8gRBqvvAmV/HKYVJjcIE0D9ibmrjQGO6Jo\nHjpi9K8m5L8soE8VufTPtSqBreSN696H707CW2Zc3r+sCE2kU2UW+z/DsXQB\ninBeXXBsIoOlzffe9hKk8Zir1tslSzXGMlYdN3C0Tuu8fNslKsMQ5Zal9avB\nD6HeOeYsbS0YCYaxlOomvCPgZ4C05JnNEbzJIvctChckqg5q7YBSV3q5oPTu\nY+x9OQJi/d5CTJDQbJO+8FjVOpuiOfuJVKEuML1KpStC5YULCvLsMVtrXTMk\n5OX+WTX7y9H557ThZGOU7DkFhoJJOAfuBR+qU9I8fvWs8XljQHR5I9nd7FOu\nUqmn\r\n=PL8k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcRgAbIFsf0t5lFu76sQKMZ+xzdHxazLF13r9hz2Ny6wIhAKzMND9Uodra4RaBDmwsLXnBXFt0COAF9RVKrIMgeOPp"}],"size":9415,"noattachment":false,"key":"/@bloomberg/record-tuple-polyfill/-/@bloomberg/record-tuple-polyfill-0.0.1.tgz"},"maintainers":[{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},{"name":"bloomberg-oss","email":"opensource@bloomberg.net"},{"name":"kpfleming","email":"kevin@km6g.us"}],"_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,"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","publish_time":1602082488555,"_cnpm_publish_time":1602082488555,"dist-tags":{"latest":"0.0.4"}}