@makano/rew 1.2.73 → 1.2.74

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.
@@ -29,18 +29,22 @@ module.exports.Usage = class Usage {
29
29
  return new Usage(name, trigger, save);
30
30
  }
31
31
 
32
- group(group, props){
33
- return new Usage.Group(group, props);
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[1])
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makano/rew",
3
- "version": "1.2.73",
3
+ "version": "1.2.74",
4
4
  "description": "A simple coffescript runtime and app manager",
5
5
  "main": "main.js",
6
6
  "directories": {
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<T = any[], U = any>(group: T, props?: U): { g: T, [key: string]: any }
956
+ group(...group: any[]): { g: T, with: (props: any) => { g: T, [key: string]: any }, [key: string]: any }
957
957
  }