New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ne1410s/codl

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ne1410s/codl - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

92

dist/ne14_codl.cjs.min.js

@@ -139,3 +139,3 @@ 'use strict';

return function (trg, key) {
Reflect.defineMetadata(MetadataKey.MODEL + ":" + key.toString(), ctor, trg);
Reflect.defineMetadata("".concat(MetadataKey.MODEL, ":").concat(key.toString()), ctor, trg);
};

@@ -151,15 +151,15 @@ };

Type.boolean = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'boolean', trg, key);
};
Type.date = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'date', trg, key);
};
Type.integer = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'integer', trg, key);
};
Type.number = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'number', trg, key);

@@ -179,3 +179,3 @@ };

Validation.required = function (trg, key) {
Reflect.defineMetadata(ValidationKey.REQUIRED + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.REQUIRED, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.REQUIRED, true, trg, key);

@@ -188,3 +188,3 @@ };

Validation.forbidden = function (trg, key) {
Reflect.defineMetadata(ValidationKey.FORBIDDEN + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.FORBIDDEN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.FORBIDDEN, true, trg, key);

@@ -200,3 +200,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.MIN_LENGTH + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN_LENGTH, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.MIN_LENGTH, lBound, trg, key);

@@ -213,3 +213,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.MAX_LENGTH + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX_LENGTH, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.MAX_LENGTH, uBound, trg, key);

@@ -233,4 +233,4 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MIN + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -255,4 +255,4 @@ Reflect.defineMetadata(ValidationKey.MIN, lBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MAX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -277,5 +277,5 @@ Reflect.defineMetadata(ValidationKey.MAX, uBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MIN + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MAX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -294,3 +294,3 @@ Reflect.defineMetadata(ValidationKey.MIN, lBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.REGEX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.REGEX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.REGEX, regex, trg, key);

@@ -309,3 +309,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.OPTIONS + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.OPTIONS, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.OPTIONS, opts, trg, key);

@@ -324,3 +324,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.CUSTOM + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.CUSTOM, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.CUSTOM, fn, trg, key);

@@ -400,3 +400,3 @@ };

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is required";
retVal.message = "".concat(name_1, " is required");
}

@@ -416,6 +416,6 @@ }

var tests = isArray ? value : [value];
var allOk = tests.every(function (test) { return regex_1.test("" + test); });
var allOk = tests.every(function (test) { return regex_1.test("".concat(test)); });
if (!allOk) {
var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = isArray ? name_1 + " contains an invalid item" : name_1 + " is invalid";
retVal.message = isArray ? "".concat(name_1, " contains an invalid item") : "".concat(name_1, " is invalid");
}

@@ -428,3 +428,3 @@ }

var BooleanParser = function (obj) {
var str = ("" + obj).toLowerCase();
var str = "".concat(obj).toLowerCase();
if (['1', 'true'].indexOf(str) !== -1)

@@ -447,4 +447,4 @@ return true;

var IntegerParser = function (obj) {
var asInt = parseInt("" + obj, 10);
if (!isNaN(asInt) && asInt.toFixed(8) === parseFloat("" + obj).toFixed(8))
var asInt = parseInt("".concat(obj), 10);
if (!isNaN(asInt) && asInt.toFixed(8) === parseFloat("".concat(obj)).toFixed(8))
return asInt;

@@ -454,3 +454,3 @@ };

var NumberParser = function (obj) {
var test = parseFloat("" + obj);
var test = parseFloat("".concat(obj));
if (!isNaN(test))

@@ -493,3 +493,3 @@ return test;

default:
throw new RangeError("No parser implemented for " + type);
throw new RangeError("No parser implemented for ".concat(type));
}

@@ -523,6 +523,6 @@ };

hasMin_1 && hasMax_1
? name_1 + " must " + rangeImperative + " between " + fmtMin + " and " + fmtMax
? "".concat(name_1, " must ").concat(rangeImperative, " between ").concat(fmtMin, " and ").concat(fmtMax)
: hasMin_1
? name_1 + " cannot " + boundImperative + " " + compareLT + " " + fmtMin
: name_1 + " cannot " + boundImperative + " " + compareGT + " " + fmtMax;
? "".concat(name_1, " cannot ").concat(boundImperative, " ").concat(compareLT, " ").concat(fmtMin)
: "".concat(name_1, " cannot ").concat(boundImperative, " ").concat(compareGT, " ").concat(fmtMax);
}

@@ -551,6 +551,6 @@ retVal.valid = !retVal.message;

hasMinLen && hasMaxLen
? name_1 + " must contain between " + minLength + " and " + maxLength + " " + noun + "s"
? "".concat(name_1, " must contain between ").concat(minLength, " and ").concat(maxLength, " ").concat(noun, "s")
: hasMinLen
? name_1 + " cannot contain fewer than " + minLength + " " + noun + pluraliser
: name_1 + " cannot contain more than " + maxLength + " " + noun + pluraliser;
? "".concat(name_1, " cannot contain fewer than ").concat(minLength, " ").concat(noun).concat(pluraliser)
: "".concat(name_1, " cannot contain more than ").concat(maxLength, " ").concat(noun).concat(pluraliser);
}

@@ -575,4 +575,4 @@ retVal.valid = !retVal.message;

retVal.message = isArray
? name_1 + " contains an invalid " + type
: name_1 + " is not a valid " + type;
? "".concat(name_1, " contains an invalid ").concat(type)
: "".concat(name_1, " is not a valid ").concat(type);
}

@@ -595,3 +595,3 @@ }

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is invalid";
retVal.message = "".concat(name_1, " is invalid");
}

@@ -610,3 +610,3 @@ retVal.valid = !retVal.message;

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is forbidden";
retVal.message = "".concat(name_1, " is forbidden");
}

@@ -630,4 +630,4 @@ }

retVal.message = isArray
? name_1 + " contains an invalid option"
: name_1 + " is an invalid option";
? "".concat(name_1, " contains an invalid option")
: "".concat(name_1, " is an invalid option");
}

@@ -692,3 +692,3 @@ }

default:
throw new RangeError("No validator implemented for " + key);
throw new RangeError("No validator implemented for ".concat(key));
}

@@ -709,3 +709,3 @@ };

return Reflect.getMetadataKeys(proto)
.map(function (k) { return "" + k; })
.map(function (k) { return "".concat(k); })
.reduce(function (acc, cur) {

@@ -715,3 +715,3 @@ var valDef = allChecks.filter(function (dg) { return cur.indexOf(dg.meta + ':') === 0; })[0];

var key = cur.replace(valDef.meta + ':', '');
var navkey_1 = pfx ? pfx + "." + key : key;
var navkey_1 = pfx ? "".concat(pfx, ".").concat(key) : key;
var prior = acc.filter(function (a) { return a.navkey === navkey_1 && a.fn === valDef.fn; })[0];

@@ -732,4 +732,4 @@ if (prior) {

}
else if (cur.indexOf(MetadataKey.MODEL + ":") === 0) {
var subkey_1 = cur.replace(MetadataKey.MODEL + ":", '');
else if (cur.indexOf("".concat(MetadataKey.MODEL, ":")) === 0) {
var subkey_1 = cur.replace("".concat(MetadataKey.MODEL, ":"), '');
var subproto_1 = Reflect.getMetadata(cur, proto).prototype;

@@ -739,3 +739,3 @@ var subobj = (trg || {})[subkey_1];

subobj.forEach(function (subitem, i) {
var subpfx = pfx ? pfx + "." + subkey_1 + "[" + i + "]" : subkey_1 + "[" + i + "]";
var subpfx = pfx ? "".concat(pfx, ".").concat(subkey_1, "[").concat(i, "]") : "".concat(subkey_1, "[").concat(i, "]");
acc.push.apply(acc, ReflectValidation.getTestInstructions(allChecks, subproto_1, subitem || {}, subpfx));

@@ -745,3 +745,3 @@ });

else if (subobj) {
var subpfx = pfx ? pfx + "." + subkey_1 : subkey_1;
var subpfx = pfx ? "".concat(pfx, ".").concat(subkey_1) : subkey_1;
acc.push.apply(acc, ReflectValidation.getTestInstructions(allChecks, subproto_1, subobj, subpfx));

@@ -748,0 +748,0 @@ }

@@ -135,3 +135,3 @@ import 'reflect-metadata';

return function (trg, key) {
Reflect.defineMetadata(MetadataKey.MODEL + ":" + key.toString(), ctor, trg);
Reflect.defineMetadata("".concat(MetadataKey.MODEL, ":").concat(key.toString()), ctor, trg);
};

@@ -147,15 +147,15 @@ };

Type.boolean = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'boolean', trg, key);
};
Type.date = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'date', trg, key);
};
Type.integer = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'integer', trg, key);
};
Type.number = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'number', trg, key);

@@ -175,3 +175,3 @@ };

Validation.required = function (trg, key) {
Reflect.defineMetadata(ValidationKey.REQUIRED + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.REQUIRED, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.REQUIRED, true, trg, key);

@@ -184,3 +184,3 @@ };

Validation.forbidden = function (trg, key) {
Reflect.defineMetadata(ValidationKey.FORBIDDEN + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.FORBIDDEN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.FORBIDDEN, true, trg, key);

@@ -196,3 +196,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.MIN_LENGTH + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN_LENGTH, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.MIN_LENGTH, lBound, trg, key);

@@ -209,3 +209,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.MAX_LENGTH + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX_LENGTH, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.MAX_LENGTH, uBound, trg, key);

@@ -229,4 +229,4 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MIN + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -251,4 +251,4 @@ Reflect.defineMetadata(ValidationKey.MIN, lBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MAX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -273,5 +273,5 @@ Reflect.defineMetadata(ValidationKey.MAX, uBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MIN + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MAX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -290,3 +290,3 @@ Reflect.defineMetadata(ValidationKey.MIN, lBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.REGEX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.REGEX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.REGEX, regex, trg, key);

@@ -305,3 +305,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.OPTIONS + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.OPTIONS, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.OPTIONS, opts, trg, key);

@@ -320,3 +320,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.CUSTOM + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.CUSTOM, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.CUSTOM, fn, trg, key);

@@ -396,3 +396,3 @@ };

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is required";
retVal.message = "".concat(name_1, " is required");
}

@@ -412,6 +412,6 @@ }

var tests = isArray ? value : [value];
var allOk = tests.every(function (test) { return regex_1.test("" + test); });
var allOk = tests.every(function (test) { return regex_1.test("".concat(test)); });
if (!allOk) {
var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = isArray ? name_1 + " contains an invalid item" : name_1 + " is invalid";
retVal.message = isArray ? "".concat(name_1, " contains an invalid item") : "".concat(name_1, " is invalid");
}

@@ -424,3 +424,3 @@ }

var BooleanParser = function (obj) {
var str = ("" + obj).toLowerCase();
var str = "".concat(obj).toLowerCase();
if (['1', 'true'].indexOf(str) !== -1)

@@ -443,4 +443,4 @@ return true;

var IntegerParser = function (obj) {
var asInt = parseInt("" + obj, 10);
if (!isNaN(asInt) && asInt.toFixed(8) === parseFloat("" + obj).toFixed(8))
var asInt = parseInt("".concat(obj), 10);
if (!isNaN(asInt) && asInt.toFixed(8) === parseFloat("".concat(obj)).toFixed(8))
return asInt;

@@ -450,3 +450,3 @@ };

var NumberParser = function (obj) {
var test = parseFloat("" + obj);
var test = parseFloat("".concat(obj));
if (!isNaN(test))

@@ -489,3 +489,3 @@ return test;

default:
throw new RangeError("No parser implemented for " + type);
throw new RangeError("No parser implemented for ".concat(type));
}

@@ -519,6 +519,6 @@ };

hasMin_1 && hasMax_1
? name_1 + " must " + rangeImperative + " between " + fmtMin + " and " + fmtMax
? "".concat(name_1, " must ").concat(rangeImperative, " between ").concat(fmtMin, " and ").concat(fmtMax)
: hasMin_1
? name_1 + " cannot " + boundImperative + " " + compareLT + " " + fmtMin
: name_1 + " cannot " + boundImperative + " " + compareGT + " " + fmtMax;
? "".concat(name_1, " cannot ").concat(boundImperative, " ").concat(compareLT, " ").concat(fmtMin)
: "".concat(name_1, " cannot ").concat(boundImperative, " ").concat(compareGT, " ").concat(fmtMax);
}

@@ -547,6 +547,6 @@ retVal.valid = !retVal.message;

hasMinLen && hasMaxLen
? name_1 + " must contain between " + minLength + " and " + maxLength + " " + noun + "s"
? "".concat(name_1, " must contain between ").concat(minLength, " and ").concat(maxLength, " ").concat(noun, "s")
: hasMinLen
? name_1 + " cannot contain fewer than " + minLength + " " + noun + pluraliser
: name_1 + " cannot contain more than " + maxLength + " " + noun + pluraliser;
? "".concat(name_1, " cannot contain fewer than ").concat(minLength, " ").concat(noun).concat(pluraliser)
: "".concat(name_1, " cannot contain more than ").concat(maxLength, " ").concat(noun).concat(pluraliser);
}

@@ -571,4 +571,4 @@ retVal.valid = !retVal.message;

retVal.message = isArray
? name_1 + " contains an invalid " + type
: name_1 + " is not a valid " + type;
? "".concat(name_1, " contains an invalid ").concat(type)
: "".concat(name_1, " is not a valid ").concat(type);
}

@@ -591,3 +591,3 @@ }

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is invalid";
retVal.message = "".concat(name_1, " is invalid");
}

@@ -606,3 +606,3 @@ retVal.valid = !retVal.message;

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is forbidden";
retVal.message = "".concat(name_1, " is forbidden");
}

@@ -626,4 +626,4 @@ }

retVal.message = isArray
? name_1 + " contains an invalid option"
: name_1 + " is an invalid option";
? "".concat(name_1, " contains an invalid option")
: "".concat(name_1, " is an invalid option");
}

@@ -688,3 +688,3 @@ }

default:
throw new RangeError("No validator implemented for " + key);
throw new RangeError("No validator implemented for ".concat(key));
}

@@ -705,3 +705,3 @@ };

return Reflect.getMetadataKeys(proto)
.map(function (k) { return "" + k; })
.map(function (k) { return "".concat(k); })
.reduce(function (acc, cur) {

@@ -711,3 +711,3 @@ var valDef = allChecks.filter(function (dg) { return cur.indexOf(dg.meta + ':') === 0; })[0];

var key = cur.replace(valDef.meta + ':', '');
var navkey_1 = pfx ? pfx + "." + key : key;
var navkey_1 = pfx ? "".concat(pfx, ".").concat(key) : key;
var prior = acc.filter(function (a) { return a.navkey === navkey_1 && a.fn === valDef.fn; })[0];

@@ -728,4 +728,4 @@ if (prior) {

}
else if (cur.indexOf(MetadataKey.MODEL + ":") === 0) {
var subkey_1 = cur.replace(MetadataKey.MODEL + ":", '');
else if (cur.indexOf("".concat(MetadataKey.MODEL, ":")) === 0) {
var subkey_1 = cur.replace("".concat(MetadataKey.MODEL, ":"), '');
var subproto_1 = Reflect.getMetadata(cur, proto).prototype;

@@ -735,3 +735,3 @@ var subobj = (trg || {})[subkey_1];

subobj.forEach(function (subitem, i) {
var subpfx = pfx ? pfx + "." + subkey_1 + "[" + i + "]" : subkey_1 + "[" + i + "]";
var subpfx = pfx ? "".concat(pfx, ".").concat(subkey_1, "[").concat(i, "]") : "".concat(subkey_1, "[").concat(i, "]");
acc.push.apply(acc, ReflectValidation.getTestInstructions(allChecks, subproto_1, subitem || {}, subpfx));

@@ -741,3 +741,3 @@ });

else if (subobj) {
var subpfx = pfx ? pfx + "." + subkey_1 : subkey_1;
var subpfx = pfx ? "".concat(pfx, ".").concat(subkey_1) : subkey_1;
acc.push.apply(acc, ReflectValidation.getTestInstructions(allChecks, subproto_1, subobj, subpfx));

@@ -744,0 +744,0 @@ }

@@ -5,3 +5,3 @@ (function (global, factory) {

(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ne_codl = {}));
}(this, (function (exports) { 'use strict';
})(this, (function (exports) { 'use strict';

@@ -140,3 +140,3 @@ /**

return function (trg, key) {
Reflect.defineMetadata(MetadataKey.MODEL + ":" + key.toString(), ctor, trg);
Reflect.defineMetadata("".concat(MetadataKey.MODEL, ":").concat(key.toString()), ctor, trg);
};

@@ -152,15 +152,15 @@ };

Type.boolean = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'boolean', trg, key);
};
Type.date = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'date', trg, key);
};
Type.integer = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'integer', trg, key);
};
Type.number = function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, 'number', trg, key);

@@ -180,3 +180,3 @@ };

Validation.required = function (trg, key) {
Reflect.defineMetadata(ValidationKey.REQUIRED + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.REQUIRED, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.REQUIRED, true, trg, key);

@@ -189,3 +189,3 @@ };

Validation.forbidden = function (trg, key) {
Reflect.defineMetadata(ValidationKey.FORBIDDEN + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.FORBIDDEN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.FORBIDDEN, true, trg, key);

@@ -201,3 +201,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.MIN_LENGTH + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN_LENGTH, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.MIN_LENGTH, lBound, trg, key);

@@ -214,3 +214,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.MAX_LENGTH + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX_LENGTH, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.MAX_LENGTH, uBound, trg, key);

@@ -234,4 +234,4 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MIN + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -256,4 +256,4 @@ Reflect.defineMetadata(ValidationKey.MIN, lBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MAX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -278,5 +278,5 @@ Reflect.defineMetadata(ValidationKey.MAX, uBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.TYPE + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MIN + ":" + key.toString(), key, trg);
Reflect.defineMetadata(ValidationKey.MAX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.TYPE, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MIN, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.MAX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.TYPE, typekey, trg, key);

@@ -295,3 +295,3 @@ Reflect.defineMetadata(ValidationKey.MIN, lBound, trg, key);

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.REGEX + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.REGEX, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.REGEX, regex, trg, key);

@@ -310,3 +310,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.OPTIONS + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.OPTIONS, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.OPTIONS, opts, trg, key);

@@ -325,3 +325,3 @@ };

return function (trg, key) {
Reflect.defineMetadata(ValidationKey.CUSTOM + ":" + key.toString(), key, trg);
Reflect.defineMetadata("".concat(ValidationKey.CUSTOM, ":").concat(key.toString()), key, trg);
Reflect.defineMetadata(ValidationKey.CUSTOM, fn, trg, key);

@@ -401,3 +401,3 @@ };

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is required";
retVal.message = "".concat(name_1, " is required");
}

@@ -417,6 +417,6 @@ }

var tests = isArray ? value : [value];
var allOk = tests.every(function (test) { return regex_1.test("" + test); });
var allOk = tests.every(function (test) { return regex_1.test("".concat(test)); });
if (!allOk) {
var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = isArray ? name_1 + " contains an invalid item" : name_1 + " is invalid";
retVal.message = isArray ? "".concat(name_1, " contains an invalid item") : "".concat(name_1, " is invalid");
}

@@ -429,3 +429,3 @@ }

var BooleanParser = function (obj) {
var str = ("" + obj).toLowerCase();
var str = "".concat(obj).toLowerCase();
if (['1', 'true'].indexOf(str) !== -1)

@@ -448,4 +448,4 @@ return true;

var IntegerParser = function (obj) {
var asInt = parseInt("" + obj, 10);
if (!isNaN(asInt) && asInt.toFixed(8) === parseFloat("" + obj).toFixed(8))
var asInt = parseInt("".concat(obj), 10);
if (!isNaN(asInt) && asInt.toFixed(8) === parseFloat("".concat(obj)).toFixed(8))
return asInt;

@@ -455,3 +455,3 @@ };

var NumberParser = function (obj) {
var test = parseFloat("" + obj);
var test = parseFloat("".concat(obj));
if (!isNaN(test))

@@ -494,3 +494,3 @@ return test;

default:
throw new RangeError("No parser implemented for " + type);
throw new RangeError("No parser implemented for ".concat(type));
}

@@ -524,6 +524,6 @@ };

hasMin_1 && hasMax_1
? name_1 + " must " + rangeImperative + " between " + fmtMin + " and " + fmtMax
? "".concat(name_1, " must ").concat(rangeImperative, " between ").concat(fmtMin, " and ").concat(fmtMax)
: hasMin_1
? name_1 + " cannot " + boundImperative + " " + compareLT + " " + fmtMin
: name_1 + " cannot " + boundImperative + " " + compareGT + " " + fmtMax;
? "".concat(name_1, " cannot ").concat(boundImperative, " ").concat(compareLT, " ").concat(fmtMin)
: "".concat(name_1, " cannot ").concat(boundImperative, " ").concat(compareGT, " ").concat(fmtMax);
}

@@ -552,6 +552,6 @@ retVal.valid = !retVal.message;

hasMinLen && hasMaxLen
? name_1 + " must contain between " + minLength + " and " + maxLength + " " + noun + "s"
? "".concat(name_1, " must contain between ").concat(minLength, " and ").concat(maxLength, " ").concat(noun, "s")
: hasMinLen
? name_1 + " cannot contain fewer than " + minLength + " " + noun + pluraliser
: name_1 + " cannot contain more than " + maxLength + " " + noun + pluraliser;
? "".concat(name_1, " cannot contain fewer than ").concat(minLength, " ").concat(noun).concat(pluraliser)
: "".concat(name_1, " cannot contain more than ").concat(maxLength, " ").concat(noun).concat(pluraliser);
}

@@ -576,4 +576,4 @@ retVal.valid = !retVal.message;

retVal.message = isArray
? name_1 + " contains an invalid " + type
: name_1 + " is not a valid " + type;
? "".concat(name_1, " contains an invalid ").concat(type)
: "".concat(name_1, " is not a valid ").concat(type);
}

@@ -596,3 +596,3 @@ }

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is invalid";
retVal.message = "".concat(name_1, " is invalid");
}

@@ -611,3 +611,3 @@ retVal.valid = !retVal.message;

var name_1 = ReflectMetadata.getDisplayName(proto, key);
retVal.message = name_1 + " is forbidden";
retVal.message = "".concat(name_1, " is forbidden");
}

@@ -631,4 +631,4 @@ }

retVal.message = isArray
? name_1 + " contains an invalid option"
: name_1 + " is an invalid option";
? "".concat(name_1, " contains an invalid option")
: "".concat(name_1, " is an invalid option");
}

@@ -693,3 +693,3 @@ }

default:
throw new RangeError("No validator implemented for " + key);
throw new RangeError("No validator implemented for ".concat(key));
}

@@ -710,3 +710,3 @@ };

return Reflect.getMetadataKeys(proto)
.map(function (k) { return "" + k; })
.map(function (k) { return "".concat(k); })
.reduce(function (acc, cur) {

@@ -716,3 +716,3 @@ var valDef = allChecks.filter(function (dg) { return cur.indexOf(dg.meta + ':') === 0; })[0];

var key = cur.replace(valDef.meta + ':', '');
var navkey_1 = pfx ? pfx + "." + key : key;
var navkey_1 = pfx ? "".concat(pfx, ".").concat(key) : key;
var prior = acc.filter(function (a) { return a.navkey === navkey_1 && a.fn === valDef.fn; })[0];

@@ -733,4 +733,4 @@ if (prior) {

}
else if (cur.indexOf(MetadataKey.MODEL + ":") === 0) {
var subkey_1 = cur.replace(MetadataKey.MODEL + ":", '');
else if (cur.indexOf("".concat(MetadataKey.MODEL, ":")) === 0) {
var subkey_1 = cur.replace("".concat(MetadataKey.MODEL, ":"), '');
var subproto_1 = Reflect.getMetadata(cur, proto).prototype;

@@ -740,3 +740,3 @@ var subobj = (trg || {})[subkey_1];

subobj.forEach(function (subitem, i) {
var subpfx = pfx ? pfx + "." + subkey_1 + "[" + i + "]" : subkey_1 + "[" + i + "]";
var subpfx = pfx ? "".concat(pfx, ".").concat(subkey_1, "[").concat(i, "]") : "".concat(subkey_1, "[").concat(i, "]");
acc.push.apply(acc, ReflectValidation.getTestInstructions(allChecks, subproto_1, subitem || {}, subpfx));

@@ -746,3 +746,3 @@ });

else if (subobj) {
var subpfx = pfx ? pfx + "." + subkey_1 : subkey_1;
var subpfx = pfx ? "".concat(pfx, ".").concat(subkey_1) : subkey_1;
acc.push.apply(acc, ReflectValidation.getTestInstructions(allChecks, subproto_1, subobj, subpfx));

@@ -837,2 +837,2 @@ }

})));
}));
{
"name": "@ne1410s/codl",
"version": "0.0.35",
"version": "0.0.36",
"description": "Indulge your apps with codl: a component model library",

@@ -41,8 +41,9 @@ "main": "dist/ne14_codl.cjs.min.js",

"chai": "^4.3.4",
"mocha": "^9.1.0",
"prettier": "^2.3.2",
"mocha": "^9.1.3",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"rollup": "^2.56.3",
"rollup-plugin-typescript2": "^0.30.0",
"typescript": "^4.3.5"
"rollup": "^2.60.1",
"rollup-plugin-typescript2": "^0.31.1",
"tslib": "^2.3.1",
"typescript": "^4.5.2"
},

@@ -49,0 +50,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc