@makano/rew 1.2.73 → 1.2.74
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/rew/const/usage.js +9 -5
- package/lib/rew/modules/context.js +1 -1
- package/package.json +1 -1
- package/runtime.d.ts +1 -1
package/lib/rew/const/usage.js
CHANGED
@@ -29,18 +29,22 @@ module.exports.Usage = class Usage {
|
|
29
29
|
return new Usage(name, trigger, save);
|
30
30
|
}
|
31
31
|
|
32
|
-
group(group
|
33
|
-
return new Usage.Group(group,
|
32
|
+
group(...group){
|
33
|
+
return new Usage.Group(group, {});
|
34
34
|
}
|
35
35
|
|
36
36
|
static Group = class UsageGroup {
|
37
|
-
g = [
|
38
|
-
constructor(g, props){
|
37
|
+
g = []
|
38
|
+
constructor(g, props = {}){
|
39
39
|
this.g = g;
|
40
|
-
for(let i in props){
|
40
|
+
if(props) for(let i in props){
|
41
41
|
this[i] = props[i];
|
42
42
|
}
|
43
43
|
}
|
44
|
+
|
45
|
+
with(props){
|
46
|
+
return new UsageGroup(this.g, props);
|
47
|
+
}
|
44
48
|
}
|
45
49
|
}
|
46
50
|
|
@@ -107,7 +107,7 @@ module.exports.prepareContext = function (
|
|
107
107
|
|
108
108
|
context.using = (name, ...params) => {
|
109
109
|
if(name instanceof Usage.Group){
|
110
|
-
params.unshift(name.g
|
110
|
+
params.unshift(...name.g.slice(1));
|
111
111
|
name = name.g[0];
|
112
112
|
}
|
113
113
|
if(USING_DEFAULT[name]){
|
package/package.json
CHANGED
package/runtime.d.ts
CHANGED
@@ -953,5 +953,5 @@ declare class Usage<T = () => void> {
|
|
953
953
|
save: boolean;
|
954
954
|
constructor(name: string, trigger: T, save: boolean);
|
955
955
|
create(name: string, trigger: T, save: boolean): Usage;
|
956
|
-
group
|
956
|
+
group(...group: any[]): { g: T, with: (props: any) => { g: T, [key: string]: any }, [key: string]: any }
|
957
957
|
}
|