myanmar-names-js
v2.0.0
Published
Sort and search for Myanmar / Burmese names
Downloads
31
Readme
myanmar-names.js
Sort a list of Myanmar language / Burmese names using JavaScript
Removes prefixes and sorts by official alphabetic order (yes, you will need a library for this, not .sort())
On the client-side, this library uses Intl.Collator. On the server, it cannot get Intl.Collator from NodeJS or the Intl npm module, so it uses an approximation.
Usage
Pass an array of names:
output = myanmarNameSort([
"ဦးလှမြင့်",
"ဦးမော"
]);
> ["ဦးမော", "ဦးလှမြင့်"]
Pass an array of objects, and a function to extract the name:
output = myanmarNameSort(candidates, function(candidate) {
return candidate.full_name;
});
License
Prefixes from Wikipedia under a Creative Commons license
Open Sourced with an MIT License