import { compareUsing, prepareMatcher, searchUsing } from "order.ts";
const match = prepareMatcher("natural");
// Sorting
const byRelevanceTo = compareUsing(match);
["ab", "bc", "cd", "de"].sort(byRelevanceTo("c"));
// -> ['cd', 'bc', 'ab', 'de']
// Finding matches
const search = searchUsing(match, String);
search("c", ["ab", "bc", "cd", "de"]);
// -> ['cd', 'bc']
This package has been deprecated
Author message:
Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
order.ts![This package contains built-in TypeScript declarations TypeScript icon, indicating that this package has built-in type declarations](https://static-production.npmjs.com/255a118f56f5346b97e56325a1217a16.svg)
1.0.1 • Public • Published Package Sidebar
Install
npm i order.ts
Repository
Weekly Downloads
2
Version
1.0.1
License
MIT
Unpacked Size
12.2 kB
Total Files
6