{"name":"@jridgewell/set-array","version":"1.1.0","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","@types/mocha":"9.1.1","@types/node":"17.0.29","@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":"cbdbd43c63eed119f7e8a2a4aa12de937ce78b89","bugs":{"url":"https://github.com/jridgewell/set-array/issues"},"homepage":"https://github.com/jridgewell/set-array#readme","_id":"@jridgewell/set-array@1.1.0","_nodeVersion":"17.6.0","_npmVersion":"8.5.1","dist":{"integrity":"sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg==","shasum":"1179863356ac8fbea64a5a4bcde93a4871012c01","tarball":"http://registry-npm.ywwl.com/@jridgewell/set-array/download/@jridgewell/set-array-1.1.0.tgz","fileCount":8,"unpackedSize":13610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmiShJfnM2HXJT957/yqUub9MEaV/gZuBNkDmd2YjxAAiEA5Q3qk8pCTVw3t/Qj/0CS8ZbX8N9Egst+qAM8r9yqZSg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaNKUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpofQ/8Dp6xD6oTyl37t3EGGYDyjeGQeFb+5MzQhTBN0A2JU+IHQsXE\r\n8uKadbZWv2Oq4Grr7cJBhqu/e4GkBA+vhNQ6hyuCIdLnn9tNInSF5Jb9FU+p\r\ninDeOsfYiP0eBUwU/RX/GMs3a7iUPcxId5Lihv/HybF5DCDTOKpMqu2htQdl\r\nsUx4pWSyrFxsS+ni5MMKFPHRPt0VFbEeIyf3Mozre/sslwJwIZQKa1SCtKHH\r\nT3bbEzjlqdlxWcQQoA1NWoNYteBpS6tef37WmgqfFGc/eDfReeIjbfx8v7hw\r\nMVfEqGhD7LEIUwOUtcyHYWNwBH51XThKEjSkzmO3oIn3BbbJGlhyU8SpjhdV\r\nfKFLR5GCJEL8dctzu7lgoHHWle3n3ZyOCFCUL+wcpVJcATHU4yqPi16GReKR\r\nDCoGEvrU0V8K4tiQOJC7o2Fw6kcA8suPAWpc21XEvQZF4oDNgENkwhddCkCT\r\nagGgQcZDCDlH9r3CiejPfSbB1dHKJPqnkp0rMc1142ef4omKjYQkVy/MYGus\r\n3cF/TNjvIS7lCBkKJlWJfErxAgwgLLKF7I9dmvsTldS3ol5sw/63lBQOFPPM\r\npdRGP/sclLUjhNvHwRMNTC7RXU/okCT6Yrznntg0tppxWzgsQQLfAZifNHNl\r\n9qAhJk070B+pwsTBZMaQWEV1/vvMOgIszuQ=\r\n=l49e\r\n-----END PGP SIGNATURE-----\r\n","size":3585,"noattachment":false,"key":"/@jridgewell/set-array/-/@jridgewell/set-array-1.1.0.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.1.0_1651036820481_0.5564058866445729"},"_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":1651036820653,"_cnpm_publish_time":1651036820653,"dist-tags":{"latest":"1.2.1"}}