@decaf-ts/decorator-validation
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -65,2 +65,2 @@ /** | ||
export * from "./model"; | ||
export declare const VERSION = "1.3.7"; | ||
export declare const VERSION = "1.4.0"; |
@@ -65,4 +65,4 @@ /** | ||
export * from "./model"; | ||
export const VERSION = "1.3.7"; | ||
export const VERSION = "1.4.0"; | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVIOzs7O0dBSUc7QUFFSDs7OztHQUlHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUgsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxTQUFTLENBQUM7QUFFeEIsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQG1vZHVsZSBkZWNvcmF0b3ItdmFsaWRhdGlvblxuICovXG5cbi8qKlxuICogQHN1bW1hcnkgRGVmaW5lcyB0aGUgTW9kZWwgb2JqZWN0XG4gKiBAbmFtZXNwYWNlIE1vZGVsXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uXG4gKi9cblxuLyoqXG4gKiBAc3VtbWFyeSBIb2xkcyBhbGwgdGhlIHN1cHBvcnRlZCBkZWNvcmF0b3JzXG4gKiBAbmFtZXNwYWNlIERlY29yYXRvcnNcbiAqIEBtZW1iZXJPZi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aW9uXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIFV0aWxzXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIERhdGVzXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uLlV0aWxzXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIEVxdWFsaXR5XG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uLlV0aWxzXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIEhhc2hpbmdcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG4vKipcbiAqIEBuYW1lc3BhY2UgU2VyaWFsaXphdGlvblxuICogQG1lbWJlck9mIG1vZHVsZTpkZWNvcmF0b3ItdmFsaWRhdGlvbi5VdGlsc1xuICovXG5cbi8qKlxuICogQG5hbWVzcGFjZSBGb3JtYXRcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG5leHBvcnQgKiBmcm9tIFwiLi91dGlsc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vdmFsaWRhdGlvblwiO1xuZXhwb3J0ICogZnJvbSBcIi4vbW9kZWxcIjtcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBcIjEuNC4wXCI7XG4iXX0= |
@@ -1,2 +0,2 @@ | ||
export declare function prop(): PropertyDecorator; | ||
export declare function prop(key?: string): PropertyDecorator; | ||
export declare function propMetadata<V>(key: string, value: any): PropertyDecorator; |
import { apply, metadata } from "@decaf-ts/reflection"; | ||
import { ModelKeys } from "./constants"; | ||
export function prop() { | ||
export function prop(key = ModelKeys.ATTRIBUTE) { | ||
return (model, propertyKey) => { | ||
let props; | ||
if (Object.prototype.hasOwnProperty.call(model, ModelKeys.ATTRIBUTE)) { | ||
props = model[ModelKeys.ATTRIBUTE]; | ||
if (Object.prototype.hasOwnProperty.call(model, key)) { | ||
props = model[key]; | ||
} | ||
else { | ||
props = model[ModelKeys.ATTRIBUTE] = []; | ||
props = model[key] = []; | ||
} | ||
@@ -20,2 +20,2 @@ if (!props.includes(propertyKey)) | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy91dGlscy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdkQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUV4QyxNQUFNLFVBQVUsSUFBSTtJQUNsQixPQUFPLENBQUMsS0FBYSxFQUFFLFdBQTRCLEVBQVEsRUFBRTtRQUMzRCxJQUFJLEtBQWUsQ0FBQztRQUNwQixJQUFJLE1BQU0sQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsU0FBUyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUM7WUFDckUsS0FBSyxHQUFJLEtBQWEsQ0FBQyxTQUFTLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDOUMsQ0FBQzthQUFNLENBQUM7WUFDTixLQUFLLEdBQUksS0FBYSxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUM7UUFDbkQsQ0FBQztRQUNELElBQUksQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLFdBQXFCLENBQUM7WUFDeEMsS0FBSyxDQUFDLElBQUksQ0FBQyxXQUFxQixDQUFDLENBQUM7SUFDdEMsQ0FBQyxDQUFDO0FBQ0osQ0FBQztBQUVELE1BQU0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QUNoRCxDQUFDIiwiZmlsZSI6InV0aWxzL2RlY29yYXRvcnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBhcHBseSwgbWV0YWRhdGEgfSBmcm9tIFwiQGRlY2FmLXRzL3JlZmxlY3Rpb25cIjtcbmltcG9ydCB7IE1vZGVsS2V5cyB9IGZyb20gXCIuL2NvbnN0YW50c1wiO1xuXG5leHBvcnQgZnVuY3Rpb24gcHJvcChrZXk6IHN0cmluZyA9IE1vZGVsS2V5cy5BVFRSSUJVVEUpOiBQcm9wZXJ0eURlY29yYXRvciB7XG4gIHJldHVybiAobW9kZWw6IG9iamVjdCwgcHJvcGVydHlLZXk6IHN0cmluZyB8IHN5bWJvbCk6IHZvaWQgPT4ge1xuICAgIGxldCBwcm9wczogc3RyaW5nW107XG4gICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChtb2RlbCwga2V5KSkge1xuICAgICAgcHJvcHMgPSAobW9kZWwgYXMgYW55KVtrZXldO1xuICAgIH0gZWxzZSB7XG4gICAgICBwcm9wcyA9IChtb2RlbCBhcyBhbnkpW2tleV0gPSBbXTtcbiAgICB9XG4gICAgaWYgKCFwcm9wcy5pbmNsdWRlcyhwcm9wZXJ0eUtleSBhcyBzdHJpbmcpKVxuICAgICAgcHJvcHMucHVzaChwcm9wZXJ0eUtleSBhcyBzdHJpbmcpO1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJvcE1ldGFkYXRhPFY+KGtleTogc3RyaW5nLCB2YWx1ZTogYW55KTogUHJvcGVydHlEZWNvcmF0b3Ige1xuICByZXR1cm4gYXBwbHkocHJvcCgpLCBtZXRhZGF0YTxWPihrZXksIHZhbHVlKSk7XG59XG4iXX0= |
@@ -65,2 +65,2 @@ /** | ||
export * from "./model"; | ||
export declare const VERSION = "1.3.7"; | ||
export declare const VERSION = "1.4.0"; |
@@ -1,2 +0,2 @@ | ||
export declare function prop(): PropertyDecorator; | ||
export declare function prop(key?: string): PropertyDecorator; | ||
export declare function propMetadata<V>(key: string, value: any): PropertyDecorator; |
{ | ||
"name": "@decaf-ts/decorator-validation", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "simple decorator based validation engine", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
922898