This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

order.ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Usage

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']

Package Sidebar

Install

npm i order.ts

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

12.2 kB

Total Files

6

Last publish

Collaborators

  • overengineered