DefinitelyTyped/types/pre-suf/pre-suf-tests.ts
Piotr Błażejewicz (Peter Blazejewicz) a0a52a6a3d
feat(pre-suf): new type definition (#43866)
- declaration file
- tests

https://github.com/kaelzhang/node-pre-suf

Thanks!
2020-04-13 15:27:17 -07:00

15 lines
416 B
TypeScript

import presuf = require('pre-suf');
presuf.ensureLeading('a', '/'); // $ExpectType string
presuf.removeLeading('a', '/'); // $ExpectType string
presuf.ensureEnding('a', '/'); // $ExpectType string
presuf.removeEnding('/a/ab/a', '/a'); // $ExpectType string
// $ExpectError
presuf.ensureLeading();
// $ExpectError
presuf.removeLeading();
// $ExpectError
presuf.ensureEnding();
// $ExpectError
presuf.removeEnding();