{"name":"micromark-util-normalize-identifier","version":"2.0.0","description":"micromark utility normalize identifiers (as found in references, definitions)","license":"MIT","keywords":["micromark","util","utility","normalize","id","identifier"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^2.0.0"},"scripts":{"build":"micromark-build"},"xo":false,"types":"./index.d.ts","gitHead":"4433cd9074a9260209089ceee18f1f47c1994174","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-normalize-identifier@2.0.0","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==","shasum":"91f9a4e65fe66cc80c53b35b0254ad67aa431d8b","tarball":"http://registry-npm.ywwl.com/micromark-util-normalize-identifier/download/micromark-util-normalize-identifier-2.0.0.tgz","fileCount":6,"unpackedSize":10662,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuQpEj1b3P3TtcDERxfWG0awjveVHKBGQbsn6RFhhnrAIhAJQnJoX7KIksSMhRE3zL+G5qvD1GmC2tYeClQ9cQavIo"}],"size":2819,"noattachment":false,"key":"/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-normalize-identifier_2.0.0_1687365785440_0.3921316571887319"},"_hasShrinkwrap":false,"readme":"# micromark-util-normalize-identifier\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] utility normalize identifiers.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`normalizeIdentifier(value)`](#normalizeidentifiervalue)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package exposes an algorithm to normalize identifiers found in markdown.\n\n## When should I use this?\n\nThis package might be useful when you are making your own micromark extensions.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-util-normalize-identifier\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {normalizeIdentifier} from 'https://esm.sh/micromark-util-normalize-identifier@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {normalizeIdentifier} from 'https://esm.sh/micromark-util-normalize-identifier@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nnormalizeIdentifier(' a ') // 'A'\nnormalizeIdentifier('a\\t\\r\\nb') // 'A B'\nnormalizeIdentifier('ТОЛПОЙ') // 'ТОЛПОЙ'\nnormalizeIdentifier('Толпой') // 'ТОЛПОЙ'\n```\n\n## API\n\nThis module exports the identifier\n[`normalizeIdentifier`][api-normalize-identifier].\nThere is no default export.\n\n### `normalizeIdentifier(value)`\n\nNormalize an identifier (as found in references, definitions).\n\nCollapses markdown whitespace, trim, and then lower- and uppercase.\n\nSome characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\nlowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\nuppercase character (U+0398 (`Θ`)).\nSo, to get a canonical form, we perform both lower- and uppercase.\n\nUsing uppercase last makes sure keys will never interact with default\nprototypal values (such as `constructor`): nothing in the prototype of `Object`\nis uppercase.\n\n###### Parameters\n\n*   `value` (`string`)\n    — identifier to normalize\n\n###### Returns\n\nNormalized identifier (`string`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`micromark-util-normalize-identifier@^2`, compatible with Node.js 16.\nThis package works with `micromark@^3`.\n\n## Security\n\nThis package is safe.\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-normalize-identifier.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-util-normalize-identifier\n\n[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-normalize-identifier\n\n[bundle-size]: https://bundlejs.com/?q=micromark-util-normalize-identifier\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/main/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[typescript]: https://www.typescriptlang.org\n\n[micromark]: https://github.com/micromark/micromark\n\n[api-normalize-identifier]: #normalizeidentifiervalue\n","publish_time":1687365785601,"_cnpm_publish_time":1687365785601,"dist-tags":{"latest":"2.0.1","next":"1.0.0-beta.1"}}