Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-boot-core

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-boot-core - npm Package Compare versions

Comparing version 1.0.30 to 1.0.31

2

package.json
{
"name": "simple-boot-core",
"version": "1.0.30",
"version": "1.0.31",
"main": "SimpleApplication.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -280,2 +280,3 @@ SIMPLE-BOOT-CORE

class AppRouter {
@Route({path:'/user'})

@@ -285,2 +286,3 @@ user1() {

}
@Route({path:'/user'})

@@ -290,2 +292,7 @@ user2() {

}
@Route({path:'/user-props'})
user2(props: string) {
console.log('user propss', props)
}
}

@@ -297,4 +304,10 @@

it.executeModuleProperty(key);
})
});
})
new SimpleApplication(AppRouter, option).run().routing('/user-props').then(it => {
// direct call
let propertyKey = it.propertyKeys?.[0];
let moduleInstance = routerModule.getModuleInstance<(props: string) => void>(propertyKey);
moduleInstance('propData');
})
// output 💥

@@ -301,0 +314,0 @@ // user say1~

@@ -17,3 +17,3 @@ import { ConstructorType } from '../types/Types';

constructor(simstanceManager: SimstanceManager, router?: R | undefined, module?: ConstructorType<M> | undefined, routerChains?: R[]);
getModuleInstance<T = M>(): T | undefined;
getModuleInstance<T = M>(propertyKey?: string | symbol, instanceBind?: boolean | any): T | undefined;
executeModuleProperty(propertyKey: string | symbol, ...param: any[]): any;

@@ -20,0 +20,0 @@ get lastRouteChain(): R;

@@ -13,4 +13,18 @@ "use strict";

}
RouterModule.prototype.getModuleInstance = function () {
return this.simstanceManager.getOrNewSim(this.module);
RouterModule.prototype.getModuleInstance = function (propertyKey, instanceBind) {
if (instanceBind === void 0) { instanceBind = true; }
var instance = this.simstanceManager.getOrNewSim(this.module);
if (propertyKey && this.propertyKeys && this.propertyKeys.includes(propertyKey)) {
var instanceElement = instance[propertyKey];
if (instanceBind && typeof instanceBind === 'boolean') {
instanceElement = instanceElement.bind(instance);
}
else if (instanceBind && typeof instanceBind === 'object') {
instanceElement = instanceElement.bind(instanceBind);
}
return instanceElement;
}
else {
return instance;
}
};

@@ -17,0 +31,0 @@ RouterModule.prototype.executeModuleProperty = function (propertyKey) {

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