@monstermann/fn
Version:
A utility library for TypeScript.
22 lines (20 loc) • 395 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/string/endsWith.ts
/**
* `endsWith(target, source)`
*
* Checks if `target` string ends with `source` string.
*
* ```ts
* endsWith("hello world", "world"); // true
* ```
*
* ```ts
* pipe("hello world", endsWith("world")); // true
* ```
*/
const endsWith = dfdlT((a, b) => {
return a.endsWith(b);
}, 2);
//#endregion
export { endsWith };