Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
nlcst-normalize
Advanced tools
nlcst utility to normalize a word for easier comparison.
This utility serializes a node and cleans it.
This package is a tiny utility that helps when comparing natural language to word lists.
This package is ESM only. In Node.js (version 16+), install with npm:
npm install nlcst-normalize
In Deno with esm.sh
:
import {normalize} from 'https://esm.sh/nlcst-normalize@4'
In browsers with esm.sh
:
<script type="module">
import {normalize} from 'https://esm.sh/nlcst-normalize@4?bundle'
</script>
import {normalize} from 'nlcst-normalize'
normalize("Don't") // => 'dont'
normalize('Don’t') // => 'dont'
normalize('Don’t', {allowApostrophes: true}) // => 'don\'t'
normalize('Block-level') // => 'blocklevel'
normalize('Block-level', {allowDashes: true}) // => 'block-level'
normalize({
type: 'WordNode',
children: [
{type: 'TextNode', value: 'Block'},
{type: 'PunctuationNode', value: '-'},
{type: 'TextNode', value: 'level'}
]
}) // => 'blocklevel'
This package exports the identifier normalize
.
There is no default export.
normalize(value[, options])
Normalize a word for easier comparison.
Always normalizes smart apostrophes (’
) to straight apostrophes ('
) and
lowercases alphabetical characters ([A-Z]
).
value
(Array<Node>
, Node
, or string
)
— wordoptions
(Options
, optional)
— configurationNormalized word (string
).
Options
Configuration (TypeScript type).
allowApostrophes
(boolean
, default: false
)
— do not strip apostrophes ('
); the default is to remove apostrophesallowDashes
(boolean
, default: false
)
— Do not strip hyphens (-
); the default is to remove the hyphen-minus
characterThis package is fully typed with TypeScript.
It exports the additional types Options
.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, nlcst-normalize@^4
,
compatible with Node.js 16.
nlcst-is-literal
— check whether a node is meant literallynlcst-search
— search for patternsSee contributing.md
in syntax-tree/.github
for
ways to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
nlcst utility to normalize a word for easier comparison
The npm package nlcst-normalize receives a total of 18,742 weekly downloads. As such, nlcst-normalize popularity was classified as popular.
We found that nlcst-normalize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.