Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nlcst-normalize

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nlcst-normalize

Normalize a word for easier comparison

  • 2.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
increased by8.99%
Maintainers
1
Weekly downloads
 
Created
Source

nlcst-normalize

Build Coverage Downloads Size Sponsors Backers Chat

nlcst utility to normalize a word for easier comparison.

Install

npm:

npm install nlcst-normalize

Usage

var normalize = require('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'

API

normalize(value[, options])

Normalize a word (string, Node, Array.<Node>) for easier comparison. Always normalises smart apostrophes () to straight apostrophes (') and lowercases alphabetical characters ([A-Z]).

options.allowApostrophes

boolean, default: false — Do not strip apostrophes (').

options.allowDashes

boolean, default: false — Do not strip hyphens (-).

Contribute

See 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, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 23 May 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc