2.0.3 • Published 4 years ago

string-spirits v2.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

spirits

package version stability main code style: prettier

A nice lightweight wildcard implementation written in TypeScript. I know there are already a lot of these, but I had a use case that required to test a string against many wildcards and determine which matched most specifically. I couldn't find one that did that, so I just made my own. (If you would like that same functionality, look at the bestMatch documentation.)

Usage

Example:

import Spirit from "spirits";

const format = new Spirit("The weather is * today!");
const greeting = "The weather is great today!";

console.log(format.match(greeting)
  ? greeting
  : "I have no idea what the weather is like because I am just a computer!");
2.0.3

4 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.0.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago