lambder 1.0.87 → 1.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Lambder.d.ts CHANGED
@@ -59,6 +59,9 @@ export default class Lambder {
59
59
  private validateSession;
60
60
  private handleNoMatchedAction;
61
61
  addModule(moduleFn: Function): Promise<void>;
62
+ addModuleImport(moduleImport: Promise<{
63
+ default: Function;
64
+ }>): Promise<void>;
62
65
  addRoute(condition: Path | ConditionFunction | RegExp, actionFn: ActionFunction): void;
63
66
  addSessionRoute(condition: Path | ConditionFunction | RegExp, actionFn: ActionFunction): void;
64
67
  addApi(apiName: string | ConditionFunction | RegExp, actionFn: ActionFunction): void;
package/dist/Lambder.js CHANGED
@@ -114,6 +114,10 @@ export default class Lambder {
114
114
  async addModule(moduleFn) {
115
115
  await moduleFn(this);
116
116
  }
117
+ async addModuleImport(moduleImport) {
118
+ const module = await moduleImport;
119
+ await module.default(this);
120
+ }
117
121
  addRoute(condition, actionFn) {
118
122
  this.actionList.push({
119
123
  conditionFn: (ctx) => (ctx.method === "GET" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambder",
3
- "version": "1.0.87",
3
+ "version": "1.0.88",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/Lambder.ts CHANGED
@@ -161,6 +161,10 @@ export default class Lambder {
161
161
  async addModule(moduleFn: Function): Promise<void>{
162
162
  await moduleFn(this);
163
163
  }
164
+ async addModuleImport(moduleImport: Promise<{ default: Function }>): Promise<void>{
165
+ const module = await moduleImport;
166
+ await module.default(this);
167
+ }
164
168
  addRoute(condition: Path|ConditionFunction|RegExp, actionFn: ActionFunction):void{
165
169
  this.actionList.push({
166
170
  conditionFn: (ctx:LambderRenderContext) => (