@railway-ts/pipelines 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema/index.cjs +8 -0
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +16 -1
- package/dist/schema/index.d.ts +16 -1
- package/dist/schema/index.mjs +8 -1
- package/dist/schema/index.mjs.map +1 -1
- package/docs/API.md +17 -0
- package/docs/GETTING_STARTED.md +12 -0
- package/docs/RECIPES.md +27 -0
- package/package.json +1 -1
package/dist/schema/index.cjs
CHANGED
|
@@ -185,6 +185,13 @@ function validate(value, validator, pathOrOptions = [], maybeOptions) {
|
|
|
185
185
|
}
|
|
186
186
|
return validator(value, path);
|
|
187
187
|
}
|
|
188
|
+
function is(value, validator) {
|
|
189
|
+
const result = _withAbortEarly(true, () => validator(value));
|
|
190
|
+
if (result instanceof Promise) {
|
|
191
|
+
return result.then((r) => r.ok);
|
|
192
|
+
}
|
|
193
|
+
return result.ok;
|
|
194
|
+
}
|
|
188
195
|
function formatErrors(errors) {
|
|
189
196
|
return errors.reduce(
|
|
190
197
|
(acc, error) => {
|
|
@@ -1009,6 +1016,7 @@ exports.finite = finite;
|
|
|
1009
1016
|
exports.formatErrors = formatErrors;
|
|
1010
1017
|
exports.futureDate = futureDate;
|
|
1011
1018
|
exports.integer = integer;
|
|
1019
|
+
exports.is = is;
|
|
1012
1020
|
exports.literal = literal;
|
|
1013
1021
|
exports.matches = matches;
|
|
1014
1022
|
exports.max = max;
|