nlcst-normalize
Advanced tools
Comparing version 3.0.0 to 3.1.0
/** | ||
* @param {string|Node|Array.<Node>} node | ||
* @param {string|Node|Array.<Content>} node | ||
* @param {NormalizeOptions} [options={}] | ||
*/ | ||
export function normalize( | ||
node: string | Node | Array<Node>, | ||
options?: NormalizeOptions | ||
node: string | Node | Array<Content>, | ||
options?: NormalizeOptions | undefined | ||
): string | ||
export type Node = import('unist').Node | ||
export type Root = import('nlcst').Root | ||
export type Content = import('nlcst').Content | ||
export type Node = Root | Content | ||
export type NormalizeOptions = { | ||
allowDashes?: boolean | ||
allowApostrophes?: boolean | ||
allowDashes?: boolean | undefined | ||
allowApostrophes?: boolean | undefined | ||
} |
/** | ||
* @typedef {import('unist').Node} Node | ||
* @typedef {import('nlcst').Root} Root | ||
* @typedef {import('nlcst').Content} Content | ||
* @typedef {Root|Content} Node | ||
* | ||
@@ -12,7 +14,7 @@ * @typedef {Object} NormalizeOptions | ||
/** | ||
* @param {string|Node|Array.<Node>} node | ||
* @param {string|Node|Array.<Content>} node | ||
* @param {NormalizeOptions} [options={}] | ||
*/ | ||
export function normalize(node, options) { | ||
var value = (typeof node === 'string' ? node : toString(node)) | ||
let value = (typeof node === 'string' ? node : toString(node)) | ||
.toLowerCase() | ||
@@ -19,0 +21,0 @@ .replace(/’/g, "'") |
{ | ||
"name": "nlcst-normalize", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "nlcst utility to normalize a word for easier comparison", | ||
@@ -33,3 +33,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/unist": "^2.0.0", | ||
"@types/nlcst": "^1.0.0", | ||
"nlcst-to-string": "^3.0.0" | ||
@@ -41,4 +41,4 @@ }, | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"rimraf": "^3.0.0", | ||
@@ -48,3 +48,3 @@ "tape": "^5.0.0", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.39.0" | ||
"xo": "^0.44.0" | ||
}, | ||
@@ -68,7 +68,3 @@ "scripts": { | ||
"xo": { | ||
"prettier": true, | ||
"rules": { | ||
"no-var": "off", | ||
"prefer-arrow-callback": "off" | ||
} | ||
"prettier": true | ||
}, | ||
@@ -75,0 +71,0 @@ "remarkConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7763
41
+ Added@types/nlcst@^1.0.0
- Removed@types/unist@^2.0.0