{"_id":"map.prototype.getorinsertcomputed","_rev":"2-57f1215430813d49b77eedaabb513b84","name":"map.prototype.getorinsertcomputed","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"map.prototype.getorinsertcomputed","version":"1.0.0","keywords":["javascript","ecmascript","polyfill","shim","es-shims","API","map","upsert","getOrInsertComputed","computed","insert","get"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","_id":"map.prototype.getorinsertcomputed@1.0.0","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"homepage":"https://github.com/es-shims/Map.prototype.getOrInsertComputed#readme","bugs":{"url":"https://github.com/es-shims/Map.prototype.getOrInsertComputed/issues"},"dist":{"shasum":"c5f13b3dd85004b2c5a0bdab45b17179ce1f6830","tarball":"https://registry.npmjs.org/map.prototype.getorinsertcomputed/-/map.prototype.getorinsertcomputed-1.0.0.tgz","fileCount":17,"integrity":"sha512-o/YRDDdvxjTZZBWOLWjR3oh1bK0Hs1ylCGWPYrM0AXLcbbvYYSaAez6faooHVmYUOINYkJo9ajilEcp8yCBIcg==","signatures":[{"sig":"MEQCIG5cQ3aF9Q0NK7TpjIGyDHLDdXLfL+9xkg7K4DRPaPCoAiBpwrg39uyluY6jJ/057RSUTQ0TumuXcJ8JTe2S/54mdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14953},"main":"index.js","engines":{"node":">= 0.4"},"exports":{".":"./index.js","./auto":"./auto.js","./shim":"./shim.js","./polyfill":"./polyfill.js","./package.json":"./package.json","./implementation":"./implementation.js"},"gitHead":"3b61523650ac802dc9c5034a7a267913850c88e8","scripts":{"lint":"eslint --ext=js,mjs .","test":"npm run tests-only","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run --silent lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api && evalmd README.md","posttest":"npx npm@\">= 10.2\" audit --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape 'test/**/*.js'","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"testling":{"files":"test/shimmed.js"},"repository":{"url":"git+https://github.com/es-shims/Map.prototype.getOrInsertComputed.git","type":"git"},"_npmVersion":"10.9.2","description":"ES Proposal spec-compliant shim for Map.prototype.getOrInsertComputed","directories":{},"_nodeVersion":"23.11.0","dependencies":{"es-map":"^2.0.1","call-bind":"^1.0.8","es-errors":"^1.3.0","es-abstract":"^1.23.9","define-properties":"^1.2.1"},"publishConfig":{"ignore":[".github/workflows"]},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"nyc":"^10.3.2","tape":"^5.9.0","eslint":"=8.8.0","evalmd":"^0.0.19","for-each":"^0.3.5","npmignore":"^0.3.1","in-publish":"^2.0.1","@es-shims/api":"^3.0.2","auto-changelog":"^2.5.0","object-inspect":"^1.13.4","es-value-fixtures":"^1.7.1","safe-publish-latest":"^2.0.0","functions-have-names":"^1.2.3","@ljharb/eslint-config":"^21.1.1"},"_npmOperationalInternal":{"tmp":"tmp/map.prototype.getorinsertcomputed_1.0.0_1745455451391_0.6359557759847405","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"map.prototype.getorinsertcomputed","version":"1.0.1","description":"ES Proposal spec-compliant shim for Map.prototype.getOrInsertComputed","main":"index.js","exports":{".":"./index.js","./auto":"./auto.js","./polyfill":"./polyfill.js","./implementation":"./implementation.js","./shim":"./shim.js","./package.json":"./package.json"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","pretest":"npm run --silent lint","test":"npm run tests-only","posttest":"npx npm@\">= 10.2\" audit --production","tests-only":"nyc tape 'test/**/*.js'","lint":"eslint --ext=js,mjs .","postlint":"es-shim-api && evalmd README.md","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/es-shims/Map.prototype.getOrInsertComputed.git"},"keywords":["javascript","ecmascript","polyfill","shim","es-shims","API","map","upsert","getOrInsertComputed","computed","insert","get"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/es-shims/Map.prototype.getOrInsertComputed/issues"},"homepage":"https://github.com/es-shims/Map.prototype.getOrInsertComputed#readme","devDependencies":{"@es-shims/api":"^3.0.2","@ljharb/eslint-config":"^21.1.1","auto-changelog":"^2.5.0","encoding":"^0.1.13","es-value-fixtures":"^1.7.1","eslint":"=8.8.0","evalmd":"^0.0.19","for-each":"^0.3.5","functions-have-names":"^1.2.3","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","object-inspect":"^1.13.4","safe-publish-latest":"^2.0.0","tape":"^5.9.0"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">= 0.4"},"testling":{"files":"test/shimmed.js"},"dependencies":{"call-bind":"^1.0.8","define-properties":"^1.2.1","es-abstract":"^1.23.9","es-errors":"^1.3.0","es-map":"^2.0.1"},"_id":"map.prototype.getorinsertcomputed@1.0.1","gitHead":"9220d9d63f28c45fb0e2cb6ba83519ac1f2e59d2","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-lrkQOGrXcv+21Rtrw6F4JA6qtVR/Px3uyVMAS7oqdu/OmaFANAF8tQ8uMZSDQ5tNUNuNiBAewK122zrsjx0Mug==","shasum":"46238e3684e99d0ed2ed2d88682382018864d66c","tarball":"https://registry.npmjs.org/map.prototype.getorinsertcomputed/-/map.prototype.getorinsertcomputed-1.0.1.tgz","fileCount":17,"unpackedSize":15567,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDRVfOg/auoVKysANYlGXh5K1bCyowGbCcx1YK4F9wZ3gIgD3Upt9nKB1hKOFQ4jx8iJW16RUs+x2uqU0KzEPdWgk4="}]},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/map.prototype.getorinsertcomputed_1.0.1_1745731067737_0.21758387128217938"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-24T00:44:11.388Z","modified":"2025-04-27T05:17:48.112Z","1.0.0":"2025-04-24T00:44:11.601Z","1.0.1":"2025-04-27T05:17:47.922Z"},"bugs":{"url":"https://github.com/es-shims/Map.prototype.getOrInsertComputed/issues"},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","homepage":"https://github.com/es-shims/Map.prototype.getOrInsertComputed#readme","keywords":["javascript","ecmascript","polyfill","shim","es-shims","API","map","upsert","getOrInsertComputed","computed","insert","get"],"repository":{"type":"git","url":"git+https://github.com/es-shims/Map.prototype.getOrInsertComputed.git"},"description":"ES Proposal spec-compliant shim for Map.prototype.getOrInsertComputed","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"readme":"# map.prototype.getorinsertcomputed <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ESnext spec-compliant `Map.prototype.getOrInsertComputed` shim/polyfill/replacement that works as far down as ES3.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) v3 interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.github.io/proposal-array-grouping/).\n\n## Getting started\n\n```sh\nnpm install --save map.prototype.getorinsertcomputed\n```\n\n## Usage/Examples\n\n```js\nvar getOrInsertComputed = require('map.prototype.getorinsertcomputed');\nvar assert = require('assert');\n\nvar map = new Map();\nvar key = {};\nvar value = {};\n\nassert.equal(map.has(key), false);\nassert.equal(getOrInsertComputed(map, key, () => value), value);\nassert.equal(map.has(key), true);\n```\n\n```js\nvar getPolyfill = require('map.prototype.getorinsertcomputed/polyfill');\nvar shim = require('map.prototype.getorinsertcomputed/shim');\nvar assert = require('assert');\n/* when Map.prototype.getOrInsertComputed is not present */\ndelete Map.prototype.getOrInsertComputed;\nvar shimmed = shim();\n\nassert.equal(shimmed, getPolyfill());\n\nvar map = new Map();\nvar key = {};\nvar value = {};\n\nassert.equal(map.has(key), false);\nassert.equal(map.getOrInsertComputed(key, () => value), value);\nassert.equal(map.has(key), true);\n```\n\n```js\nvar shim = require('map.prototype.getorinsertcomputed/shim');\nvar assert = require('assert');\n/* when Map.prototype.getOrInsertComputed is present */\nvar shimmed = shim();\n\nassert.equal(shimmed, Map.prototype.getOrInsertComputed);\n\nvar map = new Map();\nvar key = {};\nvar value = {};\n\nassert.equal(map.has(key), false);\nassert.equal(map.getOrInsertComputed(key, () => value), value);\nassert.equal(map.has(key), true);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/map.prototype.getorinsertcomputed\n[npm-version-svg]: https://versionbadg.es/es-shims/Map.prototype.getOrInsertComputed.svg\n[deps-svg]: https://david-dm.org/es-shims/Map.prototype.getOrInsertComputed.svg\n[deps-url]: https://david-dm.org/es-shims/Map.prototype.getOrInsertComputed\n[dev-deps-svg]: https://david-dm.org/es-shims/Map.prototype.getOrInsertComputed/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Map.prototype.getOrInsertComputed#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/map.prototype.getorinsertcomputed.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/map.prototype.getorinsertcomputed.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/map.prototype.getorinsertcomputed.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=map.prototype.getorinsertcomputed\n[codecov-image]: https://codecov.io/gh/es-shims/Map.prototype.getOrInsertComputed/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Map.prototype.getOrInsertComputed/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Map.prototype.getOrInsertComputed\n[actions-url]: https://github.com/es-shims/Map.prototype.getOrInsertComputed/actions\n","readmeFilename":"README.md"}