{"name":"nlcst-normalize","version":"3.0.0","description":"nlcst utility to normalize a word for easier comparison","license":"MIT","keywords":["unist","nlcst","nlcst-util","util","utility","normalize"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/nlcst-normalize.git"},"bugs":{"url":"https://github.com/syntax-tree/nlcst-normalize/issues"},"funding":{"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","main":"index.js","types":"index.d.ts","dependencies":{"@types/unist":"^2.0.0","nlcst-to-string":"^3.0.0"},"devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.39.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"no-var":"off","prefer-arrow-callback":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"ea084354d46efac6e4c45b2036b02bca2bf5f624","homepage":"https://github.com/syntax-tree/nlcst-normalize#readme","_id":"nlcst-normalize@3.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.9.0","dist":{"integrity":"sha512-c//18sLXDPB04y8cAkRX4OX8fdp6TgY4aiEamViWkxrXIVhV45DKZmL7LDl3iqDd+T2wx4MC0DQSrnRIHHHJKQ==","shasum":"ad20269b4b6cfe0493c46ccf0914941f75f41cfa","tarball":"http://registry-npm.ywwl.com/nlcst-normalize/download/nlcst-normalize-3.0.0.tgz","fileCount":5,"unpackedSize":7641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfyCJCRA9TVsSAnZWagAAiegP+wam28aTT6jz+XDY3hVD\nmOwy5+vRAAc52W3zrEUyrYJj9fODnZwp+Qt4mVhopEh1/Ti1o5QZ/ew5XCCa\n5+WKF5aRqqxVg7NQlDtgxxMhTgdXqFB5zTP1bw5LzqxwRdg6SCYhX16mLlid\nq1sLSFbRMiteNEwgxQ9nCXdCcu93ah72jASr2MyCfuSRagJvL7eJCc1sQq92\nH7DrDH2IOwDaFJ8eBQNngV1zE1FvYUO71h3AmqOxuSYgN2CNorYwSGFf+wY+\nP4ee4RnvvAV9VTs431ialO9Z0L8gp4LJNS+wURToRTo+GiG+0mEBfBZ9Cf2R\nbG8fnARxN9ywM4bZhP+cHUjHscYdDhf3vxDMIh4ETILdipII0BAEDNSCoVaE\nc3bs9qBsMwQdmABezuG/OX87Re0mgApabubMqWh0dY6t7ebwE3GrwrzF+AlU\nBqxyUfmIuhk96vppGR4Y56LFckKR5ywRxzbV3LVnyjziwgRAVM5dVMnaRyB/\nUW2rKCyhU5jt4nbC0N9d1TqrxSB2P3znZDLyB9OytR7+hguH06Dy8BCxXrdy\no/2Y9QbFI476A1yO5kmSaejbF6NFkNZXyH9PnSBbhN1s9gfJlmXmp8mW64hu\nx6oBReVdhQgCdbDytLZnerneMAJrk8F5uniTWMbbUxwysG4yjiA5CWoINjVU\nAYKG\r\n=tY9M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw4Y8JG6LbMdJlpyBKvBT7I1pKxcD4Y2OBux0GmQA45QIgL1KHBXQKm/myYGLgyDRVfkrIfpx8iJH6FVlrHCqSxEw="}],"size":3229,"noattachment":false,"key":"/nlcst-normalize/-/nlcst-normalize-3.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nlcst-normalize_3.0.0_1618944137274_0.6425866259973643"},"_hasShrinkwrap":false,"readme":"# nlcst-normalize\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[nlcst][] utility to normalize a word for easier comparison.\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    *   [`normalize(value[, options])`](#normalizevalue-options)\n    *   [`Options`](#options)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis utility serializes a node and cleans it.\n\n## When should I use this?\n\nThis package is a tiny utility that helps when comparing natural language to\nword lists.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install nlcst-normalize\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {normalize} from 'https://esm.sh/nlcst-normalize@4'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {normalize} from 'https://esm.sh/nlcst-normalize@4?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {normalize} from 'nlcst-normalize'\n\nnormalize(\"Don't\") // => 'dont'\nnormalize('Don’t') // => 'dont'\nnormalize('Don’t', {allowApostrophes: true}) // => 'don\\'t'\nnormalize('Block-level') // => 'blocklevel'\nnormalize('Block-level', {allowDashes: true}) // => 'block-level'\n\nnormalize({\n  type: 'WordNode',\n  children: [\n    {type: 'TextNode', value: 'Block'},\n    {type: 'PunctuationNode', value: '-'},\n    {type: 'TextNode', value: 'level'}\n  ]\n}) // => 'blocklevel'\n```\n\n## API\n\nThis package exports the identifier [`normalize`][api-normalize].\nThere is no default export.\n\n### `normalize(value[, options])`\n\nNormalize a word for easier comparison.\n\nAlways normalizes smart apostrophes (`’`) to straight apostrophes (`'`) and\nlowercases alphabetical characters (`[A-Z]`).\n\n###### Parameters\n\n*   `value` ([`Array<Node>`][node], `Node`, or `string`)\n    — word\n*   `options` ([`Options`][api-options], optional)\n    — configuration\n\n###### Returns\n\nNormalized word (`string`).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `allowApostrophes` (`boolean`, default: `false`)\n    — do not strip apostrophes (`'`); the default is to remove apostrophes\n*   `allowDashes` (`boolean`, default: `false`)\n    — Do not strip hyphens (`-`); the default is to remove the hyphen-minus\n    character\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`Options`][api-options].\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, `nlcst-normalize@^4`,\ncompatible with Node.js 16.\n\n## Related\n\n*   [`nlcst-is-literal`](https://github.com/syntax-tree/nlcst-is-literal)\n    — check whether a node is meant literally\n*   [`nlcst-search`](https://github.com/syntax-tree/nlcst-search)\n    — search for patterns\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to 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, organization, 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/syntax-tree/nlcst-normalize/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/nlcst-normalize/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/nlcst-normalize.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/nlcst-normalize\n\n[downloads-badge]: https://img.shields.io/npm/dm/nlcst-normalize.svg\n\n[downloads]: https://www.npmjs.com/package/nlcst-normalize\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=nlcst-normalize\n\n[size]: https://bundlejs.com/?q=nlcst-normalize\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\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[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[nlcst]: https://github.com/syntax-tree/nlcst\n\n[node]: https://github.com/syntax-tree/unist#node\n\n[api-normalize]: #normalizevalue-options\n\n[api-options]: #options\n","publish_time":1618944137419,"_cnpm_publish_time":1618944137419,"dist-tags":{"latest":"4.0.0"}}