{"name":"@jridgewell/set-array","version":"1.0.1","description":"Like a Set, but provides the index of the `key` in the backing array","keywords":[],"author":{"name":"Justin Ridgewell","email":"justin@ridgewell.name"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/jridgewell/set-array.git"},"main":"dist/set-array.umd.js","module":"dist/set-array.mjs","typings":"dist/types/set-array.d.ts","exports":{".":{"browser":"./dist/set-array.umd.js","require":"./dist/set-array.umd.js","import":"./dist/set-array.mjs"},"./package.json":"./package.json"},"engines":{"node":">=6.0.0"},"scripts":{"prebuild":"rm -rf dist","build":"run-s -n build:*","build:rollup":"rollup -c rollup.config.js","build:ts":"tsc --project tsconfig.build.json","lint":"run-s -n lint:*","lint:prettier":"npm run test:lint:prettier -- --write","lint:ts":"npm run test:lint:ts -- --fix","pretest":"run-s build:rollup","test":"run-s -n test:lint test:only","test:debug":"mocha --inspect-brk","test:lint":"run-s -n test:lint:*","test:lint:prettier":"prettier --check '{src,test}/**/*.ts'","test:lint:ts":"eslint '{src,test}/**/*.ts'","test:only":"mocha","test:coverage":"c8 mocha","test:watch":"mocha --watch","prepublishOnly":"npm run preversion","preversion":"run-s test build"},"devDependencies":{"@rollup/plugin-typescript":"8.3.0","@typescript-eslint/eslint-plugin":"5.10.0","@typescript-eslint/parser":"5.10.0","c8":"7.11.0","eslint":"8.7.0","eslint-config-prettier":"8.3.0","mocha":"9.2.0","npm-run-all":"4.1.5","prettier":"2.5.1","rollup":"2.66.0","typescript":"4.5.5"},"gitHead":"34d5047da88c4e7b652c676b8dad82a58b5f1959","bugs":{"url":"https://github.com/jridgewell/set-array/issues"},"homepage":"https://github.com/jridgewell/set-array#readme","_id":"@jridgewell/set-array@1.0.1","_nodeVersion":"18.0.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-Iw06mKX2+V76Rg9Pv8jwhz5PR/8pZyhNZtJvvbgwAGQ9K7CYful9T0sr3cLwPnGEFVgxiklHEc/RSfGsFfmTWg==","shasum":"bea80659de61bed6d9a7e2e4ff61cde37090f10a","tarball":"http://registry-npm.ywwl.com/@jridgewell/set-array/download/@jridgewell/set-array-1.0.1.tgz","fileCount":8,"unpackedSize":11660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEU9T2Ve+T2MysWHIAO4uUk3AlVnw1jM3zNq407uGrRDAiA2gWZ8MQZQ2zmShwmGVAGPlTWzoVUJtuW+CPb1uSj/8w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZMl3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4vw//Uu7KGkgDOH12toIWBowzMOAzFmtjI+5wXpf3IH3RGIGchPw3\r\nSM8bRlhyLAzpw53+gNByGEZdfvkJGfILNDK1IvBG/celvg2Fql9qItQZvfAf\r\n9myJDrVsScoPNJLbcz6tbBdGnkRgXFj3yLFFYrHBWDeai5h4JXKB/aPJ9CeY\r\nGn/FifNt8R75aNS+WsF9s01TqLRl0Y/Pbs959lluGfozmUtcosxOSjHu9tUr\r\nHM0vSU7i4UJ8E8ghq3Du0Xm7oAlONREdw3LR/QJSQrwnlgGBcoDD1dWMHu2x\r\n9XLcBSpis424NnOPF9nRAaZ4WHfj5E48rpv1UB+KmWzbkmntl2gJ/0sDQnjR\r\nmAj8V3c1xwzvbaPBwmw1In7XHEIf1bAaD9fWE1ofeLeWncfxUVTcvAd80Qpj\r\nPfQMQBdbShFN2iYk8HvNQGggiOPUZ3NDqaArTd7/tJYIG+n8ln1//zHljhy6\r\nSamVNiRBOBqIYTpRm/WB2mDKUvqugd0Qw3lzWGC8GciIq3Z3vbPYQNhcct3b\r\naq4foWv4+hWH9+bkkx4MvM8LvF3h96+TkREyrkb+tds5ZAIAzmyc1UrlS3XX\r\nwgdNiXOMgN3x3SwzqvS/xBHCbstWBiLskVdQ2OLFUmhiB8jTFPj9AMK8e8+S\r\nwWDwZ5OBLJ69Rp7eHxWdoTyGR7ZY2Y6Ke5E=\r\n=pII8\r\n-----END PGP SIGNATURE-----\r\n","size":3299,"noattachment":false,"key":"/@jridgewell/set-array/-/@jridgewell/set-array-1.0.1.tgz"},"_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"directories":{},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-array_1.0.1_1650772343715_0.14753408069345597"},"_hasShrinkwrap":false,"readme":"# @jridgewell/set-array\n\n> Like a Set, but provides the index of the `key` in the backing array\n\nThis is designed to allow synchronizing a second array with the contents of the backing array, like\nhow in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, and there\nare never duplicates.\n\n## Installation\n\n```sh\nnpm install @jridgewell/set-array\n```\n\n## Usage\n\n```js\nimport { SetArray, get, put, pop } from '@jridgewell/set-array';\n\nconst sa = new SetArray();\n\nlet index = put(sa, 'first');\nassert.strictEqual(index, 0);\n\nindex = put(sa, 'second');\nassert.strictEqual(index, 1);\n\nassert.deepEqual(sa.array, [ 'first', 'second' ]);\n\nindex = get(sa, 'first');\nassert.strictEqual(index, 0);\n\npop(sa);\nindex = get(sa, 'second');\nassert.strictEqual(index, undefined);\nassert.deepEqual(sa.array, [ 'first' ]);\n```\n","publish_time":1650772343892,"_cnpm_publish_time":1650772343892,"dist-tags":{"latest":"1.2.1"}}