@zwa73/utils 1.0.167 → 1.0.168

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/UtilClass.js CHANGED
@@ -210,11 +210,10 @@ class Hbs {
210
210
  return '';
211
211
  });
212
212
  this.hbs.registerHelper('defli', (name, options) => {
213
- const rawvalue = options.fn();
213
+ const rawvalue = options.fn(this.context);
214
214
  const values = rawvalue
215
215
  .split('[[br]]')
216
- .map(value => value.trim())
217
- .map(value => this.hbs.compile(value)(this.context));
216
+ .map(value => value.trim());
218
217
  this.context[name] = values;
219
218
  return '';
220
219
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.167",
3
+ "version": "1.0.168",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/UtilClass.ts CHANGED
@@ -67,7 +67,7 @@ export class Stream<T> implements Iterable<T>{
67
67
  //轮询平均分
68
68
  'average':()=>{
69
69
  for (let i = 0; i < count; i++) {
70
- const clist = [];
70
+ const clist:T[] = [];
71
71
  for (let j = i; j < size; j += count)
72
72
  clist.push(this._list[j]);
73
73
  result.push(clist);
@@ -218,12 +218,11 @@ export class Hbs<T extends Record<Keyable,any> = Record<Keyable,any>>{
218
218
  });
219
219
 
220
220
  this.hbs.registerHelper('defli', (name,options)=> {
221
- const rawvalue = options.fn() as string;
221
+ const rawvalue = options.fn(this.context) as string;
222
222
 
223
223
  const values = rawvalue
224
224
  .split('[[br]]')
225
- .map(value => value.trim())
226
- .map(value => this.hbs.compile(value)(this.context));
225
+ .map(value => value.trim());
227
226
  (this.context as any)[name] = values;
228
227
  return '';
229
228
  });