tiny-types
Version:
A tiny library that brings Tiny Types to JavaScript and TypeScript
21 lines (20 loc) • 510 B
TypeScript
import { Predicate } from './Predicate';
/**
* @desc Ensures that the `value` ends with a given suffix.
*
* @example
* import { endsWith, ensure, TinyType } from 'tiny-types';
*
* class TextFileName extends TinyType {
* constructor(public readonly value: string) {
* super();
*
* ensure('TextFileName', value, endsWith('.txt'));
* }
* }
*
* @param {string} suffix
*
* @returns {Predicate<string>}
*/
export declare function endsWith(suffix: string): Predicate<string>;