@karmaniverous/string-utilities
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

API DocumentationCHANGELOG

string-utilities

Handy tagged templates & other string utilities.

To install:

npm i @karmaniverous/string-utilities

Contents:

  • Types

  • Transformations

    • normstr - Normalize a string by converting diacriticals to base characters, removing non-word characters, and converting to lower case. Non-strings return undefined.
  • Tagged Template Functions

    • Non-stringifiable to Empty String (n2e) - Replaces expressions without toString property with empty strings.

    • Some Non-stringifiable to Empty String (sn2e) - Returns empty string when any expression has no toString property.

    • Some Non-stringifiable to Null (sn2n) - Returns null when any expression has no toString property.

    • Some Non-stringifiable to Undefined (sn2u) - Returns undefined when any expression has no toString property.

  • Higher-Order Functions

    • Non-stringifiable to Default (n2d) - Returns tagged template function that replaces any expression that has no toString property with a default value.

    • Some Non-stringifiable to Default (sn2d) - Returns tagged template function that returns a default value when any expression has no toString property.


Built for you with ❤️ on Bali! Find more great tools & templates on my GitHub Profile.

Package Sidebar

Install

npm i @karmaniverous/string-utilities

Weekly Downloads

2

Version

0.2.1

License

BSD-3-Clause

Unpacked Size

27.9 kB

Total Files

23

Last publish

Collaborators

  • karmaniverous