@sapphire/shapeshift
Advanced tools
Comparing version 2.0.1-next.48c30c6.0 to 2.0.1-next.4e99fbf.0
@@ -72,2 +72,3 @@ var SapphireShapeshift = (() => { | ||
}; | ||
__name(Result, "Result"); | ||
@@ -127,2 +128,3 @@ // src/validators/BaseValidator.ts | ||
}; | ||
__name(BaseValidator, "BaseValidator"); | ||
@@ -141,2 +143,3 @@ // src/lib/errors/ExpectedConstraintError.ts | ||
}; | ||
__name(BaseError, "BaseError"); | ||
@@ -151,2 +154,3 @@ // src/lib/errors/BaseConstraintError.ts | ||
}; | ||
__name(BaseConstraintError, "BaseConstraintError"); | ||
@@ -188,2 +192,3 @@ // src/lib/errors/ExpectedConstraintError.ts | ||
}; | ||
__name(ExpectedConstraintError, "ExpectedConstraintError"); | ||
@@ -194,17 +199,23 @@ // src/constraints/util/operators.ts | ||
} | ||
__name(lt, "lt"); | ||
function le(a, b) { | ||
return a <= b; | ||
} | ||
__name(le, "le"); | ||
function gt(a, b) { | ||
return a > b; | ||
} | ||
__name(gt, "gt"); | ||
function ge(a, b) { | ||
return a >= b; | ||
} | ||
__name(ge, "ge"); | ||
function eq(a, b) { | ||
return a === b; | ||
} | ||
__name(eq, "eq"); | ||
function ne(a, b) { | ||
return a !== b; | ||
} | ||
__name(ne, "ne"); | ||
@@ -219,2 +230,3 @@ // src/constraints/ArrayLengthConstraints.ts | ||
} | ||
__name(arrayLengthComparator, "arrayLengthComparator"); | ||
function arrayLengthLt(value) { | ||
@@ -224,2 +236,3 @@ const expected = `expected.length < ${value}`; | ||
} | ||
__name(arrayLengthLt, "arrayLengthLt"); | ||
function arrayLengthLe(value) { | ||
@@ -229,2 +242,3 @@ const expected = `expected.length <= ${value}`; | ||
} | ||
__name(arrayLengthLe, "arrayLengthLe"); | ||
function arrayLengthGt(value) { | ||
@@ -234,2 +248,3 @@ const expected = `expected.length > ${value}`; | ||
} | ||
__name(arrayLengthGt, "arrayLengthGt"); | ||
function arrayLengthGe(value) { | ||
@@ -239,2 +254,3 @@ const expected = `expected.length >= ${value}`; | ||
} | ||
__name(arrayLengthGe, "arrayLengthGe"); | ||
function arrayLengthEq(value) { | ||
@@ -244,2 +260,3 @@ const expected = `expected.length === ${value}`; | ||
} | ||
__name(arrayLengthEq, "arrayLengthEq"); | ||
function arrayLengthNe(value) { | ||
@@ -249,2 +266,3 @@ const expected = `expected.length !== ${value}`; | ||
} | ||
__name(arrayLengthNe, "arrayLengthNe"); | ||
function arrayLengthRange(start, endBefore) { | ||
@@ -258,2 +276,3 @@ const expected = `expected.length >= ${start} && expected.length < ${endBefore}`; | ||
} | ||
__name(arrayLengthRange, "arrayLengthRange"); | ||
function arrayLengthRangeInclusive(start, end) { | ||
@@ -267,2 +286,3 @@ const expected = `expected.length >= ${start} && expected.length <= ${end}`; | ||
} | ||
__name(arrayLengthRangeInclusive, "arrayLengthRangeInclusive"); | ||
function arrayLengthRangeExclusive(startAfter, endBefore) { | ||
@@ -276,2 +296,3 @@ const expected = `expected.length > ${startAfter} && expected.length < ${endBefore}`; | ||
} | ||
__name(arrayLengthRangeExclusive, "arrayLengthRangeExclusive"); | ||
@@ -311,2 +332,3 @@ // src/lib/errors/CombinedPropertyError.ts | ||
}; | ||
__name(CombinedPropertyError, "CombinedPropertyError"); | ||
@@ -346,2 +368,3 @@ // src/lib/errors/ValidationError.ts | ||
}; | ||
__name(ValidationError, "ValidationError"); | ||
@@ -400,2 +423,3 @@ // src/validators/ArrayValidator.ts | ||
}; | ||
__name(ArrayValidator, "ArrayValidator"); | ||
@@ -410,2 +434,3 @@ // src/constraints/BigIntConstraints.ts | ||
} | ||
__name(bigintComparator, "bigintComparator"); | ||
function bigintLt(value) { | ||
@@ -415,2 +440,3 @@ const expected = `expected < ${value}n`; | ||
} | ||
__name(bigintLt, "bigintLt"); | ||
function bigintLe(value) { | ||
@@ -420,2 +446,3 @@ const expected = `expected <= ${value}n`; | ||
} | ||
__name(bigintLe, "bigintLe"); | ||
function bigintGt(value) { | ||
@@ -425,2 +452,3 @@ const expected = `expected > ${value}n`; | ||
} | ||
__name(bigintGt, "bigintGt"); | ||
function bigintGe(value) { | ||
@@ -430,2 +458,3 @@ const expected = `expected >= ${value}n`; | ||
} | ||
__name(bigintGe, "bigintGe"); | ||
function bigintEq(value) { | ||
@@ -435,2 +464,3 @@ const expected = `expected === ${value}n`; | ||
} | ||
__name(bigintEq, "bigintEq"); | ||
function bigintNe(value) { | ||
@@ -440,2 +470,3 @@ const expected = `expected !== ${value}n`; | ||
} | ||
__name(bigintNe, "bigintNe"); | ||
function bigintDivisibleBy(divider) { | ||
@@ -449,2 +480,3 @@ const expected = `expected % ${divider}n === 0n`; | ||
} | ||
__name(bigintDivisibleBy, "bigintDivisibleBy"); | ||
@@ -493,2 +525,3 @@ // src/validators/BigIntValidator.ts | ||
}; | ||
__name(BigIntValidator, "BigIntValidator"); | ||
@@ -525,2 +558,3 @@ // src/constraints/BooleanConstraints.ts | ||
}; | ||
__name(BooleanValidator, "BooleanValidator"); | ||
@@ -535,2 +569,3 @@ // src/constraints/DateConstraints.ts | ||
} | ||
__name(dateComparator, "dateComparator"); | ||
function dateLt(value) { | ||
@@ -540,2 +575,3 @@ const expected = `expected < ${value.toISOString()}`; | ||
} | ||
__name(dateLt, "dateLt"); | ||
function dateLe(value) { | ||
@@ -545,2 +581,3 @@ const expected = `expected <= ${value.toISOString()}`; | ||
} | ||
__name(dateLe, "dateLe"); | ||
function dateGt(value) { | ||
@@ -550,2 +587,3 @@ const expected = `expected > ${value.toISOString()}`; | ||
} | ||
__name(dateGt, "dateGt"); | ||
function dateGe(value) { | ||
@@ -555,2 +593,3 @@ const expected = `expected >= ${value.toISOString()}`; | ||
} | ||
__name(dateGe, "dateGe"); | ||
function dateEq(value) { | ||
@@ -560,2 +599,3 @@ const expected = `expected === ${value.toISOString()}`; | ||
} | ||
__name(dateEq, "dateEq"); | ||
function dateNe(value) { | ||
@@ -565,2 +605,3 @@ const expected = `expected !== ${value.toISOString()}`; | ||
} | ||
__name(dateNe, "dateNe"); | ||
var dateInvalid = { | ||
@@ -609,2 +650,3 @@ run(input) { | ||
}; | ||
__name(DateValidator, "DateValidator"); | ||
@@ -648,2 +690,3 @@ // src/lib/errors/ExpectedValidationError.ts | ||
}; | ||
__name(ExpectedValidationError, "ExpectedValidationError"); | ||
@@ -663,2 +706,3 @@ // src/validators/InstanceValidator.ts | ||
}; | ||
__name(InstanceValidator, "InstanceValidator"); | ||
@@ -678,2 +722,3 @@ // src/validators/LiteralValidator.ts | ||
}; | ||
__name(LiteralValidator, "LiteralValidator"); | ||
@@ -686,2 +731,3 @@ // src/validators/NeverValidator.ts | ||
}; | ||
__name(NeverValidator, "NeverValidator"); | ||
@@ -694,2 +740,3 @@ // src/validators/NullishValidator.ts | ||
}; | ||
__name(NullishValidator, "NullishValidator"); | ||
@@ -704,2 +751,3 @@ // src/constraints/NumberConstraints.ts | ||
} | ||
__name(numberComparator, "numberComparator"); | ||
function numberLt(value) { | ||
@@ -709,2 +757,3 @@ const expected = `expected < ${value}`; | ||
} | ||
__name(numberLt, "numberLt"); | ||
function numberLe(value) { | ||
@@ -714,2 +763,3 @@ const expected = `expected <= ${value}`; | ||
} | ||
__name(numberLe, "numberLe"); | ||
function numberGt(value) { | ||
@@ -719,2 +769,3 @@ const expected = `expected > ${value}`; | ||
} | ||
__name(numberGt, "numberGt"); | ||
function numberGe(value) { | ||
@@ -724,2 +775,3 @@ const expected = `expected >= ${value}`; | ||
} | ||
__name(numberGe, "numberGe"); | ||
function numberEq(value) { | ||
@@ -729,2 +781,3 @@ const expected = `expected === ${value}`; | ||
} | ||
__name(numberEq, "numberEq"); | ||
function numberNe(value) { | ||
@@ -734,2 +787,3 @@ const expected = `expected !== ${value}`; | ||
} | ||
__name(numberNe, "numberNe"); | ||
var numberInt = { | ||
@@ -768,2 +822,3 @@ run(input) { | ||
} | ||
__name(numberDivisibleBy, "numberDivisibleBy"); | ||
@@ -833,2 +888,3 @@ // src/validators/NumberValidator.ts | ||
}; | ||
__name(NumberValidator, "NumberValidator"); | ||
@@ -858,2 +914,3 @@ // src/lib/errors/MissingPropertyError.ts | ||
}; | ||
__name(MissingPropertyError, "MissingPropertyError"); | ||
@@ -893,2 +950,3 @@ // src/lib/errors/UnknownPropertyError.ts | ||
}; | ||
__name(UnknownPropertyError, "UnknownPropertyError"); | ||
@@ -1002,2 +1060,3 @@ // src/validators/ObjectValidator.ts | ||
}; | ||
__name(ObjectValidator, "ObjectValidator"); | ||
var ObjectValidatorStrategy = /* @__PURE__ */ ((ObjectValidatorStrategy2) => { | ||
@@ -1016,2 +1075,3 @@ ObjectValidatorStrategy2[ObjectValidatorStrategy2["Ignore"] = 0] = "Ignore"; | ||
}; | ||
__name(PassthroughValidator, "PassthroughValidator"); | ||
@@ -1046,2 +1106,3 @@ // src/validators/RecordValidator.ts | ||
}; | ||
__name(RecordValidator, "RecordValidator"); | ||
@@ -1074,2 +1135,3 @@ // src/lib/errors/CombinedError.ts | ||
}; | ||
__name(CombinedError, "CombinedError"); | ||
@@ -1101,2 +1163,3 @@ // src/validators/SetValidator.ts | ||
}; | ||
__name(SetValidator, "SetValidator"); | ||
@@ -1134,2 +1197,3 @@ // src/constraints/StringConstraints.ts | ||
} | ||
__name(validateEmail, "validateEmail"); | ||
function validateEmailDomain(domain) { | ||
@@ -1142,2 +1206,3 @@ try { | ||
} | ||
__name(validateEmailDomain, "validateEmailDomain"); | ||
@@ -1183,2 +1248,3 @@ // src/lib/errors/MultiplePossibilitiesConstraintError.ts | ||
}; | ||
__name(MultiplePossibilitiesConstraintError, "MultiplePossibilitiesConstraintError"); | ||
@@ -1208,2 +1274,3 @@ // src/constraints/util/common/combinedResultFn.ts | ||
} | ||
__name(combinedErrorFn, "combinedErrorFn"); | ||
@@ -1219,8 +1286,11 @@ // src/constraints/util/urlValidators.ts | ||
} | ||
__name(createUrlValidators, "createUrlValidators"); | ||
function allowedProtocolsFn(allowedProtocols) { | ||
return (input, url) => allowedProtocols.includes(url.protocol) ? null : new MultiplePossibilitiesConstraintError("s.string.url", "Invalid URL protocol", input, allowedProtocols); | ||
} | ||
__name(allowedProtocolsFn, "allowedProtocolsFn"); | ||
function allowedDomainsFn(allowedDomains) { | ||
return (input, url) => allowedDomains.includes(url.hostname) ? null : new MultiplePossibilitiesConstraintError("s.string.url", "Invalid URL domain", input, allowedDomains); | ||
} | ||
__name(allowedDomainsFn, "allowedDomainsFn"); | ||
@@ -1235,2 +1305,3 @@ // src/constraints/StringConstraints.ts | ||
} | ||
__name(stringLengthComparator, "stringLengthComparator"); | ||
function stringLengthLt(length) { | ||
@@ -1240,2 +1311,3 @@ const expected = `expected.length < ${length}`; | ||
} | ||
__name(stringLengthLt, "stringLengthLt"); | ||
function stringLengthLe(length) { | ||
@@ -1245,2 +1317,3 @@ const expected = `expected.length <= ${length}`; | ||
} | ||
__name(stringLengthLe, "stringLengthLe"); | ||
function stringLengthGt(length) { | ||
@@ -1250,2 +1323,3 @@ const expected = `expected.length > ${length}`; | ||
} | ||
__name(stringLengthGt, "stringLengthGt"); | ||
function stringLengthGe(length) { | ||
@@ -1255,2 +1329,3 @@ const expected = `expected.length >= ${length}`; | ||
} | ||
__name(stringLengthGe, "stringLengthGe"); | ||
function stringLengthEq(length) { | ||
@@ -1260,2 +1335,3 @@ const expected = `expected.length === ${length}`; | ||
} | ||
__name(stringLengthEq, "stringLengthEq"); | ||
function stringLengthNe(length) { | ||
@@ -1265,2 +1341,3 @@ const expected = `expected.length !== ${length}`; | ||
} | ||
__name(stringLengthNe, "stringLengthNe"); | ||
function stringEmail() { | ||
@@ -1273,2 +1350,3 @@ return { | ||
} | ||
__name(stringEmail, "stringEmail"); | ||
function stringRegexValidator(type, expected, regex) { | ||
@@ -1281,2 +1359,3 @@ return { | ||
} | ||
__name(stringRegexValidator, "stringRegexValidator"); | ||
function stringUrl(options) { | ||
@@ -1299,2 +1378,3 @@ const validatorFn = createUrlValidators(options); | ||
} | ||
__name(stringUrl, "stringUrl"); | ||
function stringIp(version) { | ||
@@ -1312,5 +1392,7 @@ const ipVersion = version ? `v${version}` : ""; | ||
} | ||
__name(stringIp, "stringIp"); | ||
function stringRegex(regex) { | ||
return stringRegexValidator("s.string.regex", `expected ${regex}.test(expected) to be true`, regex); | ||
} | ||
__name(stringRegex, "stringRegex"); | ||
function stringUuid({ version = 4, nullable = false } = {}) { | ||
@@ -1322,2 +1404,3 @@ version ??= "1-5"; | ||
} | ||
__name(stringUuid, "stringUuid"); | ||
@@ -1369,2 +1452,3 @@ // src/validators/StringValidator.ts | ||
}; | ||
__name(StringValidator, "StringValidator"); | ||
@@ -1400,2 +1484,3 @@ // src/validators/TupleValidator.ts | ||
}; | ||
__name(TupleValidator, "TupleValidator"); | ||
@@ -1468,2 +1553,3 @@ // src/validators/UnionValidator.ts | ||
}; | ||
__name(UnionValidator, "UnionValidator"); | ||
@@ -1500,2 +1586,3 @@ // src/validators/MapValidator.ts | ||
}; | ||
__name(MapValidator, "MapValidator"); | ||
@@ -1506,2 +1593,3 @@ // src/validators/util/getValue.ts | ||
} | ||
__name(getValue, "getValue"); | ||
@@ -1527,2 +1615,3 @@ // src/validators/DefaultValidator.ts | ||
}; | ||
__name(DefaultValidator, "DefaultValidator"); | ||
@@ -1564,2 +1653,3 @@ // src/lib/errors/UnknownEnumValueError.ts | ||
}; | ||
__name(UnknownEnumValueError, "UnknownEnumValueError"); | ||
@@ -1603,2 +1693,3 @@ // src/validators/NativeEnumValidator.ts | ||
}; | ||
__name(NativeEnumValidator, "NativeEnumValidator"); | ||
@@ -1676,2 +1767,3 @@ // src/lib/Shapes.ts | ||
}; | ||
__name(Shapes, "Shapes"); | ||
@@ -1678,0 +1770,0 @@ // src/index.ts |
@@ -66,2 +66,3 @@ "use strict"; | ||
}; | ||
__name(Result, "Result"); | ||
@@ -121,2 +122,3 @@ // src/validators/BaseValidator.ts | ||
}; | ||
__name(BaseValidator, "BaseValidator"); | ||
@@ -135,2 +137,3 @@ // src/lib/errors/ExpectedConstraintError.ts | ||
}; | ||
__name(BaseError, "BaseError"); | ||
@@ -145,2 +148,3 @@ // src/lib/errors/BaseConstraintError.ts | ||
}; | ||
__name(BaseConstraintError, "BaseConstraintError"); | ||
@@ -182,2 +186,3 @@ // src/lib/errors/ExpectedConstraintError.ts | ||
}; | ||
__name(ExpectedConstraintError, "ExpectedConstraintError"); | ||
@@ -188,17 +193,23 @@ // src/constraints/util/operators.ts | ||
} | ||
__name(lt, "lt"); | ||
function le(a, b) { | ||
return a <= b; | ||
} | ||
__name(le, "le"); | ||
function gt(a, b) { | ||
return a > b; | ||
} | ||
__name(gt, "gt"); | ||
function ge(a, b) { | ||
return a >= b; | ||
} | ||
__name(ge, "ge"); | ||
function eq(a, b) { | ||
return a === b; | ||
} | ||
__name(eq, "eq"); | ||
function ne(a, b) { | ||
return a !== b; | ||
} | ||
__name(ne, "ne"); | ||
@@ -213,2 +224,3 @@ // src/constraints/ArrayLengthConstraints.ts | ||
} | ||
__name(arrayLengthComparator, "arrayLengthComparator"); | ||
function arrayLengthLt(value) { | ||
@@ -218,2 +230,3 @@ const expected = `expected.length < ${value}`; | ||
} | ||
__name(arrayLengthLt, "arrayLengthLt"); | ||
function arrayLengthLe(value) { | ||
@@ -223,2 +236,3 @@ const expected = `expected.length <= ${value}`; | ||
} | ||
__name(arrayLengthLe, "arrayLengthLe"); | ||
function arrayLengthGt(value) { | ||
@@ -228,2 +242,3 @@ const expected = `expected.length > ${value}`; | ||
} | ||
__name(arrayLengthGt, "arrayLengthGt"); | ||
function arrayLengthGe(value) { | ||
@@ -233,2 +248,3 @@ const expected = `expected.length >= ${value}`; | ||
} | ||
__name(arrayLengthGe, "arrayLengthGe"); | ||
function arrayLengthEq(value) { | ||
@@ -238,2 +254,3 @@ const expected = `expected.length === ${value}`; | ||
} | ||
__name(arrayLengthEq, "arrayLengthEq"); | ||
function arrayLengthNe(value) { | ||
@@ -243,2 +260,3 @@ const expected = `expected.length !== ${value}`; | ||
} | ||
__name(arrayLengthNe, "arrayLengthNe"); | ||
function arrayLengthRange(start, endBefore) { | ||
@@ -252,2 +270,3 @@ const expected = `expected.length >= ${start} && expected.length < ${endBefore}`; | ||
} | ||
__name(arrayLengthRange, "arrayLengthRange"); | ||
function arrayLengthRangeInclusive(start, end) { | ||
@@ -261,2 +280,3 @@ const expected = `expected.length >= ${start} && expected.length <= ${end}`; | ||
} | ||
__name(arrayLengthRangeInclusive, "arrayLengthRangeInclusive"); | ||
function arrayLengthRangeExclusive(startAfter, endBefore) { | ||
@@ -270,2 +290,3 @@ const expected = `expected.length > ${startAfter} && expected.length < ${endBefore}`; | ||
} | ||
__name(arrayLengthRangeExclusive, "arrayLengthRangeExclusive"); | ||
@@ -305,2 +326,3 @@ // src/lib/errors/CombinedPropertyError.ts | ||
}; | ||
__name(CombinedPropertyError, "CombinedPropertyError"); | ||
@@ -340,2 +362,3 @@ // src/lib/errors/ValidationError.ts | ||
}; | ||
__name(ValidationError, "ValidationError"); | ||
@@ -394,2 +417,3 @@ // src/validators/ArrayValidator.ts | ||
}; | ||
__name(ArrayValidator, "ArrayValidator"); | ||
@@ -404,2 +428,3 @@ // src/constraints/BigIntConstraints.ts | ||
} | ||
__name(bigintComparator, "bigintComparator"); | ||
function bigintLt(value) { | ||
@@ -409,2 +434,3 @@ const expected = `expected < ${value}n`; | ||
} | ||
__name(bigintLt, "bigintLt"); | ||
function bigintLe(value) { | ||
@@ -414,2 +440,3 @@ const expected = `expected <= ${value}n`; | ||
} | ||
__name(bigintLe, "bigintLe"); | ||
function bigintGt(value) { | ||
@@ -419,2 +446,3 @@ const expected = `expected > ${value}n`; | ||
} | ||
__name(bigintGt, "bigintGt"); | ||
function bigintGe(value) { | ||
@@ -424,2 +452,3 @@ const expected = `expected >= ${value}n`; | ||
} | ||
__name(bigintGe, "bigintGe"); | ||
function bigintEq(value) { | ||
@@ -429,2 +458,3 @@ const expected = `expected === ${value}n`; | ||
} | ||
__name(bigintEq, "bigintEq"); | ||
function bigintNe(value) { | ||
@@ -434,2 +464,3 @@ const expected = `expected !== ${value}n`; | ||
} | ||
__name(bigintNe, "bigintNe"); | ||
function bigintDivisibleBy(divider) { | ||
@@ -443,2 +474,3 @@ const expected = `expected % ${divider}n === 0n`; | ||
} | ||
__name(bigintDivisibleBy, "bigintDivisibleBy"); | ||
@@ -487,2 +519,3 @@ // src/validators/BigIntValidator.ts | ||
}; | ||
__name(BigIntValidator, "BigIntValidator"); | ||
@@ -519,2 +552,3 @@ // src/constraints/BooleanConstraints.ts | ||
}; | ||
__name(BooleanValidator, "BooleanValidator"); | ||
@@ -529,2 +563,3 @@ // src/constraints/DateConstraints.ts | ||
} | ||
__name(dateComparator, "dateComparator"); | ||
function dateLt(value) { | ||
@@ -534,2 +569,3 @@ const expected = `expected < ${value.toISOString()}`; | ||
} | ||
__name(dateLt, "dateLt"); | ||
function dateLe(value) { | ||
@@ -539,2 +575,3 @@ const expected = `expected <= ${value.toISOString()}`; | ||
} | ||
__name(dateLe, "dateLe"); | ||
function dateGt(value) { | ||
@@ -544,2 +581,3 @@ const expected = `expected > ${value.toISOString()}`; | ||
} | ||
__name(dateGt, "dateGt"); | ||
function dateGe(value) { | ||
@@ -549,2 +587,3 @@ const expected = `expected >= ${value.toISOString()}`; | ||
} | ||
__name(dateGe, "dateGe"); | ||
function dateEq(value) { | ||
@@ -554,2 +593,3 @@ const expected = `expected === ${value.toISOString()}`; | ||
} | ||
__name(dateEq, "dateEq"); | ||
function dateNe(value) { | ||
@@ -559,2 +599,3 @@ const expected = `expected !== ${value.toISOString()}`; | ||
} | ||
__name(dateNe, "dateNe"); | ||
var dateInvalid = { | ||
@@ -603,2 +644,3 @@ run(input) { | ||
}; | ||
__name(DateValidator, "DateValidator"); | ||
@@ -642,2 +684,3 @@ // src/lib/errors/ExpectedValidationError.ts | ||
}; | ||
__name(ExpectedValidationError, "ExpectedValidationError"); | ||
@@ -657,2 +700,3 @@ // src/validators/InstanceValidator.ts | ||
}; | ||
__name(InstanceValidator, "InstanceValidator"); | ||
@@ -672,2 +716,3 @@ // src/validators/LiteralValidator.ts | ||
}; | ||
__name(LiteralValidator, "LiteralValidator"); | ||
@@ -680,2 +725,3 @@ // src/validators/NeverValidator.ts | ||
}; | ||
__name(NeverValidator, "NeverValidator"); | ||
@@ -688,2 +734,3 @@ // src/validators/NullishValidator.ts | ||
}; | ||
__name(NullishValidator, "NullishValidator"); | ||
@@ -698,2 +745,3 @@ // src/constraints/NumberConstraints.ts | ||
} | ||
__name(numberComparator, "numberComparator"); | ||
function numberLt(value) { | ||
@@ -703,2 +751,3 @@ const expected = `expected < ${value}`; | ||
} | ||
__name(numberLt, "numberLt"); | ||
function numberLe(value) { | ||
@@ -708,2 +757,3 @@ const expected = `expected <= ${value}`; | ||
} | ||
__name(numberLe, "numberLe"); | ||
function numberGt(value) { | ||
@@ -713,2 +763,3 @@ const expected = `expected > ${value}`; | ||
} | ||
__name(numberGt, "numberGt"); | ||
function numberGe(value) { | ||
@@ -718,2 +769,3 @@ const expected = `expected >= ${value}`; | ||
} | ||
__name(numberGe, "numberGe"); | ||
function numberEq(value) { | ||
@@ -723,2 +775,3 @@ const expected = `expected === ${value}`; | ||
} | ||
__name(numberEq, "numberEq"); | ||
function numberNe(value) { | ||
@@ -728,2 +781,3 @@ const expected = `expected !== ${value}`; | ||
} | ||
__name(numberNe, "numberNe"); | ||
var numberInt = { | ||
@@ -762,2 +816,3 @@ run(input) { | ||
} | ||
__name(numberDivisibleBy, "numberDivisibleBy"); | ||
@@ -827,2 +882,3 @@ // src/validators/NumberValidator.ts | ||
}; | ||
__name(NumberValidator, "NumberValidator"); | ||
@@ -852,2 +908,3 @@ // src/lib/errors/MissingPropertyError.ts | ||
}; | ||
__name(MissingPropertyError, "MissingPropertyError"); | ||
@@ -887,2 +944,3 @@ // src/lib/errors/UnknownPropertyError.ts | ||
}; | ||
__name(UnknownPropertyError, "UnknownPropertyError"); | ||
@@ -996,2 +1054,3 @@ // src/validators/ObjectValidator.ts | ||
}; | ||
__name(ObjectValidator, "ObjectValidator"); | ||
var ObjectValidatorStrategy = /* @__PURE__ */ ((ObjectValidatorStrategy2) => { | ||
@@ -1010,2 +1069,3 @@ ObjectValidatorStrategy2[ObjectValidatorStrategy2["Ignore"] = 0] = "Ignore"; | ||
}; | ||
__name(PassthroughValidator, "PassthroughValidator"); | ||
@@ -1040,2 +1100,3 @@ // src/validators/RecordValidator.ts | ||
}; | ||
__name(RecordValidator, "RecordValidator"); | ||
@@ -1068,2 +1129,3 @@ // src/lib/errors/CombinedError.ts | ||
}; | ||
__name(CombinedError, "CombinedError"); | ||
@@ -1095,2 +1157,3 @@ // src/validators/SetValidator.ts | ||
}; | ||
__name(SetValidator, "SetValidator"); | ||
@@ -1128,2 +1191,3 @@ // src/constraints/StringConstraints.ts | ||
} | ||
__name(validateEmail, "validateEmail"); | ||
function validateEmailDomain(domain) { | ||
@@ -1136,2 +1200,3 @@ try { | ||
} | ||
__name(validateEmailDomain, "validateEmailDomain"); | ||
@@ -1177,2 +1242,3 @@ // src/lib/errors/MultiplePossibilitiesConstraintError.ts | ||
}; | ||
__name(MultiplePossibilitiesConstraintError, "MultiplePossibilitiesConstraintError"); | ||
@@ -1202,2 +1268,3 @@ // src/constraints/util/common/combinedResultFn.ts | ||
} | ||
__name(combinedErrorFn, "combinedErrorFn"); | ||
@@ -1213,8 +1280,11 @@ // src/constraints/util/urlValidators.ts | ||
} | ||
__name(createUrlValidators, "createUrlValidators"); | ||
function allowedProtocolsFn(allowedProtocols) { | ||
return (input, url) => allowedProtocols.includes(url.protocol) ? null : new MultiplePossibilitiesConstraintError("s.string.url", "Invalid URL protocol", input, allowedProtocols); | ||
} | ||
__name(allowedProtocolsFn, "allowedProtocolsFn"); | ||
function allowedDomainsFn(allowedDomains) { | ||
return (input, url) => allowedDomains.includes(url.hostname) ? null : new MultiplePossibilitiesConstraintError("s.string.url", "Invalid URL domain", input, allowedDomains); | ||
} | ||
__name(allowedDomainsFn, "allowedDomainsFn"); | ||
@@ -1229,2 +1299,3 @@ // src/constraints/StringConstraints.ts | ||
} | ||
__name(stringLengthComparator, "stringLengthComparator"); | ||
function stringLengthLt(length) { | ||
@@ -1234,2 +1305,3 @@ const expected = `expected.length < ${length}`; | ||
} | ||
__name(stringLengthLt, "stringLengthLt"); | ||
function stringLengthLe(length) { | ||
@@ -1239,2 +1311,3 @@ const expected = `expected.length <= ${length}`; | ||
} | ||
__name(stringLengthLe, "stringLengthLe"); | ||
function stringLengthGt(length) { | ||
@@ -1244,2 +1317,3 @@ const expected = `expected.length > ${length}`; | ||
} | ||
__name(stringLengthGt, "stringLengthGt"); | ||
function stringLengthGe(length) { | ||
@@ -1249,2 +1323,3 @@ const expected = `expected.length >= ${length}`; | ||
} | ||
__name(stringLengthGe, "stringLengthGe"); | ||
function stringLengthEq(length) { | ||
@@ -1254,2 +1329,3 @@ const expected = `expected.length === ${length}`; | ||
} | ||
__name(stringLengthEq, "stringLengthEq"); | ||
function stringLengthNe(length) { | ||
@@ -1259,2 +1335,3 @@ const expected = `expected.length !== ${length}`; | ||
} | ||
__name(stringLengthNe, "stringLengthNe"); | ||
function stringEmail() { | ||
@@ -1267,2 +1344,3 @@ return { | ||
} | ||
__name(stringEmail, "stringEmail"); | ||
function stringRegexValidator(type, expected, regex) { | ||
@@ -1275,2 +1353,3 @@ return { | ||
} | ||
__name(stringRegexValidator, "stringRegexValidator"); | ||
function stringUrl(options) { | ||
@@ -1293,2 +1372,3 @@ const validatorFn = createUrlValidators(options); | ||
} | ||
__name(stringUrl, "stringUrl"); | ||
function stringIp(version) { | ||
@@ -1306,5 +1386,7 @@ const ipVersion = version ? `v${version}` : ""; | ||
} | ||
__name(stringIp, "stringIp"); | ||
function stringRegex(regex) { | ||
return stringRegexValidator("s.string.regex", `expected ${regex}.test(expected) to be true`, regex); | ||
} | ||
__name(stringRegex, "stringRegex"); | ||
function stringUuid({ version = 4, nullable = false } = {}) { | ||
@@ -1316,2 +1398,3 @@ version ??= "1-5"; | ||
} | ||
__name(stringUuid, "stringUuid"); | ||
@@ -1363,2 +1446,3 @@ // src/validators/StringValidator.ts | ||
}; | ||
__name(StringValidator, "StringValidator"); | ||
@@ -1394,2 +1478,3 @@ // src/validators/TupleValidator.ts | ||
}; | ||
__name(TupleValidator, "TupleValidator"); | ||
@@ -1462,2 +1547,3 @@ // src/validators/UnionValidator.ts | ||
}; | ||
__name(UnionValidator, "UnionValidator"); | ||
@@ -1494,2 +1580,3 @@ // src/validators/MapValidator.ts | ||
}; | ||
__name(MapValidator, "MapValidator"); | ||
@@ -1500,2 +1587,3 @@ // src/validators/util/getValue.ts | ||
} | ||
__name(getValue, "getValue"); | ||
@@ -1521,2 +1609,3 @@ // src/validators/DefaultValidator.ts | ||
}; | ||
__name(DefaultValidator, "DefaultValidator"); | ||
@@ -1558,2 +1647,3 @@ // src/lib/errors/UnknownEnumValueError.ts | ||
}; | ||
__name(UnknownEnumValueError, "UnknownEnumValueError"); | ||
@@ -1597,2 +1687,3 @@ // src/validators/NativeEnumValidator.ts | ||
}; | ||
__name(NativeEnumValidator, "NativeEnumValidator"); | ||
@@ -1670,2 +1761,3 @@ // src/lib/Shapes.ts | ||
}; | ||
__name(Shapes, "Shapes"); | ||
@@ -1672,0 +1764,0 @@ // src/index.ts |
{ | ||
"name": "@sapphire/shapeshift", | ||
"version": "2.0.1-next.48c30c6.0", | ||
"version": "2.0.1-next.4e99fbf.0", | ||
"description": "Blazing fast input validation and transformation ⚡", | ||
@@ -43,6 +43,6 @@ "author": "@sapphire", | ||
"@types/node": "^17.0.21", | ||
"@typescript-eslint/eslint-plugin": "^5.17.0", | ||
"@typescript-eslint/parser": "^5.17.0", | ||
"@typescript-eslint/eslint-plugin": "^5.19.0", | ||
"@typescript-eslint/parser": "^5.19.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.12.0", | ||
"eslint": "^8.13.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -53,3 +53,3 @@ "eslint-plugin-prettier": "^4.0.0", | ||
"jest-circus": "^27.5.1", | ||
"lint-staged": "^12.3.7", | ||
"lint-staged": "^12.3.8", | ||
"prettier": "^2.6.2", | ||
@@ -59,5 +59,5 @@ "pretty-quick": "^3.1.3", | ||
"ts-jest": "^27.1.4", | ||
"tsup": "^5.12.3", | ||
"typedoc": "^0.22.13", | ||
"typedoc-plugin-mdn-links": "^1.0.5", | ||
"tsup": "^5.12.5", | ||
"typedoc": "^0.22.15", | ||
"typedoc-plugin-mdn-links": "^1.0.6", | ||
"typescript": "^4.6.3" | ||
@@ -115,2 +115,4 @@ }, | ||
"resolutions": { | ||
"ansi-regex": "^5.0.1", | ||
"minimist": "^1.2.6", | ||
"jest-environment-jsdom": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.3.tgz" | ||
@@ -117,0 +119,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
598177
5343