npm.io
1.1.2 • Published 2 years ago

@types/pre-suf

Licence
MIT
Version
1.1.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/pre-suf

Summary

This package contains type definitions for pre-suf (https://github.com/kaelzhang/node-pre-suf#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pre-suf.

index.d.ts

/**
 * Manipulate strings with prefixes and suffixes.
 */

/**
 * Ensures that the new string will have prefix at the beginning of str.
 * If str does not begin with prefix, prefix will be added to the beggining of str.
 */
export function ensureLeading(str: string, prefix: string): string;
/**
 * Removes the leading prefix of str.
 */
export function removeLeading(str: string, prefix: string): string;
/**
 * Ensures that the new string will have suffix at the end of str.
 * If str does not end with suffix, suffix will be added at the end of str.
 */
export function ensureEnding(str: string, suffix: string): string;
/**
 * Removes the ending suffix of str.
 */
export function removeEnding(str: string, suffix: string): string;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Piotr Błażejewicz.