{"_id":"@tracespace/xml-id","_rev":"10-4e6873f6657d7bc84393dd186007a399","name":"@tracespace/xml-id","dist-tags":{"next":"5.0.0-alpha.0","latest":"4.2.7"},"versions":{"4.0.0-next.13":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"4.0.0-next.13","description":"XML ID utilities for tracespace projects","main":"index.js","repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@4.0.0-next.13","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"mcous","email":"mike@cousins.io"},"dist":{"integrity":"sha512-LYdlgG1VlMDYg2OeRUAnro/znGLC2rWg2/3RQymqbi1QbmxvM2Jih5O/tmXR61jEK+FLhffr2CCZPkEslQLfhw==","shasum":"7ee9b229572400303e19f43841e7507a0d329320","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-4.0.0-next.13.tgz","fileCount":6,"unpackedSize":5455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmRvyCRA9TVsSAnZWagAArWQP/0oonoM9MfLIo5vWFI9w\n41ANSSzGeXwF0U8SSa3d3oPjj6UW76BVw0a/M08U2+0OQ/q/eX6zHaQ6eMBw\nAH/tIT4vMnFk4IxkRA4NkAIKn8LNfyHIzRhw3VMyFmssQL8ay1rHPNSubr8k\n6d+bW7Kn9FSwzScffkqe2OtGR/q0w0ZOswKEplZ3Zgyekc9s3fPV+kaGJpl3\nv1uT7YKzHjvOvccdfXEezkejrE29o54Xu/qnWFujRVJTMj4r3vaOjWhzcF2Q\n5gFGzjpJdY67TMcW8qzM8Od/hQRaTLxM4Mq46XVny8DF53VThz2+/9Si6agn\nOHkjaVTz47+/6U7jP5zSoQHXekspZUEvdCJWCsGhE7pEwLl1C29oGhS8HUtB\nmPGUMz4v6rfcPN0bBPzOMWh3gbdUkCVgMrdEwo8NvzaWUTYSrjAA0MIQXaUR\nI8UEMrPH/7E4kkx2ovf29HqyZfAuZEw6GmY/DtAmU3sl4qAii1cdcCa1m4fY\noWrR4lMSFebbqsTMa9W02BriP9PNB4S4jiNyPgLmmtWxKEAbwN6qkWie3lOM\nz8SusIcEEt41orS1p10kiVciS6NwspqlZJAiDJ8Tdw4I8w0v8ugwaG+GeKxS\nD6Xqj5uLWcgUYRgEQiP+5dhJpRHF5KWny+63QZ66ZPzcpx6FUWf/4hJMhgWS\nzF+A\r\n=AYgT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHGlKjAI8qZOz5KPKnbCkBtsH5CW8nzlL9xlpDq8W02HAiBsK1aQa76kXcc4UmI+NM9RxERqnqobTuj/C8HNSZvedw=="}]},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_4.0.0-next.13_1536760818310_0.2676434019368865"},"_hasShrinkwrap":false},"4.0.0-next.14":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"4.0.0-next.14","description":"XML ID utilities for tracespace projects","main":"index.js","repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","readme":"# xml id\n\n[![npm][npm-badge]][npm]\n\n> XML ID utilities for tracespace projects\n\nID attributes in XML documents (e.g. SVG images) have certain requirements. This module provides utility methods for sanitizing and generating strings to meet those requirements so they can safely be used as XML IDs.\n\nPart of the [tracespace][] collection of PCB visualization tools.\n\n[tracespace]: https://github.com/tracespace/tracespace\n[npm]: https://www.npmjs.com/package/@tracespace/xml-id\n[npm-badge]: https://img.shields.io/npm/v/@tracespace/xml-id.svg?style=flat-square&maxAge=3600\n\n## install\n\nPlease note: because this package is an internal utility library, it may not follow semver and breaking changes could be introduced in _any_ version bump. **You should install an exact version.**\n\n```shell\nnpm install --save --save-exact @tracespace/xml-id\n# or\nyarn add --exact @tracespace/xml-id\n```\n\n## usage\n\n```js\nconst {sanitize, random} = require('@tracespace/xml-id')\n```\n\nThe alphabet used by this module is a subset of what is valid for XML which is also CSS identifier and URL friendly.\n\n### sanitize(source: string): string\n\nTakes a string and replaces any characters that would be invalid in an XML ID with underscores (`_`).\n\n```js\nconst id = sanitize('0abc def.') // id === _abc_def_\n```\n\n### random(length: number): string\n\nReturns a basic, (non-cryptographically-secure) random string that can be safely used as an XML ID. If unspecified or 0, `length` will be 12.\n\n```js\nconst id = random()  // maybe \"w57gH_nT3-o8\"\nconst id = random(8) // maybe \"Gi3ma2Ef\"\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@4.0.0-next.14","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"mcous","email":"mike@cousins.io"},"dist":{"integrity":"sha512-jEFJpwSuDRkqoJfuYRE/VKQEiiF8hds1HXf94IFFg9CTqUVoz2vy9NajM2D5Jd5TdlZZD3kicRV+PNehNRvbyA==","shasum":"9257521a60c8ccb6a5f05cf8f4fbea96d0d5d802","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-4.0.0-next.14.tgz","fileCount":6,"unpackedSize":6011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwfKPCRA9TVsSAnZWagAA/QEQAKEleluZqm5z5ZyZidRv\neC95eFyhh+PvEUyYn1Yk3XErh5VEIGit6Ev1MKEe+m9dnqlNmBoHmYZwmOYW\nXtqLOO3Dyb14YTMRk/d3qsnyS02d5UavDL2FE4kutwXZfD20YazqxQOXZTSY\nOsRkMkAG7aOLULm4FpsvPQu4A+xZ8LXUP+erOEJE0gUptAcDHpyn+KzibBQx\njSoW2M+5bH13tr75kH3xIn9RYFVeumXHY0emFONJ86meKd0gdzodPMVcAqHC\nWTI6loO+d/62IVRC+w51cXAphCtG77JtFaQ3J6zXjxXZv46YPzl3wafK8JlT\nUXmPXjt5zu6A/lV5XKzCSyUFPv/A5qbXjTD2D81P9lNAvoeaM3bqNMQNWU3V\ngyl6oeDTezZbYPl5QeUPU3XKVRakDdJoJH1U3zIM9coR9shPr1lJBhIWm9MT\nhmlkIVMCHofMNJcWTCOr9AogCRSNpf7Hea0RjgMhWCeiR0Ty3O+mrqCYHMs9\nRTvbW0Ayq3raLe11SK1zhdS29I95cNswF0F18ydfngyfJWoK6QhyQkhwmmMM\n70fO44rARF57j1i1RoatvVjBkicm1LER9qqigJ9h1B+fHfguX+fBFAx4GWqD\nM5foTL4XjbcJobOBD9fXwsSlMqnougHHJREjyJU9h4fuICfvuLLriOn5ormY\np9aR\r\n=5U9L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGDlAMligmy2Rj5do+xRJDyaKgmd/0aESDD2ClbL8NjQIhAI9i9xPT05Y2x4jufVZvn9uPTeDL+G6aqgAvC9WMHrFU"}]},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_4.0.0-next.14_1539437198192_0.0028217393197655927"},"_hasShrinkwrap":false},"4.0.0-next.15":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"4.0.0-next.15","description":"XML ID utilities for tracespace projects","main":"index.js","repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","gitHead":"03aaf1f3d3c8432e77dac581dcbde15068da5e55","_resolved":"","_integrity":"","_from":"file:tracespace-xml-id-4.0.0-next.15.tgz","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@4.0.0-next.15","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"mcous","email":"mike@cousins.io"},"dist":{"integrity":"sha512-LxEL94P35xkP6vmAtAz79XRESK3AVQRVlEN53bXAyhAC4UUYKiu5+PvIAlM35US1T/5hTGXrEivm/vNUYfGUPQ==","shasum":"6482822072f66bf3e7ebd0f570acd08f403530d6","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-4.0.0-next.15.tgz","fileCount":6,"unpackedSize":7033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6izLCRA9TVsSAnZWagAAXb4P/1hEctWAUmrCyIY5c2HX\npK+5dEVFiZ4YMV4juve7gvaD6RL9asVToLUuXoLkgCl9Mf1NAXhlrmGiATJE\nRIPMJUyhegGyb3wAZ/54ARAKe+SpiK7K5zcBNd5wtRBg5g3YSOpAC0Kvwwco\ni93eZpG0lpqS0W96R93UgbyhtoJkkEgbC80GwnauPDZ63c8wKjvCG+xk6oAe\nzVDTlcVZltaOhKruidfs3OBIB9jafOGAMV3095vGdGT+MNIsYjTQKhAS8OII\nDpWQ8hUH4+irCtfFlLgA4oyHC87Gx0ch9o1/3X8rtc40zSIjGzJC/4bcfM4h\nS9a4WRTyg8fH92yz0g6e0KpyK8paGmeKRxy17ksr1vnHz3d32Tu8PE5YNPYT\nVnW8yH13F1O1eHNNFFTZ0gWZmQDLLh20w/3NX04QQO6ssogGIGl6PSWe7ytH\nOktIy6CqDfgl7kSplRW3FhlNV/pbty0BueeKSlCadKe9NyWRBScGF4RbXEMb\nHYWETChuZxuqqGXEYw969wLOjzyD6+IZeewEADXtUbrnYrKrTDGBF6r1mmmk\nJoyoxdZaQ445t6NoldZk/sSZgaVFCkK4E8CvpRs1fqGWOexV6m5stIOSaAva\ncq+D07LfIJeaeJdpmmOuJjr2Cjf5EnVPuFwDIN5+QLKxObfGavirhQHPxP4/\nHMUF\r\n=Ygqt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5EfGIHupsMujvhFosIu+6ifUO38Gd+9gyOoGXuRhtDAiEAlau4oXVYX600X0KLjrdSpZl6o4MM8NnAtTZgAf3XZdg="}]},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_4.0.0-next.15_1542073546311_0.765194255336294"},"_hasShrinkwrap":false},"4.0.0-next.19":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"4.0.0-next.19","description":"XML ID utilities for tracespace projects","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","gitHead":"b8b15ae67426dea26e71acba9d4e93e95ef45392","readme":"# xml id\n\n[![latest][@tracespace/xml-id-latest-badge]][npm]\n[![next][@tracespace/xml-id-next-badge]][npm-next]\n[![david][@tracespace/xml-id-david-badge]][david]\n\n> XML ID generation and sanitation utilities for tracespace projects\n\nID attributes in XML documents (e.g. SVG images) have certain requirements. This module provides utility methods for sanitizing and generating strings to meet those requirements so they can safely be used as XML IDs.\n\nPart of the [tracespace][] collection of PCB visualization tools.\n\n[tracespace]: https://github.com/tracespace/tracespace\n[npm]: https://www.npmjs.com/package/@tracespace/xml-id\n[npm-next]: https://www.npmjs.com/package/@tracespace/xml-id/v/next\n[david]: https://david-dm.org/tracespace/tracespace?path=packages/xml-id\n[@tracespace/xml-id-latest-badge]: https://flat.badgen.net/npm/v/@tracespace/xml-id\n[@tracespace/xml-id-next-badge]: https://flat.badgen.net/npm/v/@tracespace/xml-id/next\n[@tracespace/xml-id-david-badge]: https://flat.badgen.net/david/dep/tracespace/tracespace/packages/xml-id\n\n## install\n\nPlease note: because this package is an internal utility library, it may not follow semver and breaking changes could be introduced in _any_ version bump. **You should install an exact version.**\n\n```shell\nnpm install --save --save-exact @tracespace/xml-id\n# or\nyarn add --exact @tracespace/xml-id\n```\n\n## usage\n\n```js\nconst {sanitize, random} = require('@tracespace/xml-id')\n```\n\nThe alphabet used by this module is a subset of what is valid for XML which is also CSS identifier and URL friendly.\n\n### sanitize(source: string): string\n\nTakes a string and replaces any characters that would be invalid in an XML ID with underscores (`_`).\n\n```js\nconst id = sanitize('0abc def.') // id === _abc_def_\n```\n\n### random(length: number): string\n\nReturns a basic, (non-cryptographically-secure) random string that can be safely used as an XML ID. If unspecified or 0, `length` will be 12.\n\n```js\nconst id = random() // maybe \"w57gH_nT3-o8\"\nconst id = random(8) // maybe \"Gi3ma2Ef\"\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@4.0.0-next.19","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.0/node@v8.15.1+x64 (linux)","dist":{"integrity":"sha512-3DTSs018SKhbsF6PhY9lp+H8WOxRcgoNqOygUVdU+k/NFgdPgNJzKDtg+WGPqsq7ggKPxuOyaCH1qeysUUOsNg==","shasum":"c4347bfcd8a07996a009f2e4705ab447b45f1376","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-4.0.0-next.19.tgz","fileCount":7,"unpackedSize":8278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchBCxCRA9TVsSAnZWagAAJnQP/RGvM7hhKk2GGOlBS1Hp\necuhU9srj24PSPcLK5yJEq3eHcrZGmHKEB0RfnwHFKfhgh/9v2TvU/qAVw87\nZyfuUxFgWw2MoNKRrF5Rg89vr/8ZSEhHFbEfxhop1OUx+Hpg6D2UfXujdOmZ\ny6dlCso9Tnm/x/RPiwQbye+ekCbdpbXhjiCDJ0N+kIDSe7jmxbZkiJjhtqUg\n5M6BirT4EkDzUsW4yTTYl8rlgurlmvQYLXPnJ+FLTvLHgUGURBOE4dd7R5qD\nO+ESTkFdljKwgnBIOKI+q428JYyC2XeoXyAycW+ek+PcqR/N3V8kiOpT3P6S\n4l7eEiBo0JeHhdQ2DTGsB8QaUGldq+DLNM6W8azjCU4lbHgBXavt9UiChXxk\nKZqz/UU5nK8vWtgmjpqYOkjBraFqvkBjU1UzPW8kQ474CTb8ZXU64jHyGvIR\nFt7n42lgAx8b3Zf36mVwwRHYEmMh3vQh8zCijwFMtUlwd8aTuMQbpzbUpwR9\npbcH6RMHfdUkJu+/LmrqGryEe0fYlx1Ha05tUJfVgyaJ7HrdW+bk8ltaBs19\nQqPQVvlrFtoNXrdb+2HuGj9oKlZ6IocUWgNBvoxO6jkzfybegw/nd9hZtZY2\nqkBxEPexq/b1JkXLfkZIeTd9AZ7VJEAiAZW7TIWw3zXdMd+xgVDotCEESMPF\nU45S\r\n=zgHt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnCYmwquzYjhA9vSqpfg8FLf7eegxAhc8zlfB/6kjYMAiEAq8duJzCnVPFPTFxusLV24O25c4FmR/xD3RO0NwIUEuo="}]},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"_npmUser":{"name":"mcous","email":"mike@cousins.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_4.0.0-next.19_1552158897264_0.86639927807557"},"_hasShrinkwrap":false},"4.0.0":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"4.0.0","description":"XML ID utilities for tracespace projects","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","gitHead":"83cb1faa86ba7cd13e06c1ac04bd88f6c8ec3cc6","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@4.0.0","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.0/node@v8.15.1+x64 (linux)","dist":{"integrity":"sha512-bEAqLh8sxNHHVOErgQrF4cj/PlmaayrTTIWT3uKQKnFk8KlubUQeW+Ip6W9sa+J/bUii927qD0HE5sFxsPo/IQ==","shasum":"07aeea58b8b412f670f90cf85b9394d842ab2bcc","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-4.0.0.tgz","fileCount":7,"unpackedSize":8432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchBmvCRA9TVsSAnZWagAAfF8P/AyNstEgYPCazYk2Gfdn\na0eXZhXIdiTld6u0BhwF0PVZldqxYE/76HS/txEBJCo5W0J/PWZkeZ1a+zP+\nUOaW5maeWm0ttjGsBfoBhAC2lDkco+A8xqJdljg0fLt9wBC2E2wQOa7huxc1\nQwX6Ob7qOdkt/yK9o3oGm8e4FWuQrL6t9Ts7l8OHKqPoyNDuTUUgwPQ6Q6Ap\n0INGYcAOc4b9H7IRLlvk/gGeYZFttXVTT92Gr5vBZ/6W5Yv2Qu4uMGkEcOEW\nj0AjeLowBRi0yKQs4IHJg2PBPplfyl2aN6lorqnj15T4/moTYXbziuxVaxa4\nxV8zASz95sag+NO6VDr7zQis6ZzhUwQ/Lclxh+wdT9amjd0CupkXw20fCxkS\nAIPwbxKY8kFaaJXglh1CcWzEJCa+UDsFAqJkGDHkGNLHb9GH+obP1bhIF953\nx5FdyJ2fxLgPxPKGbWY1QlTNvHuP1ao5gRbYZ8HvXlCgLiGavwOvuOJRbb29\nxB9rp34yGk/m4irO+cY7lOm9W/NPOQisBeDAWxpFIJsLxv4EDoaTgIfOum1e\nBDsbxZznGkd9Fm7CEcH5E/UsnRnYEVclrbf3HTrg5UpiOZJKGC8TsFd7+QjV\nlQJTrTy3SdBU0QECZ7ac8+0Ng52KEX6FOud8miLYzG9fNouuWV6iK88MUBEH\nOWYH\r\n=MCI6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHiEud2PV+U7f3RQolNlY19Fm3V8KlbwmIdSYPRutnwDAiEA7qhiTYvTq3HObERZdKus15pHTOqG8KdyXWdEki1VF7Q="}]},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"_npmUser":{"name":"mcous","email":"mike@cousins.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_4.0.0_1552161198537_0.5311611409849422"},"_hasShrinkwrap":false},"5.0.0-next.0":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"5.0.0-next.0","description":"XML ID generation and sanitation utilities","source":"src/index.ts","main":"cjs/index.js","module":"esm/index.mjs","types":"lib/index.d.ts","unpkg":"umd/xml-id.min.js","sideEffects":false,"scripts":{"clean":"rimraf cjs esm lib umd"},"repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","gitHead":"0d84af26a74ff870728ef7c4ef89548cbfe23045","readme":"# xml id\n\n[![latest][@tracespace/xml-id-latest-badge]][npm]\n[![next][@tracespace/xml-id-next-badge]][npm-next]\n[![david][@tracespace/xml-id-david-badge]][david]\n\n> XML ID generation and sanitation utilities for tracespace projects\n\nID attributes in XML documents (e.g. SVG images) have certain requirements. This module provides utility methods for sanitizing and generating strings to meet those requirements so they can safely be used as XML IDs.\n\nPart of the [tracespace][] collection of PCB visualization tools.\n\n[tracespace]: https://github.com/tracespace/tracespace\n[npm]: https://www.npmjs.com/package/@tracespace/xml-id\n[npm-next]: https://www.npmjs.com/package/@tracespace/xml-id/v/next\n[david]: https://david-dm.org/tracespace/tracespace?path=packages/xml-id\n[@tracespace/xml-id-latest-badge]: https://flat.badgen.net/npm/v/@tracespace/xml-id\n[@tracespace/xml-id-next-badge]: https://flat.badgen.net/npm/v/@tracespace/xml-id/next\n[@tracespace/xml-id-david-badge]: https://flat.badgen.net/david/dep/tracespace/tracespace/packages/xml-id\n\n## install\n\nPlease note: because this package is an internal utility library, it may not follow semver and breaking changes could be introduced in _any_ version bump. **You should install an exact version.**\n\n```shell\nnpm install --save --save-exact @tracespace/xml-id\n# or\nyarn add --exact @tracespace/xml-id\n```\n\n## usage\n\n```js\nconst {sanitize, random} = require('@tracespace/xml-id')\n```\n\nThe alphabet used by this module is a subset of what is valid for XML which is also CSS identifier and URL friendly.\n\n### sanitize(source: string): string\n\nTakes a string and replaces any characters that would be invalid in an XML ID with underscores (`_`).\n\n```js\nconst id = sanitize('0abc def.') // id === _abc_def_\n```\n\n### random(length: number): string\n\nReturns a basic, (non-cryptographically-secure) random string that can be safely used as an XML ID. If unspecified or 0, `length` will be 12.\n\n```js\nconst id = random() // maybe \"w57gH_nT3-o8\"\nconst id = random(8) // maybe \"Gi3ma2Ef\"\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@5.0.0-next.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-nlTJiY8xzX3pkTq/scmNpGPZOID+YwOzgEfr0PpdyhfipYxVIBW31zVRid9p2ns7jvi1TnaXYSRtIurNDclcAw==","shasum":"2ba9c9ed0e9a613ceaf60984b280fcf66e50f427","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-5.0.0-next.0.tgz","fileCount":15,"unpackedSize":22639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+OesCRA9TVsSAnZWagAAzi0P/3ahILZ4gyiV+EsFi03z\nUDWW+87B3j1Ns4SpicR4niKd29lh4UcO93iSGwyLF6lIEUxe7mgw+A88WSwh\nBDRFL3uprTM/z8pvi9QbffsuCZg0KySqytWO5qTSTPjFAWMZGXrHRrVA76jT\nYXz+J57kGFYDOVfbr2f9Wng6+vNwgBAfGAo5VtBEVc7bBSke1pb2sec7OqgB\nhKk8VSqTTcNuJGUpAofYJFU0l5nXzx6K1Nb0v1a+vaSKdLoekHi9e15dF9Jn\nAHA3D3RAxaZxidk5XzWjMygFrOtKmqWjlwhuv4Rq/VnnB7crqySGTbpy6Qa+\nurZ8j6F6AdzjEC6a5rw4QVOjzKjzWxH/oKb7rL+SN8SiFj4dQpYQVW1GqP0R\nDwSfJVbdLAtd8mIdhVcujHkvQZ2SndhkloV7xTgiBtaMiLvl93naHIkUDRA9\niNJ3tOg4+PIXCpI0QPQjEcs9kOszk4MQoZ/puLt3IgZqlYBr3RUij8plt4gn\n+DrbWcoI/FQD7fppKJZYYCMMvODgOoS9jANdA1gKb9C9doayYtbvNnVywH/f\npi5Eeg1wv+irzd6nmbQW1HUtZazAFyGGOhxVOjZoS2cFlDvIWw+E1TNUkoYY\nIl9Q1E4HqqJjUwkvxqcjCJsfaat01zTPEJbCMNzw9HLnD9k+hsZXUojsBkJV\nyzxo\r\n=eFgh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbqrBmYf4VaCwOXKiSChansqB4n0FTo81mI+lS3MJK2AiAEd1T/sb+4q4FFmLfzcObHdnk2spvnnH5v/2WB4AAZvA=="}]},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"_npmUser":{"name":"mcous","email":"mike@cousins.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_5.0.0-next.0_1593370540257_0.37989121008961746"},"_hasShrinkwrap":false},"4.2.7":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"4.2.7","description":"XML ID utilities for tracespace projects","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","gitHead":"8ecba37cf1788a7d80b856b892e683af125e0cc3","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@4.2.7","_nodeVersion":"12.22.10","_npmVersion":"lerna/3.22.1/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-4T7uAx5HB6qwKNH7jQDiij4EDe+uP+zlFcccMpZageZA5S2V2GFxm3g5lThJdTaQhp8Or4FLsmu8C/BRdYS7hg==","shasum":"8754d7eefd58e5eba5121c3d9e6f18432c05063e","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-4.2.7.tgz","fileCount":7,"unpackedSize":8587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLRH/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxNw/9GaMJznJN51e6O50FywDV/39SzX724fyUa7vc6hRrMElpa9uD\r\nyACr+YICjn4s8DSjpLaqwrCnneC4oVmLzpCZezO+EtrNS2jGD63n33Um/W50\r\nGV/WpNf6Pj1PJhn3dQ2rLxjHDqpyUsT6/yLBnkN9tTXPZnSDdI35WH4kBOiO\r\niAzpfm89N0PImdTM/Dsf2xGJjBT1nZ/JXW6ncnnjT1Pbe0DJJPVVetTsqvIu\r\nzQmKnfTRi0zyBik+xwz7cPmNbxGTwofmEF396F9WRoxlFOFIkr9Vua6WXn45\r\nlQAbw5Se5lT2EhD0cSkg8KjBpfEmEihISJj8PPJ/0m1lypbvRNv5gMe2uO6+\r\n2fbNdt0zLRbWpb/ee1F1F7s+6kZEXwYw0KgnStobjFfR7osm358Qne9o8Af1\r\n3BbtQLI2JoutPCdFIAIjbV62Vxq8BzcbI+CT6zg3OHRA1lL9LtGRPjiijX4Z\r\nSDxJBtsTWRlqLVQPthCHia/b5DfTrKeKv8WKz9UTBQDf0724Eu2n0WO67nff\r\ntEJo6nl/LDmip4FnegkIjoDmxZisJvxZqdTCtMrXsCXIgQ0hHlyiM3SICuD2\r\nTDccNk91CsYxnXZKzulNunzELM4+R0S0GSnyUVg+7FRq+ebAdrY05gDg+7tG\r\nprwQ6IZ5fdrnx7XOeTKgGAWl+sTYDgTewNw=\r\n=WK1I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPiImODZ3g9fdpabsoGg65fWKYDiB90rlI7MZzSOZ0LAIgIz3NA/jHJkfHwmK5+pOMFSUc0ACcoseu6GoaukZxeBk="}]},"_npmUser":{"name":"mcous","email":"mike@cousins.io"},"directories":{},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_4.2.7_1647120895561_0.8345134487051908"},"_hasShrinkwrap":false},"5.0.0-alpha.0":{"name":"@tracespace/xml-id","publishConfig":{"access":"public"},"version":"5.0.0-alpha.0","description":"XML element ID generation and sanitation utilities.","types":"./lib/index.d.ts","exports":{"types":"./lib/index.d.ts","source":"./src/index.ts","import":"./dist/tracespace-xml-id.js","require":"./dist/tracespace-xml-id.umd.cjs"},"type":"module","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"keywords":["xml","id","name","sanitize","random"],"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"license":"MIT","scripts":{"build":"vite build"},"readme":"# xml id\n\n[![npm][npm badge]][npm package]\n\nXML element ID generation and sanitation utilities. Part of the [tracespace][] collection of PCB visualization tools.\n\nID attributes in XML documents (e.g. SVG images) have certain requirements. This module provides utility methods for sanitizing and generating strings to meet those requirements so they can safely be used element IDs, CSS identifiers, and URLs.\n\n```shell\nnpm install @tracespace/xml-id@next\n```\n\n[tracespace]: https://github.com/tracespace/tracespace\n[npm package]: https://www.npmjs.com/package/@tracespace/xml-id/v/next\n[npm badge]: https://img.shields.io/npm/v/@tracespace/xml-id/next?style=flat-square\n\n## usage\n\n```js\nimport {ensure, random, sanitize} from '@tracespace/xml-id'\n```\n\nThe alphabet used by this module is a subset of what is valid for XML which is also CSS identifier and URL friendly.\n\n### ensure(source: unknown, length?: number): string\n\nGiven an input `source`, returns a sanitized `source` if it was a string. Otherwise, generates a random ID with length `length` (defaulting to 12 if unspecified).\n\n```js\nconst id1 = ensure(undefined) // 'w57gH_nT3-o8'\nconst id2 = ensure(undefined, 8) // 'Gi3ma2Ef'\nconst id3 = ensure('0abc def.') // '_abc_def_'\n```\n\n### random(length?: number): string\n\nReturns a basic, (non-cryptographically-secure) random string that can be safely used as an XML ID. If unspecified or 0, `length` will be 12.\n\n```js\nconst id1 = random() // maybe 'w57gH_nT3-o8'\nconst id2 = random(8) // maybe 'Gi3ma2Ef'\n```\n\n### sanitize(source: string): string\n\nTakes a string and replaces any characters that would be invalid in an XML ID with underscores (`_`).\n\n```js\nconst id1 = sanitize('0abc def.') // '_abc_def_'\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"homepage":"https://github.com/tracespace/tracespace#readme","_id":"@tracespace/xml-id@5.0.0-alpha.0","_integrity":"sha512-+RTkH5Ar3U4nhF7LLhIbSpDKUAo3NFRDXNN/Pm5YMgjBCX/jDj8YsvaldOPwccDKFJR2RQIyLB85kWZXp7iR7A==","_resolved":"/private/var/folders/n1/qqg04_j90pjfdjf0zl0_bxqm0000gn/T/91921ffad7f015d028f0bbb46d004af8/tracespace-xml-id-5.0.0-alpha.0.tgz","_from":"file:tracespace-xml-id-5.0.0-alpha.0.tgz","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-+RTkH5Ar3U4nhF7LLhIbSpDKUAo3NFRDXNN/Pm5YMgjBCX/jDj8YsvaldOPwccDKFJR2RQIyLB85kWZXp7iR7A==","shasum":"79fb8b5a9d08078189f045a23a3e0c3d1ac720ad","tarball":"https://registry.npmjs.org/@tracespace/xml-id/-/xml-id-5.0.0-alpha.0.tgz","fileCount":9,"unpackedSize":9979,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0UO+gDhSro7fpjdcJ4SWd5kDzpbozxzPVkotYYELA3AiEA3kUMqAZbAf+wDWY+G/0OMX1gBm2xOKRYCSMmArz4UYI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxLLLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoxng/9EHbclw0drGSy0t26xFWgyfFQI9wJFu2vmyCAu9zn9YUZ9kBf\r\n8UjX8RoILnz1lYNFCGhW2lSK0ewmoWun4R/zhi60uTyBCUcqYuN4Up2R9xfJ\r\nTGFpwnFp266cjWxonGTbYGjcBJJF+9GpJicLD2wZpMuhD0LzRevoThH7LuWf\r\n6fMFj2D0+lYf9nZs/8mc/rC2xAu972ntT+zYGK+VBvUD7L1d47ETZXTosdza\r\n4GU08nuJ2mj66an2TqJf/U+vIAKCGKHNxA+/IefAzMnWEib4QT7cedMmPrSx\r\n0Pl5na2b44ATeELStihnBIJWJDUhqdzevb9Shf6Z7Y0rZuMf0wKKqZ5TwD5G\r\nGxugEsxHrmO4uRoUMj4B+gtsbwGaZftp8slYb1BOUUZuPu2NIpqtnKhALzw0\r\n3r3doP2pUCP1oABu4HBlOAXj4zzcCv0tOOG1Yf4VCx9ofmyaZ/7AMvxlqD58\r\nJlyTv+lpFniPDz5KGzxsmGreLK6M21jJW9Fz+AqtX7sVNH0VWXQ6vOAKrtcM\r\n0w1+W30lPJgX8jW4NYVx/UJpst9FKFWV8BDPLV6/cg56d5+bbkpQr1KQR4Tl\r\nU8QzTFRv0iPzaVuDi6UvQOnZ1wUbzTys97FPNUqmnt2GTHOjU17vVJ8FojHH\r\nzaO2hYXMmc67b57HDNQZ21WeDq9hWEpKc+k=\r\n=40rq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mcous","email":"mike@cousins.io"},"directories":{},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-id_5.0.0-alpha.0_1673835211591_0.22848845395990236"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-12T14:00:18.190Z","4.0.0-next.13":"2018-09-12T14:00:18.452Z","modified":"2023-01-16T02:13:31.854Z","4.0.0-next.14":"2018-10-13T13:26:38.303Z","4.0.0-next.15":"2018-11-13T01:45:46.528Z","4.0.0-next.19":"2019-03-09T19:14:57.402Z","4.0.0":"2019-03-09T19:53:18.670Z","5.0.0-next.0":"2020-06-28T18:55:40.393Z","4.2.7":"2022-03-12T21:34:55.698Z","5.0.0-alpha.0":"2023-01-16T02:13:31.766Z"},"maintainers":[{"name":"mcous","email":"mike@cousins.io"}],"description":"XML ID utilities for tracespace projects","homepage":"https://github.com/tracespace/tracespace#readme","keywords":["xml","id","name","sanitize","random"],"repository":{"type":"git","url":"git+https://github.com/tracespace/tracespace.git"},"contributors":[{"name":"Mike Cousins","email":"mike@cousins.io","url":"https://mike.cousins.io"}],"bugs":{"url":"https://github.com/tracespace/tracespace/issues"},"license":"MIT","readme":"","readmeFilename":""}