@anio-js-foundation/strip-suffix

3.0.1 • Public • Published

@anio-js-foundation/strip-suffix

Remove the suffix of a string.

Throws error if string doesn't end with suffix:

import stripSuffix from "@anio-js-foundation/strip-suffix"

console.log(stripSuffix("Hello, World", ", World")) // "Hello"
console.log(stripSuffix("Hello, World", "Test")) // Error

Readme

Keywords

none

Package Sidebar

Install

npm i @anio-js-foundation/strip-suffix

Weekly Downloads

3

Version

3.0.1

License

MIT

Unpacked Size

1.14 kB

Total Files

3

Last publish

Collaborators

  • exory2024
  • dasdeo