bguard
Version:
**bguard** is a powerful, flexible, and type-safe validation library for TypeScript. It allows developers to define validation schemas for their data structures and ensures that data conforms to the expected types and constraints.
20 lines (15 loc) • 669 B
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true});
var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
// src/asserts/string/contains.ts
var containsErrorMessage = "The received value does not contain the required substring";
var containsErrorKey = "s:contains";
var contains = (substring) => (received, ctx) => {
if (!received.includes(substring)) {
ctx.addIssue(`contains '${substring}'`, received, containsErrorKey);
}
};
contains.key = containsErrorKey;
contains.message = containsErrorMessage;
_chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, contains);
exports.contains = contains;
//# sourceMappingURL=chunk-ARIYSQMH.js.map