{"name":"@jridgewell/set-array","version":"1.1.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":{".":{"types":"./dist/types/set-array.d.ts","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":"8e7745bfea0f3fc9591743e3f3cdf0e0481caea2","bugs":{"url":"https://github.com/jridgewell/set-array/issues"},"homepage":"https://github.com/jridgewell/set-array#readme","_id":"@jridgewell/set-array@1.1.1","_nodeVersion":"17.6.0","_npmVersion":"8.5.1","dist":{"integrity":"sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==","shasum":"36a6acc93987adcf0ba50c66908bd0b70de8afea","tarball":"http://registry-npm.ywwl.com/@jridgewell/set-array/download/@jridgewell/set-array-1.1.1.tgz","fileCount":8,"unpackedSize":13777,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2gAy/Cb5aOkp9fPvLHDIms9VjJLVYbo2iifdDImipkQIgZrtphHsB6UVQw8kSLmiOsr36tqTSDKgqUxMu7fIl42Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidEiAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4ZQ//eYba/4hU9YrJVoVAOQ1m8uCpKXAGDKWRPD9L9WOU69oh0jem\r\n0YeSEqNaP3Pyba1cNJ67BddZpSjYv+n/0lDvyMyWvTdeTt7H7pY0uYUqYR5y\r\nVoK/7YVy43Za/6UQXqfz4fPBB6dORGptyC69KB7kpNcJlXW2AWTdbtVXAkTu\r\nSCIQjz8PcYQaLBfTkwdEE2vulqjk7wBGGyvLg7XRzlMfrV5bghdYsBdYyWp4\r\nu1n9c1m8ZadiRl8aSbes4QnuphgeE1/EQG0sIuhRc4dCeppHNb8Jp8WyEOFy\r\nO7uISAhSu+e0TLMGCvmEN+/sStEnMcP2/XLcRQvpiqZ21ctOOkABgQiVWT7v\r\n84uDYDcgwr/4LSI/tCultnP6cfhGjSpgHmBIidooz1d1TWP67t9PuFe0pspw\r\nG92cMcYQS67cYACcwXxRDTeqxf3yE5MtDDJB/danpWcHXm8APArowLDDunoC\r\n6NSM26nD9eEIhxhQvaGZEm+6ONtyT8fcxotWq5mMnKVIxhntC7O6wLZfXJgP\r\nGPajJofTs3HfnpDj1OxqJ7L0Q3YSn6Rb+nDHGY8C/hwivHj48TiXwBYYb3Fz\r\ngB1BWs1K2z5M9axTCFs3cmqXocLKoi5fn1wmsjFveCwiYnyTmUF/wI7dFYd9\r\namcH5AYDXq7j/Cb5ItvT6qbeZC96BPcTDcQ=\r\n=FeyK\r\n-----END PGP SIGNATURE-----\r\n","size":3616,"noattachment":false,"key":"/@jridgewell/set-array/-/@jridgewell/set-array-1.1.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.1.1_1651787904234_0.5314423371348553"},"_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":1651787904430,"_cnpm_publish_time":1651787904430,"dist-tags":{"latest":"1.2.1"}}