@eva/inspector-decorator
Advanced tools
Comparing version 0.1.0-alpha.0 to 0.1.0-alpha.1
@@ -0,1 +1,3 @@ | ||
declare type AnyOptions = Record<string, any>; | ||
export declare interface ClassType<T = any> { | ||
@@ -15,2 +17,4 @@ new (...args: any): T; | ||
export declare function Field(returnTypeFunction?: ReturnTypeFunc | FieldOptions, maybeOptions?: FieldOptions): PropertyDecorator; | ||
export declare type FieldMetadata<T extends Record<string, any>> = { | ||
@@ -20,3 +24,3 @@ [K in keyof T]: FieldMetadataInner<T[K]>; | ||
export declare interface FieldMetadataInner<T> extends NumberOptions { | ||
export declare interface FieldMetadataInner<T> extends NumberOptions, FillterOptions, FilltersOptions, AnyOptions { | ||
type: T extends number ? 'number' : T extends string ? 'string' : T extends boolean ? 'boolean' : T extends Record<string, any> ? FieldMetadata<T> : string; | ||
@@ -26,5 +30,14 @@ isArray: boolean; | ||
export declare interface FieldOptions extends NumberOptions { | ||
export declare interface FieldOptions extends NumberOptions, FillterOptions, FilltersOptions, AnyOptions { | ||
type?: string; | ||
} | ||
export declare interface FillterOptions { | ||
filter?(val: any): any; | ||
} | ||
export declare interface FilltersOptions { | ||
filters?: ((val: any) => any)[]; | ||
} | ||
export declare function getPropertiesOf<T extends ClassType<any> & { | ||
@@ -31,0 +44,0 @@ getProperties?: StaticGetProperties<T>; |
@@ -55,2 +55,4 @@ 'use strict'; | ||
if (Array.isArray(returnType)) { | ||
isArray = true; | ||
// not support Tuples yet | ||
type = returnType[0]; | ||
@@ -57,0 +59,0 @@ } |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=function(e){function r(){var t=this.constructor,r=e.call(this,"Symbol keys are not supported yet!")||this;return Object.setPrototypeOf(r,t.prototype),r}return t.__extends(r,e),r}(Error),r=function(e){function r(){var t=this.constructor,r=e.call(this,"getProperties is not a function!")||this;return Object.setPrototypeOf(r,t.prototype),r}return t.__extends(r,e),r}(Error);function n(t){return t===String?"string":t===Number?"number":t===Boolean?"boolean":"unknown"}exports.Field=function(r,o){return function(i,u){if("symbol"==typeof u)throw new e;var s=function(t,e){return"function"==typeof t?{returnTypeFunc:t,options:e||{}}:{options:t||{}}}(r,o);!function(e,r,o,i){var u=Reflect.getMetadata("design:type",e,r),s=u===Array,c=n(u);if("unknown"!==c&&(u=c),i){var a=i();u=Array.isArray(a)?a[0]:a}var f=Reflect.getMetadata("IDE_PROPERTY_METADATA",e.constructor)||{};f[r]=t.__assign({type:u,isArray:s},o),Reflect.defineMetadata("IDE_PROPERTY_METADATA",f,e.constructor)}(i,u,s.options,s.returnTypeFunc)}},exports.getPropertiesOf=function t(e){if("getProperties"in e){if("function"!=typeof e.getProperties)throw new r;return e.getProperties()}var o=Reflect.getMetadata("IDE_PROPERTY_METADATA",e)||{};return Object.keys(o).forEach((function(e){if("function"==typeof o[e].type){var r=n(o[e].type);o[e].type="unknown"!==r?r:t(o[e].type)}})),o}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=function(e){function r(){var t=this.constructor,r=e.call(this,"Symbol keys are not supported yet!")||this;return Object.setPrototypeOf(r,t.prototype),r}return t.__extends(r,e),r}(Error),r=function(e){function r(){var t=this.constructor,r=e.call(this,"getProperties is not a function!")||this;return Object.setPrototypeOf(r,t.prototype),r}return t.__extends(r,e),r}(Error);function n(t){return t===String?"string":t===Number?"number":t===Boolean?"boolean":"unknown"}exports.Field=function(r,o){return function(i,u){if("symbol"==typeof u)throw new e;var s=function(t,e){return"function"==typeof t?{returnTypeFunc:t,options:e||{}}:{options:t||{}}}(r,o);!function(e,r,o,i){var u=Reflect.getMetadata("design:type",e,r),s=u===Array,c=n(u);if("unknown"!==c&&(u=c),i){var a=i();Array.isArray(a)?(s=!0,u=a[0]):u=a}var f=Reflect.getMetadata("IDE_PROPERTY_METADATA",e.constructor)||{};f[r]=t.__assign({type:u,isArray:s},o),Reflect.defineMetadata("IDE_PROPERTY_METADATA",f,e.constructor)}(i,u,s.options,s.returnTypeFunc)}},exports.getPropertiesOf=function t(e){if("getProperties"in e){if("function"!=typeof e.getProperties)throw new r;return e.getProperties()}var o=Reflect.getMetadata("IDE_PROPERTY_METADATA",e)||{};return Object.keys(o).forEach((function(e){if("function"==typeof o[e].type){var r=n(o[e].type);o[e].type="unknown"!==r?r:t(o[e].type)}})),o}; |
@@ -51,2 +51,4 @@ import { __extends, __assign } from 'tslib'; | ||
if (Array.isArray(returnType)) { | ||
isArray = true; | ||
// not support Tuples yet | ||
type = returnType[0]; | ||
@@ -53,0 +55,0 @@ } |
{ | ||
"name": "@eva/inspector-decorator", | ||
"version": "0.1.0-alpha.0", | ||
"version": "0.1.0-alpha.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "node ./scripts/build.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19141
375
0