@anio-js-foundation/strip-suffix
v3.0.1
Published
Remove the suffix of a string.
Downloads
32
Readme
@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