@azrico/global 1.3.82 → 1.3.83

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.
@@ -24,14 +24,14 @@ export declare function clear_all_filters(): any;
24
24
  * @param initialValue
25
25
  * @returns
26
26
  */
27
- export declare function apply_filter(key: string, initialValue?: any): Promise<any>;
27
+ export declare function apply_filter(key: string, initialValue?: any, logs?: boolean): Promise<any>;
28
28
  /**
29
29
  * Apply a filter synchronously
30
30
  * @param key
31
31
  * @param initialValue
32
32
  * @returns
33
33
  */
34
- export declare function apply_filter_sync(key: string, initialValue?: any): any;
34
+ export declare function apply_filter_sync(key: string, initialValue?: any, logs?: boolean): any;
35
35
  /**
36
36
  * Adds a filter until the current component unmounts
37
37
  * @param key
@@ -20,8 +20,7 @@
20
20
  * @param key
21
21
  * @param initialValue
22
22
  * @returns
23
- */function _apply_filter(){return _apply_filter=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i=arguments;return _regeneratorRuntime().wrap(function j(b){for(;1;)switch(b.prev=b.next){case 0:if(c=1<i.length&&void 0!==i[1]?i[1]:null,d=_core["default"].Global_get(lname_filter,a),Array.isArray(d)&&0!=d.length){b.next=4;break}return b.abrupt("return",c);case 4:d.sort(function(c,a){return c.order>a.order?1:-1}),e=c,f=0;case 7:if(!(f<d.length)){b.next=16;break}return g=d[f],b.next=11,g.action(e);case 11:h=b.sent,e=h;case 13:f++,b.next=7;break;case 16:return b.abrupt("return",e);case 17:case"end":return b.stop()}},b)})),_apply_filter.apply(this,arguments)}function apply_filter_sync(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=_core["default"].Global_get(lname_filter,a);if(!Array.isArray(c)||0==c.length)return b;c.sort(function(c,a){return c.order>a.order?1:-1});/* lower order gets executed first */for(var d=b,e=0;e<c.length;e++){var f=c[e],g=f.action(d);//console.log("filtered ", previous_value, " --> ", new_value);
24
- g!==void 0&&(d=g)}return d}/* -------------------------------------------------------------------------- */ /**
23
+ */function _apply_filter(){return _apply_filter=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i,j=arguments;return _regeneratorRuntime().wrap(function k(b){for(;1;)switch(b.prev=b.next){case 0:if(c=1<j.length&&void 0!==j[1]?j[1]:null,d=!!(2<j.length&&void 0!==j[2])&&j[2],e=_core["default"].Global_get(lname_filter,a),Array.isArray(e)&&0!=e.length){b.next=5;break}return b.abrupt("return",c);case 5:e.sort(function(c,a){return c.order>a.order?1:-1}),f=c,g=0;case 8:if(!(g<e.length)){b.next=18;break}return h=e[g],b.next=12,h.action(f);case 12:i=b.sent,d&&console.log("filtered ",f," --> ",i),f=i;case 15:g++,b.next=8;break;case 18:return b.abrupt("return",f);case 19:case"end":return b.stop()}},b)})),_apply_filter.apply(this,arguments)}function apply_filter_sync(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],d=_core["default"].Global_get(lname_filter,a);if(!Array.isArray(d)||0==d.length)return b;d.sort(function(c,a){return c.order>a.order?1:-1});/* lower order gets executed first */for(var e=b,f=0;f<d.length;f++){var g=d[f],h=g.action(e);c&&console.log("filtered ",e," --> ",h),h!==void 0&&(e=h)}return e}/* -------------------------------------------------------------------------- */ /**
25
24
  * Adds a filter until the current component unmounts
26
25
  * @param key
27
26
  * @param action
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/global",
3
- "version": "1.3.82",
3
+ "version": "1.3.83",
4
4
  "description": "Simple global functions and helpers",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",