make-sort-key

1.0.4 • Public • Published

make-sort-key Build Status

Combine several strings to make one sort key.

The following transformations occur:

  • inputs are lowercased,
  • accents are removed,
  • redundant spaces are removed,
  • null, undefined or empty inputs are ignored,
  • finally, resulting strings are concatenated with a space separator.

Installation

npm install --save make-sort-key

Examples

import makeSortKey from 'make-sort-key';

console.log(makeSortKey('Dûpont', 'Jêàn')); // => dupont jean

console.log(makeSortKey(' Apple   Computer  ')); // => apple computer

console.log(makeSortKey('', undefined, 'Apple Computer')); // => apple computer

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i make-sort-key

Weekly Downloads

0

Version

1.0.4

License

MIT

Last publish

Collaborators

  • mvila