UNPKG

perlica

Version:

<h1 align="center">Perlica</h1>

26 lines (24 loc) 869 B
// src/Predicate/index.ts var isNotNull = (value) => value !== null; var isString = (value) => typeof value === "string"; // src/Predicate/String.ts var includes = (searchString, position) => (value) => value.includes(searchString, position); var startsWith = (searchString, position) => (value) => value.startsWith(searchString, position); var endsWith = (searchString, position) => (value) => value.endsWith(searchString, position); var isMatch = (regexp) => (value) => isNotNull(value.match(regexp)); var maxLen = (count) => (value) => value.length <= count; var minLen = (count) => (value) => value.length >= count; var len = (count) => (value) => value.length === count; var isString2 = isString; var isEmpty = (self) => self.length === 0; export { endsWith, includes, isEmpty, isMatch, isString2 as isString, len, maxLen, minLen, startsWith };