UNPKG

tn1150

Version:
33 lines (20 loc) 528 B
# TN1150 HFS Plus string utilities. ## Usage ```js 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.