simple-boot-core
Advanced tools
Comparing version 1.0.35 to 1.0.36
@@ -18,3 +18,3 @@ import 'reflect-metadata'; | ||
export declare const getAfters: (target: any) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoAfters: (target: any, propertyKey: string, type?: ConstructorType<any> | undefined) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoAfters: (target: any, propertyKey: string, type?: ConstructorType<any>) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const Before: (data: AOPOption) => { | ||
@@ -26,3 +26,3 @@ (target: Function): void; | ||
export declare const getBefores: (target: any) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoBefores: (target: any, propertyKey: string, type?: ConstructorType<any> | undefined) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare const getProtoBefores: (target: any, propertyKey: string, type?: ConstructorType<any>) => MetaDataPropertyAtomic<any, AOPOption>[]; | ||
export declare class AroundForceReturn { | ||
@@ -29,0 +29,0 @@ value: any; |
@@ -42,2 +42,2 @@ import 'reflect-metadata'; | ||
export declare function Inject(config: InjectConfig): MethodParameter; | ||
export declare const getInject: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol | undefined) => SaveInjectConfig[]; | ||
export declare const getInject: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol) => SaveInjectConfig[]; |
@@ -5,6 +5,7 @@ import { ReflectMethod, ConstructorType } from '../../types/Types'; | ||
}; | ||
export declare const onRoutes: Map<ConstructorType<any>, string[]>; | ||
export declare const onRoutes: Map<ConstructorType<any>, (string | symbol)[]>; | ||
export declare const OnRouteMetadataKey: unique symbol; | ||
export declare const OnRoute: (config?: OnRouteOption | undefined) => ReflectMethod; | ||
export declare const getOnRoute: (target: any, propertyKey: string) => OnRouteOption; | ||
export declare function OnRoute(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; | ||
export declare function OnRoute(config?: OnRouteOption): ReflectMethod; | ||
export declare const getOnRoute: (target: any, propertyKey: string | symbol) => OnRouteOption; | ||
export {}; |
@@ -7,16 +7,24 @@ "use strict"; | ||
exports.OnRouteMetadataKey = Symbol('OnRoute'); | ||
var OnRoute = function (config) { | ||
return function (target, propertyKey, descriptor) { | ||
var _a; | ||
if (null != target && undefined != target && typeof target === 'object') { | ||
target = target.constructor; | ||
} | ||
if (!exports.onRoutes.get(target)) { | ||
exports.onRoutes.set(target, []); | ||
} | ||
(_a = exports.onRoutes.get(target)) === null || _a === void 0 ? void 0 : _a.push(propertyKey); | ||
ReflectUtils_1.ReflectUtils.defineMetadata(exports.OnRouteMetadataKey, config, target, propertyKey); | ||
var metadata = ReflectUtils_1.ReflectUtils.getMetadata(exports.OnRouteMetadataKey, target, propertyKey); | ||
}; | ||
var onRouteProcess = function (config, target, propertyKey, description) { | ||
var _a; | ||
if (null != target && undefined != target && typeof target === 'object') { | ||
target = target.constructor; | ||
} | ||
if (!exports.onRoutes.get(target)) { | ||
exports.onRoutes.set(target, []); | ||
} | ||
(_a = exports.onRoutes.get(target)) === null || _a === void 0 ? void 0 : _a.push(propertyKey); | ||
ReflectUtils_1.ReflectUtils.defineMetadata(exports.OnRouteMetadataKey, config, target, propertyKey); | ||
var metadata = ReflectUtils_1.ReflectUtils.getMetadata(exports.OnRouteMetadataKey, target, propertyKey); | ||
}; | ||
function OnRoute(configOrTarget, propertyKey, descriptor) { | ||
if (propertyKey && descriptor) { | ||
onRouteProcess({}, configOrTarget, propertyKey, descriptor); | ||
} | ||
else { | ||
return function (target, propertyKey, descriptor) { | ||
onRouteProcess(configOrTarget, target, propertyKey, descriptor); | ||
}; | ||
} | ||
} | ||
exports.OnRoute = OnRoute; | ||
@@ -23,0 +31,0 @@ var getOnRoute = function (target, propertyKey) { |
@@ -20,3 +20,3 @@ import { ConstructorType, GenericClassDecorator, ReflectMethod } from '../../types/Types'; | ||
declare type RouteConfig = { | ||
path: string; | ||
path: string | string[]; | ||
}; | ||
@@ -23,0 +23,0 @@ export declare type SaveRouteConfig = { |
@@ -11,17 +11,21 @@ "use strict"; | ||
config.route = ((_a = config.route) !== null && _a !== void 0 ? _a : {}); | ||
if (config.route[it.config.path]) { | ||
config.route[it.config.path].propertyKeys.push(it.propertyKey); | ||
var paths = Array.isArray(it.config.path) ? it.config.path : [it.config.path]; | ||
for (var _i = 0, paths_1 = paths; _i < paths_1.length; _i++) { | ||
var path = paths_1[_i]; | ||
if (config.route[path]) { | ||
config.route[path].propertyKeys.push(it.propertyKey); | ||
} | ||
else { | ||
config.route[path] = { target: target, propertyKeys: [it.propertyKey] }; | ||
} | ||
} | ||
else { | ||
config.route[it.config.path] = { target: target, propertyKeys: [it.propertyKey] }; | ||
} | ||
}); | ||
ReflectUtils_1.ReflectUtils.defineMetadata(exports.RouterMetadataKey, config, target); | ||
}; | ||
function Router(config) { | ||
if (typeof config === 'function') { | ||
function Router(configOrTarget) { | ||
if (typeof configOrTarget === 'function') { | ||
var routerConfig = { | ||
path: '' | ||
}; | ||
routerProcess(routerConfig, config); | ||
routerProcess(routerConfig, configOrTarget); | ||
} | ||
@@ -31,4 +35,4 @@ else { | ||
var _a; | ||
config.path = (_a = config.path) !== null && _a !== void 0 ? _a : ''; | ||
routerProcess(config, target); | ||
configOrTarget.path = (_a = configOrTarget.path) !== null && _a !== void 0 ? _a : ''; | ||
routerProcess(configOrTarget, target); | ||
}; | ||
@@ -35,0 +39,0 @@ } |
import { ConstructorType, MethodParameter, ReflectField } from '../../types/Types'; | ||
export declare const Valid: MethodParameter; | ||
export declare const getValidIndex: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol | undefined) => number[]; | ||
export declare const getValidIndex: (target: ConstructorType<any> | Function | any, propertyKey?: string | symbol) => number[]; | ||
export declare type Validator = (value: any, ...params: any[]) => boolean; | ||
@@ -5,0 +5,0 @@ export declare type SaveValidator = { |
{ | ||
"name": "simple-boot-core", | ||
"version": "1.0.35", | ||
"version": "1.0.36", | ||
"main": "SimpleApplication.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -60,3 +60,3 @@ "use strict"; | ||
SimProxyHandler.prototype.executeExceptionHandler = function (e, argumentsList, inHandler) { | ||
var _a, _b; | ||
var _a; | ||
var otherStorage = new Map(); | ||
@@ -69,3 +69,3 @@ otherStorage.set(e.constructor, e); | ||
otherStorage.set(Inject_1.SituationTypeContainer, situationTypeContainer); | ||
(_a = argumentsList) === null || _a === void 0 ? void 0 : _a.forEach(function (it) { | ||
argumentsList === null || argumentsList === void 0 ? void 0 : argumentsList.forEach(function (it) { | ||
otherStorage.set(e.constructor, e); | ||
@@ -84,3 +84,3 @@ }); | ||
var exceptionHandler = this.getExceptionHandler(e, inHandler.thisArg, inHandler.config.method); | ||
if (((_b = exceptionHandler === null || exceptionHandler === void 0 ? void 0 : exceptionHandler.length) !== null && _b !== void 0 ? _b : 0) > 0) { | ||
if (((_a = exceptionHandler === null || exceptionHandler === void 0 ? void 0 : exceptionHandler.length) !== null && _a !== void 0 ? _a : 0) > 0) { | ||
this.executeExceptionHandler(e, argumentsList, exceptionHandler[0]); | ||
@@ -87,0 +87,0 @@ } |
@@ -125,8 +125,3 @@ "use strict"; | ||
module_1 = null; | ||
if (executeModule && executeModule.propertyKeys && executeModule.propertyKeys.length) { | ||
module_1 = executeModule.executeModuleProperty(executeModule.propertyKeys[0]); | ||
} | ||
else { | ||
module_1 = executeModule.getModuleInstance(); | ||
} | ||
module_1 = executeModule.getModuleInstance(); | ||
return [4, ((_j = (_h = (_g = executeModule.router) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.canActivate) === null || _j === void 0 ? void 0 : _j.call(_h, intent, module_1))]; | ||
@@ -133,0 +128,0 @@ case 7: |
"use strict"; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RouterModule = void 0; | ||
var Injection_1 = require("../decorators/inject/Injection"); | ||
var MethodNoSuch_1 = require("../throwable/MethodNoSuch"); | ||
var RouterModule = (function () { | ||
@@ -31,2 +41,3 @@ function RouterModule(simstanceManager, router, module, routerChains) { | ||
RouterModule.prototype.executeModuleProperty = function (propertyKey) { | ||
var _a; | ||
var param = []; | ||
@@ -45,3 +56,8 @@ for (var _i = 1; _i < arguments.length; _i++) { | ||
else { | ||
return target[propertyKey].apply(target, param); | ||
if (target[propertyKey]) { | ||
return (_a = target[propertyKey]) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([target], param, false)); | ||
} | ||
else { | ||
throw new MethodNoSuch_1.MethodNoSuch("".concat(propertyKey.toString(), " noSuch"), propertyKey.toString(), propertyKey); | ||
} | ||
} | ||
@@ -48,0 +64,0 @@ } |
@@ -25,3 +25,3 @@ import 'reflect-metadata'; | ||
simAtomic<T>(type: ConstructorType<T>): SimAtomic<T>; | ||
getInstance<T>(type: ConstructorType<T>): T; | ||
getInstance<T>(type: ConstructorType<T>): NonNullable<T>; | ||
sim<T>(type: ConstructorType<T>): T | undefined; | ||
@@ -28,0 +28,0 @@ publishIntent(i: string, data?: any): any[]; |
import { ConstructorType } from '../types/Types'; | ||
import { SimstanceManager } from './SimstanceManager'; | ||
export declare class SimAtomic<T extends Object = Object> { | ||
export declare class SimAtomic<T = object> { | ||
type: ConstructorType<T>; | ||
@@ -5,0 +5,0 @@ private simstanceManager; |
@@ -256,3 +256,3 @@ "use strict"; | ||
var _this = this; | ||
if ((0, SimDecorator_1.getSim)(target) && (typeof target === 'object') && (!('isProxy' in target))) { | ||
if (target !== null && (0, SimDecorator_1.getSim)(target) && (typeof target === 'object') && (!('isProxy' in target))) { | ||
for (var key in target) { | ||
@@ -259,0 +259,0 @@ target[key] = this.proxy(target[key]); |
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
132229
76
2767