npm.io
1.0.0 • Published 1 year ago

tn1150

Licence
MIT
Version
1.0.0
Deps
1
Size
11 kB
Vulns
0
Weekly
0
Stars
1

TN1150

HFS Plus string utilities.

Usage

import { compare, normalize } from 'tn1150'

// Sort filenames
filenames.sort(compare)

// Normalize filename
filename = normalize(filename)

API

compare(lhs, rhs)
  • lhs (string, required)
  • rhs (string, required)
  • returns number

Compare two strings using the algorithm from TN1150. Useful for sorting filenames.

normalize(input)
  • input (string, required)
  • returns string

Normalize a string using Unicode Canonical Decomposition.

Keywords