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

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
increased by0.61%
Maintainers
1
Weekly downloads
 
Created
Source

nlcst-normalize Build Status Coverage Status

Normalize a word for easier comparison, useful for NLCST

Installation

npm:

npm install nlcst-normalize

nlcst-normalize is also available for duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.

Usage

var normalize = require('nlcst-normalize');

normalize('Don’t'); // 'dont'
normalize('Don\'t'); // 'dont'
normalize('Block-level'); // 'blocklevel'
normalize('Don’t', true); // 'don\'t'

normalize({
    'type': 'WordNode',
    'children': [
        {
            'type': 'TextNode',
            'value': 'Block'
        },
        {
            'type': 'PunctuationNode',
            'value': '-'
        },
        {
            'type': 'TextNode',
            'value': 'level'
        }
    ]
}); // 'blocklevel'

API

normalize(value[, allowApostrophes])

Quote a value.

Parameters

  • value (Node, Array.<Node>, or string) — Value to normalize;

  • allowApostrophes (boolean, default: false) — Do not strip apostrophes (but do normalize them).

Returns: string — Normalized value.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 18 Jan 2016

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