elysia 0.2.0-rc.1 → 0.2.0
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/README.md +1 -1
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Building on top of 3 philosophies:
|
|
|
21
21
|
- Simplicity
|
|
22
22
|
- Simple building blocks to create an abstraction, not repeating yourself
|
|
23
23
|
- Flexibility
|
|
24
|
-
- You shall be able to customize most of the library to
|
|
24
|
+
- You shall be able to customize most of the library to fit your needs
|
|
25
25
|
|
|
26
26
|
Designed with TypeScript in mind, you don't need to understand TypeScript to gain the benefit of TypeScript with Elysia. The library understands what you want and automatically infers the type from your code.
|
|
27
27
|
|
package/dist/index.js
CHANGED
|
@@ -236,14 +236,17 @@ export default class Elysia {
|
|
|
236
236
|
return this;
|
|
237
237
|
}
|
|
238
238
|
state(name, value) {
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
if (!(name in this.store)) {
|
|
240
|
+
;
|
|
241
|
+
this.store[name] = value;
|
|
242
|
+
}
|
|
241
243
|
return this;
|
|
242
244
|
}
|
|
243
245
|
decorate(name, value) {
|
|
244
246
|
if (!this.decorators)
|
|
245
247
|
this.decorators = {};
|
|
246
|
-
this.decorators
|
|
248
|
+
if (!(name in this.decorators))
|
|
249
|
+
this.decorators[name] = value;
|
|
247
250
|
return this;
|
|
248
251
|
}
|
|
249
252
|
derive(transform) {
|
|
@@ -457,7 +460,10 @@ export default class Elysia {
|
|
|
457
460
|
return Promise.all(this.lazyLoadModules);
|
|
458
461
|
}
|
|
459
462
|
setModel(record) {
|
|
460
|
-
Object.
|
|
463
|
+
Object.entries(record).forEach(([key, value]) => {
|
|
464
|
+
if (!(key in this.store[DEFS]))
|
|
465
|
+
this.store[DEFS][key] = value;
|
|
466
|
+
});
|
|
461
467
|
return this;
|
|
462
468
|
}
|
|
463
469
|
}
|