@neovici/cosmoz-utils 5.5.0 → 5.8.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/dist/promise.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- declare type Pfn<T> = (arg: T) => void;
1
+ declare type Pfn<T> = (arg?: T) => void;
2
2
  export declare class ManagedPromise<T> extends Promise<T> {
3
3
  constructor(callback?: (resolve: Pfn<T>, reject: Pfn<T>) => void);
4
+ resolve: Pfn<T>;
4
5
  }
5
6
  export declare const timeout$: (ms?: number) => Promise<unknown>;
6
7
  declare type Predicate<T extends Event> = (e: T) => boolean;
package/dist/promise.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable import/group-exports */
2
1
  export class ManagedPromise extends Promise {
3
2
  constructor(callback) {
4
3
  const handles = {};
@@ -6,6 +5,8 @@ export class ManagedPromise extends Promise {
6
5
  Object.assign(this, handles);
7
6
  callback?.(handles.resolve, handles.reject);
8
7
  }
8
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
9
+ resolve = () => { };
9
10
  }
10
11
  export const timeout$ = (ms) => new Promise((res) => setTimeout(res, ms));
11
12
  export const event$ = (target, type, predicate, timeout = 300000) => new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "5.5.0",
3
+ "version": "5.8.0",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",
@@ -52,10 +52,12 @@
52
52
  },
53
53
  "exports": {
54
54
  ".": "./dist/index.js",
55
- "./object": "./dist/object.js",
56
- "./function": "./dist/function.js",
57
55
  "./array": "./dist/array.js",
56
+ "./date": "./dist/date.js",
57
+ "./function": "./dist/function.js",
58
+ "./money": "./dist/money.js",
58
59
  "./promise": "./dist/promise.js",
60
+ "./object": "./dist/object.js",
59
61
  "./tag": "./dist/tag.js",
60
62
  "./template": "./dist/template.js",
61
63
  "./reduce": "./dist/reduce/index.js",