perlica
Version:
<h1 align="center">Perlica</h1>
61 lines (57 loc) • 2.1 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/Predicate/String.ts
var String_exports = {};
__export(String_exports, {
endsWith: () => endsWith,
includes: () => includes,
isEmpty: () => isEmpty,
isMatch: () => isMatch,
isString: () => isString2,
len: () => len,
maxLen: () => maxLen,
minLen: () => minLen,
startsWith: () => startsWith
});
module.exports = __toCommonJS(String_exports);
// 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;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
endsWith,
includes,
isEmpty,
isMatch,
isString,
len,
maxLen,
minLen,
startsWith
});