@igo2/utils 1.14.2 → 1.14.3
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/esm2020/igo2-utils.mjs +4 -4
- package/esm2020/lib/base64.mjs +84 -84
- package/esm2020/lib/change.interface.mjs +6 -6
- package/esm2020/lib/change.mjs +86 -86
- package/esm2020/lib/clipboard.mjs +51 -51
- package/esm2020/lib/file.mjs +27 -27
- package/esm2020/lib/index.mjs +12 -12
- package/esm2020/lib/number-utils.mjs +6 -6
- package/esm2020/lib/object-utils.mjs +247 -247
- package/esm2020/lib/strenum.mjs +7 -7
- package/esm2020/lib/string-utils.mjs +104 -104
- package/esm2020/lib/user-agent.mjs +2 -2
- package/esm2020/lib/uuid.mjs +8 -8
- package/esm2020/lib/watcher.mjs +40 -40
- package/esm2020/public_api.mjs +4 -4
- package/fesm2015/igo2-utils.mjs +654 -654
- package/fesm2020/igo2-utils.mjs +654 -654
- package/index.d.ts +5 -5
- package/lib/base64.d.ts +8 -8
- package/lib/change.d.ts +5 -5
- package/lib/change.interface.d.ts +24 -24
- package/lib/clipboard.d.ts +7 -7
- package/lib/file.d.ts +16 -16
- package/lib/index.d.ts +12 -12
- package/lib/number-utils.d.ts +3 -3
- package/lib/object-utils.d.ts +26 -26
- package/lib/strenum.d.ts +4 -4
- package/lib/string-utils.d.ts +6 -6
- package/lib/user-agent.d.ts +5 -5
- package/lib/uuid.d.ts +2 -2
- package/lib/watcher.d.ts +19 -19
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@igo2/utils" />
|
|
5
|
-
export * from './public_api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@igo2/utils" />
|
|
5
|
+
export * from './public_api';
|
package/lib/base64.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare class Base64 {
|
|
2
|
-
private static PADCHAR;
|
|
3
|
-
private static ALPHA;
|
|
4
|
-
private static getByte;
|
|
5
|
-
private static getByte64;
|
|
6
|
-
static decode(s: string): string;
|
|
7
|
-
static encode(s: string): string;
|
|
8
|
-
}
|
|
1
|
+
export declare class Base64 {
|
|
2
|
+
private static PADCHAR;
|
|
3
|
+
private static ALPHA;
|
|
4
|
+
private static getByte;
|
|
5
|
+
private static getByte64;
|
|
6
|
+
static decode(s: string): string;
|
|
7
|
+
static encode(s: string): string;
|
|
8
|
+
}
|
package/lib/change.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GroupingChanges } from './change.interface';
|
|
2
|
-
export declare class ChangeUtils {
|
|
3
|
-
static findChanges(obj1: any[], obj2: any[], ignoreKeys?: string[]): GroupingChanges;
|
|
4
|
-
private static compareObject;
|
|
5
|
-
}
|
|
1
|
+
import { GroupingChanges } from './change.interface';
|
|
2
|
+
export declare class ChangeUtils {
|
|
3
|
+
static findChanges(obj1: any[], obj2: any[], ignoreKeys?: string[]): GroupingChanges;
|
|
4
|
+
private static compareObject;
|
|
5
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export declare enum ChangeType {
|
|
2
|
-
ADDED = "added",
|
|
3
|
-
DELETED = "deleted",
|
|
4
|
-
MODIFIED = "modified"
|
|
5
|
-
}
|
|
6
|
-
export interface Change {
|
|
7
|
-
type: ChangeType;
|
|
8
|
-
keysChanged?: {
|
|
9
|
-
key: string;
|
|
10
|
-
newValue: any;
|
|
11
|
-
oldValue: any;
|
|
12
|
-
}[];
|
|
13
|
-
}
|
|
14
|
-
export interface GroupingChanges {
|
|
15
|
-
added: ChangeItem[];
|
|
16
|
-
deleted: ChangeItem[];
|
|
17
|
-
modified: ChangeItem[];
|
|
18
|
-
}
|
|
19
|
-
export interface ChangeItem {
|
|
20
|
-
change: Change;
|
|
21
|
-
value: any;
|
|
22
|
-
oldValue?: any;
|
|
23
|
-
newValue?: any;
|
|
24
|
-
}
|
|
1
|
+
export declare enum ChangeType {
|
|
2
|
+
ADDED = "added",
|
|
3
|
+
DELETED = "deleted",
|
|
4
|
+
MODIFIED = "modified"
|
|
5
|
+
}
|
|
6
|
+
export interface Change {
|
|
7
|
+
type: ChangeType;
|
|
8
|
+
keysChanged?: {
|
|
9
|
+
key: string;
|
|
10
|
+
newValue: any;
|
|
11
|
+
oldValue: any;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
export interface GroupingChanges {
|
|
15
|
+
added: ChangeItem[];
|
|
16
|
+
deleted: ChangeItem[];
|
|
17
|
+
modified: ChangeItem[];
|
|
18
|
+
}
|
|
19
|
+
export interface ChangeItem {
|
|
20
|
+
change: Change;
|
|
21
|
+
value: any;
|
|
22
|
+
oldValue?: any;
|
|
23
|
+
newValue?: any;
|
|
24
|
+
}
|
package/lib/clipboard.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class Clipboard {
|
|
2
|
-
static copy(element: HTMLTextAreaElement | string): boolean;
|
|
3
|
-
private static createTextArea;
|
|
4
|
-
private static destroyTextArea;
|
|
5
|
-
private static selectText;
|
|
6
|
-
private static copyTextToClipboard;
|
|
7
|
-
}
|
|
1
|
+
export declare class Clipboard {
|
|
2
|
+
static copy(element: HTMLTextAreaElement | string): boolean;
|
|
3
|
+
private static createTextArea;
|
|
4
|
+
private static destroyTextArea;
|
|
5
|
+
private static selectText;
|
|
6
|
+
private static copyTextToClipboard;
|
|
7
|
+
}
|
package/lib/file.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trigger download of a file
|
|
3
|
-
*
|
|
4
|
-
* @param content File content
|
|
5
|
-
* @param mimeType File mime type
|
|
6
|
-
* @param fileName File name
|
|
7
|
-
*/
|
|
8
|
-
export declare function downloadContent(content: string, mimeType: string, fileName: string): void;
|
|
9
|
-
/**
|
|
10
|
-
* Trigger download of a file
|
|
11
|
-
*
|
|
12
|
-
* @param content File content
|
|
13
|
-
* @param mimeType File mime type
|
|
14
|
-
* @param fileName File name
|
|
15
|
-
*/
|
|
16
|
-
export declare function downloadFromUri(uri: string, fileName: string): void;
|
|
1
|
+
/**
|
|
2
|
+
* Trigger download of a file
|
|
3
|
+
*
|
|
4
|
+
* @param content File content
|
|
5
|
+
* @param mimeType File mime type
|
|
6
|
+
* @param fileName File name
|
|
7
|
+
*/
|
|
8
|
+
export declare function downloadContent(content: string, mimeType: string, fileName: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Trigger download of a file
|
|
11
|
+
*
|
|
12
|
+
* @param content File content
|
|
13
|
+
* @param mimeType File mime type
|
|
14
|
+
* @param fileName File name
|
|
15
|
+
*/
|
|
16
|
+
export declare function downloadFromUri(uri: string, fileName: string): void;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './base64';
|
|
2
|
-
export * from './clipboard';
|
|
3
|
-
export * from './change';
|
|
4
|
-
export * from './change.interface';
|
|
5
|
-
export * from './file';
|
|
6
|
-
export * from './object-utils';
|
|
7
|
-
export * from './number-utils';
|
|
8
|
-
export * from './strenum';
|
|
9
|
-
export * from './string-utils';
|
|
10
|
-
export * from './user-agent';
|
|
11
|
-
export * from './uuid';
|
|
12
|
-
export * from './watcher';
|
|
1
|
+
export * from './base64';
|
|
2
|
+
export * from './clipboard';
|
|
3
|
+
export * from './change';
|
|
4
|
+
export * from './change.interface';
|
|
5
|
+
export * from './file';
|
|
6
|
+
export * from './object-utils';
|
|
7
|
+
export * from './number-utils';
|
|
8
|
+
export * from './strenum';
|
|
9
|
+
export * from './string-utils';
|
|
10
|
+
export * from './user-agent';
|
|
11
|
+
export * from './uuid';
|
|
12
|
+
export * from './watcher';
|
package/lib/number-utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class NumberUtils {
|
|
2
|
-
static roundToNDecimal(num: number, decimal?: number): number;
|
|
3
|
-
}
|
|
1
|
+
export declare class NumberUtils {
|
|
2
|
+
static roundToNDecimal(num: number, decimal?: number): number;
|
|
3
|
+
}
|
package/lib/object-utils.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export declare class ObjectUtils {
|
|
2
|
-
static resolve(obj: object, key: string): any;
|
|
3
|
-
static isObject(item: object): boolean;
|
|
4
|
-
static mergeDeep(target: object, source: object, ignoreUndefined?: boolean): any;
|
|
5
|
-
static copyDeep(src: any): any;
|
|
6
|
-
static removeDuplicateCaseInsensitive(obj: object): void;
|
|
7
|
-
static removeUndefined(obj: object): any;
|
|
8
|
-
static removeNull(obj: object): any;
|
|
9
|
-
static naturalCompare(a: any, b: any, direction?: string, nullsFirst?: boolean): any;
|
|
10
|
-
/**
|
|
11
|
-
* Return true if two object are equivalent.
|
|
12
|
-
* Objects are considered equivalent if they have the same properties and
|
|
13
|
-
* if all of their properties (first-level only) share the same value.
|
|
14
|
-
* @param obj1 First object
|
|
15
|
-
* @param obj2 Second object
|
|
16
|
-
* @returns Whether two objects arer equivalent
|
|
17
|
-
*/
|
|
18
|
-
static objectsAreEquivalent(obj1: object, obj2: object): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Return a new object with an array of keys removed
|
|
21
|
-
* @param obj Source object
|
|
22
|
-
* @param keys Keys to remove
|
|
23
|
-
* @returns A new object
|
|
24
|
-
*/
|
|
25
|
-
static removeKeys(obj: object, keys: string[]): object;
|
|
26
|
-
}
|
|
1
|
+
export declare class ObjectUtils {
|
|
2
|
+
static resolve(obj: object, key: string): any;
|
|
3
|
+
static isObject(item: object): boolean;
|
|
4
|
+
static mergeDeep(target: object, source: object, ignoreUndefined?: boolean): any;
|
|
5
|
+
static copyDeep(src: any): any;
|
|
6
|
+
static removeDuplicateCaseInsensitive(obj: object): void;
|
|
7
|
+
static removeUndefined(obj: object): any;
|
|
8
|
+
static removeNull(obj: object): any;
|
|
9
|
+
static naturalCompare(a: any, b: any, direction?: string, nullsFirst?: boolean): any;
|
|
10
|
+
/**
|
|
11
|
+
* Return true if two object are equivalent.
|
|
12
|
+
* Objects are considered equivalent if they have the same properties and
|
|
13
|
+
* if all of their properties (first-level only) share the same value.
|
|
14
|
+
* @param obj1 First object
|
|
15
|
+
* @param obj2 Second object
|
|
16
|
+
* @returns Whether two objects arer equivalent
|
|
17
|
+
*/
|
|
18
|
+
static objectsAreEquivalent(obj1: object, obj2: object): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Return a new object with an array of keys removed
|
|
21
|
+
* @param obj Source object
|
|
22
|
+
* @param keys Keys to remove
|
|
23
|
+
* @returns A new object
|
|
24
|
+
*/
|
|
25
|
+
static removeKeys(obj: object, keys: string[]): object;
|
|
26
|
+
}
|
package/lib/strenum.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Utility function to create a K:V from a list of strings */
|
|
2
|
-
export declare function strEnum<T extends string>(o: Array<T>): {
|
|
3
|
-
[K in T]: K;
|
|
4
|
-
};
|
|
1
|
+
/** Utility function to create a K:V from a list of strings */
|
|
2
|
+
export declare function strEnum<T extends string>(o: Array<T>): {
|
|
3
|
+
[K in T]: K;
|
|
4
|
+
};
|
package/lib/string-utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class StringUtils {
|
|
2
|
-
static diff(s1: string, s2: string, p?: number): string;
|
|
3
|
-
private static getMatchingSubstring;
|
|
4
|
-
private static getChanges;
|
|
5
|
-
private static rotateArray;
|
|
6
|
-
}
|
|
1
|
+
export declare class StringUtils {
|
|
2
|
+
static diff(s1: string, s2: string, p?: number): string;
|
|
3
|
+
private static getMatchingSubstring;
|
|
4
|
+
private static getChanges;
|
|
5
|
+
private static rotateArray;
|
|
6
|
+
}
|
package/lib/user-agent.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Bowser from 'bowser';
|
|
2
|
-
export interface UserAgent extends Bowser.Parser.Parser {
|
|
3
|
-
compareVersion: (version: string) => boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare const userAgent: UserAgent;
|
|
1
|
+
import * as Bowser from 'bowser';
|
|
2
|
+
export interface UserAgent extends Bowser.Parser.Parser {
|
|
3
|
+
compareVersion: (version: string) => boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const userAgent: UserAgent;
|
package/lib/uuid.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function S4(): string;
|
|
2
|
-
export declare function uuid(): string;
|
|
1
|
+
export declare function S4(): string;
|
|
2
|
+
export declare function uuid(): string;
|
package/lib/watcher.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Subject, Subscription } from 'rxjs';
|
|
2
|
-
export declare enum SubjectStatus {
|
|
3
|
-
Error = 0,
|
|
4
|
-
Done = 1,
|
|
5
|
-
Working = 2,
|
|
6
|
-
Waiting = 3
|
|
7
|
-
}
|
|
8
|
-
export declare abstract class Watcher {
|
|
9
|
-
status$: Subject<SubjectStatus>;
|
|
10
|
-
protected status$$: Subscription;
|
|
11
|
-
get status(): SubjectStatus;
|
|
12
|
-
set status(value: SubjectStatus);
|
|
13
|
-
private _status;
|
|
14
|
-
protected abstract watch(): any;
|
|
15
|
-
protected abstract unwatch(): any;
|
|
16
|
-
subscribe(callback: Function, scope?: any): void;
|
|
17
|
-
unsubscribe(): void;
|
|
18
|
-
protected handleStatusChange(status: SubjectStatus): void;
|
|
19
|
-
}
|
|
1
|
+
import { Subject, Subscription } from 'rxjs';
|
|
2
|
+
export declare enum SubjectStatus {
|
|
3
|
+
Error = 0,
|
|
4
|
+
Done = 1,
|
|
5
|
+
Working = 2,
|
|
6
|
+
Waiting = 3
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class Watcher {
|
|
9
|
+
status$: Subject<SubjectStatus>;
|
|
10
|
+
protected status$$: Subscription;
|
|
11
|
+
get status(): SubjectStatus;
|
|
12
|
+
set status(value: SubjectStatus);
|
|
13
|
+
private _status;
|
|
14
|
+
protected abstract watch(): any;
|
|
15
|
+
protected abstract unwatch(): any;
|
|
16
|
+
subscribe(callback: Function, scope?: any): void;
|
|
17
|
+
unsubscribe(): void;
|
|
18
|
+
protected handleStatusChange(status: SubjectStatus): void;
|
|
19
|
+
}
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './lib';
|
|
1
|
+
export * from './lib';
|