@furystack/utils 1.2.46 → 2.0.4
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/CHANGELOG.md +76 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/path-helper.d.ts +1 -36
- package/dist/path-helper.d.ts.map +1 -1
- package/dist/path-helper.js +2 -73
- package/dist/path-helper.js.map +1 -1
- package/dist/path-helper.spec.d.ts.map +1 -1
- package/dist/path-helper.spec.js +2 -82
- package/dist/path-helper.spec.js.map +1 -1
- package/dist/value-observer.d.ts +1 -1
- package/dist/value-observer.d.ts.map +1 -1
- package/dist/value-observer.js.map +1 -1
- package/package.json +4 -5
- package/src/index.ts +0 -2
- package/src/path-helper.spec.ts +2 -101
- package/src/path-helper.ts +2 -77
- package/src/value-observer.ts +1 -1
- package/dist/filter-async.d.ts +0 -20
- package/dist/filter-async.d.ts.map +0 -1
- package/dist/filter-async.js +0 -23
- package/dist/filter-async.js.map +0 -1
- package/dist/filter-async.spec.d.ts +0 -2
- package/dist/filter-async.spec.d.ts.map +0 -1
- package/dist/filter-async.spec.js +0 -25
- package/dist/filter-async.spec.js.map +0 -1
- package/dist/retrier-options.d.ts +0 -50
- package/dist/retrier-options.d.ts.map +0 -1
- package/dist/retrier-options.js +0 -54
- package/dist/retrier-options.js.map +0 -1
- package/dist/retrier.d.ts +0 -52
- package/dist/retrier.d.ts.map +0 -1
- package/dist/retrier.js +0 -103
- package/dist/retrier.js.map +0 -1
- package/dist/retries.spec.d.ts +0 -5
- package/dist/retries.spec.d.ts.map +0 -1
- package/dist/retries.spec.js +0 -93
- package/dist/retries.spec.js.map +0 -1
- package/src/filter-async.spec.ts +0 -25
- package/src/filter-async.ts +0 -29
- package/src/retrier-options.ts +0 -65
- package/src/retrier.ts +0 -105
- package/src/retries.spec.ts +0 -98
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
### [2.0.3](https://github.com/furystack/furystack/compare/@furystack/utils@2.0.2...@furystack/utils@2.0.3) (2022-02-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @furystack/utils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [2.0.2](https://github.com/furystack/furystack/compare/@furystack/utils@2.0.0...@furystack/utils@2.0.2) (2022-01-10)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @furystack/utils
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### [2.0.1](https://github.com/furystack/furystack/compare/@furystack/utils@2.0.0...@furystack/utils@2.0.1) (2022-01-10)
|
|
25
|
+
|
|
26
|
+
**Note:** Version bump only for package @furystack/utils
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [2.0.0](https://github.com/furystack/furystack/compare/@furystack/utils@1.2.46...@furystack/utils@2.0.0) (2021-12-08)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### ⚠ BREAKING CHANGES
|
|
37
|
+
|
|
38
|
+
* **@furystack/shades:** Disposable resources on Shade Components (#165)
|
|
39
|
+
|
|
40
|
+
### 🚀 What's new
|
|
41
|
+
|
|
42
|
+
* **@furystack/shades:** Disposable resources on Shade Components ([#165](https://github.com/furystack/furystack/issues/165)) ([8567e7e](https://github.com/furystack/furystack/commit/8567e7e2e01cec232a5f4448dfc0833c1f183229))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### [1.2.46](https://github.com/furystack/furystack/compare/@furystack/utils@1.2.45...@furystack/utils@1.2.46) (2021-11-19)
|
|
48
|
+
|
|
49
|
+
**Note:** Version bump only for package @furystack/utils
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### [1.2.45](https://github.com/furystack/furystack/compare/@furystack/utils@1.2.44...@furystack/utils@1.2.45) (2021-10-05)
|
|
57
|
+
|
|
58
|
+
**Note:** Version bump only for package @furystack/utils
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### [1.2.44](https://github.com/furystack/furystack/compare/@furystack/utils@1.2.14...@furystack/utils@1.2.44) (2021-08-19)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @furystack/utils
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### [1.2.43](https://github.com/furystack/furystack/compare/@furystack/utils@1.2.14...@furystack/utils@1.2.43) (2021-07-30)
|
|
75
|
+
|
|
76
|
+
**Note:** Version bump only for package @furystack/utils
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from './disposable';
|
|
2
2
|
export * from './deep-merge';
|
|
3
|
-
export * from './filter-async';
|
|
4
3
|
export * from './debounce';
|
|
5
4
|
export * from './observable-value';
|
|
6
|
-
export * from './retrier';
|
|
7
5
|
export * from './value-observer';
|
|
8
6
|
export * from './path-helper';
|
|
9
7
|
export * from './sleep-async';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
(0, tslib_1.__exportStar)(require("./disposable"), exports);
|
|
5
5
|
(0, tslib_1.__exportStar)(require("./deep-merge"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./filter-async"), exports);
|
|
7
6
|
(0, tslib_1.__exportStar)(require("./debounce"), exports);
|
|
8
7
|
(0, tslib_1.__exportStar)(require("./observable-value"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./retrier"), exports);
|
|
10
8
|
(0, tslib_1.__exportStar)(require("./value-observer"), exports);
|
|
11
9
|
(0, tslib_1.__exportStar)(require("./path-helper"), exports);
|
|
12
10
|
(0, tslib_1.__exportStar)(require("./sleep-async"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4DAA4B;AAC5B,4DAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4DAA4B;AAC5B,4DAA4B;AAC5B,0DAA0B;AAC1B,kEAAkC;AAClC,gEAAgC;AAChC,6DAA6B;AAC7B,6DAA6B;AAC7B,yDAAyB;AACzB,uDAAuB;AACvB,uDAAuB"}
|
package/dist/path-helper.d.ts
CHANGED
|
@@ -13,47 +13,12 @@ export declare class PathHelper {
|
|
|
13
13
|
static trimSlashes(path: string): string;
|
|
14
14
|
/**
|
|
15
15
|
* Splits a full path into path segments,
|
|
16
|
-
* e.g.: /Root/Example
|
|
16
|
+
* e.g.: /Root/Example/stuff
|
|
17
17
|
*
|
|
18
18
|
* @param path The path to be splitted
|
|
19
19
|
* @returns {string[]} the segments for the path
|
|
20
20
|
*/
|
|
21
21
|
static getSegments(path: string): string[];
|
|
22
|
-
/**
|
|
23
|
-
* Checks if a specific segment is an Item segment or not (like "('Content1')"" or "(654)")
|
|
24
|
-
*
|
|
25
|
-
* @param segment The segment to be examined
|
|
26
|
-
* @returns a boolean value that indicates if the segment is an item segment
|
|
27
|
-
*/
|
|
28
|
-
static isItemSegment(segment: string): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Method that tells if a path is an item path or an item reference path (e.g. contains an Item segment).
|
|
31
|
-
*
|
|
32
|
-
* @param {string} path Path that you want to test.
|
|
33
|
-
* @returns {boolean} Returns if the given path is a path of a Content or not.
|
|
34
|
-
*/
|
|
35
|
-
static isItemPath(path: string): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Returns the full path for a content based on its Id or Path
|
|
38
|
-
*
|
|
39
|
-
* @param {string | number} idOrPath the Id Or Path of the content
|
|
40
|
-
* @returns A full Id or Path-based url of the content (e.g. *'/content(1)'* or *'/Root/Example/('Content')'*)
|
|
41
|
-
*/
|
|
42
|
-
static getContentUrl(idOrPath: string | number): string;
|
|
43
|
-
/**
|
|
44
|
-
* Method that gets the URL that refers to a single item in the Sense/Net Content Repository
|
|
45
|
-
*
|
|
46
|
-
* @param {string} path Path that you want to format.
|
|
47
|
-
* @returns {string} Path in entity format e.g. /workspaces('project') from /workspaces/project
|
|
48
|
-
*/
|
|
49
|
-
static getContentUrlByPath(path: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Method that gets the URL that refers to a single item in the Sense/Net Content Repository by its Id
|
|
52
|
-
*
|
|
53
|
-
* @param id {number} Id of the Content.
|
|
54
|
-
* @returns {string} e.g. /content(123)
|
|
55
|
-
*/
|
|
56
|
-
static getContentUrlbyId(id: number): string;
|
|
57
22
|
/**
|
|
58
23
|
* Method that allows to join paths without multiple or missing slashes
|
|
59
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-helper.d.ts","sourceRoot":"","sources":["../src/path-helper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAU;IACrB;;;;;OAKG;WACW,WAAW,CAAC,IAAI,EAAE,MAAM;IAUtC;;;;;;OAMG;WACW,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"path-helper.d.ts","sourceRoot":"","sources":["../src/path-helper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAU;IACrB;;;;;OAKG;WACW,WAAW,CAAC,IAAI,EAAE,MAAM;IAUtC;;;;;;OAMG;WACW,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIjD;;;;;OAKG;WACW,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIzC;;;;;;OAMG;WACW,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO;IAIjF;;;;;;;;OAQG;WACW,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;WAQnC,SAAS,CAAC,IAAI,EAAE,MAAM;CAGrC"}
|
package/dist/path-helper.js
CHANGED
|
@@ -24,84 +24,13 @@ class PathHelper {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Splits a full path into path segments,
|
|
27
|
-
* e.g.: /Root/Example
|
|
27
|
+
* e.g.: /Root/Example/stuff
|
|
28
28
|
*
|
|
29
29
|
* @param path The path to be splitted
|
|
30
30
|
* @returns {string[]} the segments for the path
|
|
31
31
|
*/
|
|
32
32
|
static getSegments(path) {
|
|
33
|
-
return path
|
|
34
|
-
.split(/\/|[(][']|[(]/g)
|
|
35
|
-
.filter((segment) => segment && segment.length)
|
|
36
|
-
.map((segment) => {
|
|
37
|
-
if (segment.endsWith("')")) {
|
|
38
|
-
segment = `('${segment}`;
|
|
39
|
-
}
|
|
40
|
-
else if (segment.endsWith(')')) {
|
|
41
|
-
segment = `(${segment}`;
|
|
42
|
-
}
|
|
43
|
-
return segment;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Checks if a specific segment is an Item segment or not (like "('Content1')"" or "(654)")
|
|
48
|
-
*
|
|
49
|
-
* @param segment The segment to be examined
|
|
50
|
-
* @returns a boolean value that indicates if the segment is an item segment
|
|
51
|
-
*/
|
|
52
|
-
static isItemSegment(segment) {
|
|
53
|
-
return RegExp(/^\('+[\s\S]+'\)$/).test(segment) || RegExp(/^\(+\d+\)$/).test(segment);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Method that tells if a path is an item path or an item reference path (e.g. contains an Item segment).
|
|
57
|
-
*
|
|
58
|
-
* @param {string} path Path that you want to test.
|
|
59
|
-
* @returns {boolean} Returns if the given path is a path of a Content or not.
|
|
60
|
-
*/
|
|
61
|
-
static isItemPath(path) {
|
|
62
|
-
const segments = this.getSegments(path);
|
|
63
|
-
const itemSegment = segments.find((s) => this.isItemSegment(s));
|
|
64
|
-
return itemSegment && itemSegment.length ? true : false;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Returns the full path for a content based on its Id or Path
|
|
68
|
-
*
|
|
69
|
-
* @param {string | number} idOrPath the Id Or Path of the content
|
|
70
|
-
* @returns A full Id or Path-based url of the content (e.g. *'/content(1)'* or *'/Root/Example/('Content')'*)
|
|
71
|
-
*/
|
|
72
|
-
static getContentUrl(idOrPath) {
|
|
73
|
-
const parsed = parseInt(idOrPath, 10);
|
|
74
|
-
if (isNaN(parsed)) {
|
|
75
|
-
return this.getContentUrlByPath(idOrPath.toString());
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return this.getContentUrlbyId(parsed);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Method that gets the URL that refers to a single item in the Sense/Net Content Repository
|
|
83
|
-
*
|
|
84
|
-
* @param {string} path Path that you want to format.
|
|
85
|
-
* @returns {string} Path in entity format e.g. /workspaces('project') from /workspaces/project
|
|
86
|
-
*/
|
|
87
|
-
static getContentUrlByPath(path) {
|
|
88
|
-
if (!path) {
|
|
89
|
-
throw Error('Path is empty');
|
|
90
|
-
}
|
|
91
|
-
const segments = this.getSegments(path);
|
|
92
|
-
if (!this.isItemPath(path)) {
|
|
93
|
-
segments[segments.length - 1] = `('${segments[segments.length - 1]}')`;
|
|
94
|
-
}
|
|
95
|
-
return segments.join('/');
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Method that gets the URL that refers to a single item in the Sense/Net Content Repository by its Id
|
|
99
|
-
*
|
|
100
|
-
* @param id {number} Id of the Content.
|
|
101
|
-
* @returns {string} e.g. /content(123)
|
|
102
|
-
*/
|
|
103
|
-
static getContentUrlbyId(id) {
|
|
104
|
-
return `content(${id})`;
|
|
33
|
+
return path.split('/').filter((segment) => segment && segment.length);
|
|
105
34
|
}
|
|
106
35
|
/**
|
|
107
36
|
* Method that allows to join paths without multiple or missing slashes
|
package/dist/path-helper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-helper.js","sourceRoot":"","sources":["../src/path-helper.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,UAAU;IACrB;;;;;OAKG;IACI,MAAM,CAAC,WAAW,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACzB,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;SAC1C;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAC3B,IAAI,GAAG,IAAI,C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;;;OAQG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACvC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,QAAQ,CAAC,GAAG,EAAE,CAAA;SACf;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,IAAY;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,CAAC;CACF;AArED,gCAqEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-helper.spec.d.ts","sourceRoot":"","sources":["../src/path-helper.spec.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"path-helper.spec.d.ts","sourceRoot":"","sources":["../src/path-helper.spec.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,eAAe,MAiE1B,CAAA"}
|
package/dist/path-helper.spec.js
CHANGED
|
@@ -6,26 +6,6 @@ const path_helper_1 = require("./path-helper");
|
|
|
6
6
|
* Path Helper tests
|
|
7
7
|
*/
|
|
8
8
|
exports.pathHelperTests = describe('PathHelper', () => {
|
|
9
|
-
describe('#isItemSegment()', () => {
|
|
10
|
-
it('Should return true for item segments with string key "(\'Item1\')"', () => {
|
|
11
|
-
expect(path_helper_1.PathHelper.isItemSegment("('Item1')")).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
it('Should return true for item segments with numeric key "(42)"', () => {
|
|
14
|
-
expect(path_helper_1.PathHelper.isItemSegment('(42)')).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
it('Should return false for string keys w/o quotes', () => {
|
|
17
|
-
expect(path_helper_1.PathHelper.isItemSegment('(invalidValue)')).toBe(false);
|
|
18
|
-
});
|
|
19
|
-
it('Should return false for invalid string keys', () => {
|
|
20
|
-
expect(path_helper_1.PathHelper.isItemSegment('(123invalidValue)')).toBe(false);
|
|
21
|
-
});
|
|
22
|
-
it('Should return false for non-item segments', () => {
|
|
23
|
-
expect(path_helper_1.PathHelper.isItemSegment('Item1')).toBe(false);
|
|
24
|
-
});
|
|
25
|
-
it('Should return false for inconsistent quotation', () => {
|
|
26
|
-
expect(path_helper_1.PathHelper.isItemSegment("('123invalidValue)")).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
9
|
describe('#trimSlashes()', () => {
|
|
30
10
|
it('should trim from the beginning of the segment', () => {
|
|
31
11
|
expect(path_helper_1.PathHelper.trimSlashes('/segment')).toBe('segment');
|
|
@@ -40,63 +20,6 @@ exports.pathHelperTests = describe('PathHelper', () => {
|
|
|
40
20
|
expect(path_helper_1.PathHelper.trimSlashes('segment///')).toBe('segment');
|
|
41
21
|
});
|
|
42
22
|
});
|
|
43
|
-
describe('#isItemPath()', () => {
|
|
44
|
-
it('should return true for item paths', () => {
|
|
45
|
-
const isAnItem = path_helper_1.PathHelper.isItemPath("/workspace('project')");
|
|
46
|
-
expect(isAnItem).toBe(true);
|
|
47
|
-
});
|
|
48
|
-
it('should return false for collection paths', () => {
|
|
49
|
-
const isNotAnItem = path_helper_1.PathHelper.isItemPath('/workspace/project');
|
|
50
|
-
expect(isNotAnItem).toBe(false);
|
|
51
|
-
});
|
|
52
|
-
it('should return true for reference paths', () => {
|
|
53
|
-
const isAnItem = path_helper_1.PathHelper.isItemPath("/workspace/('project')/CustomAction");
|
|
54
|
-
expect(isAnItem).toBe(true);
|
|
55
|
-
});
|
|
56
|
-
it('should return true for reference paths with ids', () => {
|
|
57
|
-
const isAnItem = path_helper_1.PathHelper.isItemPath('/workspaces/(22)/CustomAction');
|
|
58
|
-
expect(isAnItem).toBe(true);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
describe('#getContentUrlbyId()', () => {
|
|
62
|
-
it('should return by path if the provided value is a path', () => {
|
|
63
|
-
const url = path_helper_1.PathHelper.getContentUrl('/workspace/project');
|
|
64
|
-
expect(url).toBe("workspace/('project')");
|
|
65
|
-
});
|
|
66
|
-
it('should return by id if the provided value is id', () => {
|
|
67
|
-
const contentUrl = path_helper_1.PathHelper.getContentUrl(1);
|
|
68
|
-
expect(contentUrl).toBe('content(1)');
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
describe('#getContentUrlbyId()', () => {
|
|
72
|
-
it('should create the path with the correct format', () => {
|
|
73
|
-
const contentUrl = path_helper_1.PathHelper.getContentUrlbyId(1);
|
|
74
|
-
expect(contentUrl).toBe('content(1)');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
describe('#getContentUrlByPath()', () => {
|
|
78
|
-
it('should return a proper item path by the given path', () => {
|
|
79
|
-
const contentUrl = path_helper_1.PathHelper.getContentUrlByPath('/workspace/project');
|
|
80
|
-
expect(contentUrl).toBe("workspace/('project')");
|
|
81
|
-
});
|
|
82
|
-
it('should return the path itself if it is an item path already', () => {
|
|
83
|
-
const contentUrl = path_helper_1.PathHelper.getContentUrlByPath("/workspace('project')");
|
|
84
|
-
expect(contentUrl).toBe("workspace/('project')");
|
|
85
|
-
});
|
|
86
|
-
it('should return the path itself for reference paths', () => {
|
|
87
|
-
const contentUrl = path_helper_1.PathHelper.getContentUrlByPath("/workspace('project')/Owner");
|
|
88
|
-
expect(contentUrl).toBe("workspace/('project')/Owner");
|
|
89
|
-
});
|
|
90
|
-
it('should return an error message if the given argument is an empty string', () => {
|
|
91
|
-
expect(() => {
|
|
92
|
-
path_helper_1.PathHelper.getContentUrlByPath('');
|
|
93
|
-
}).toThrow();
|
|
94
|
-
});
|
|
95
|
-
it('should return a proper item path for Root only', () => {
|
|
96
|
-
const path = path_helper_1.PathHelper.getContentUrlByPath('/Root');
|
|
97
|
-
expect(path).toBe("('Root')");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
23
|
describe('#joinPaths()', () => {
|
|
101
24
|
it('should join with slashes', () => {
|
|
102
25
|
const joined = path_helper_1.PathHelper.joinPaths('path1', 'path2', 'path3');
|
|
@@ -124,16 +47,13 @@ exports.pathHelperTests = describe('PathHelper', () => {
|
|
|
124
47
|
});
|
|
125
48
|
describe('#getSegments()', () => {
|
|
126
49
|
it('Should split the path to segments', () => {
|
|
127
|
-
expect(path_helper_1.PathHelper.getSegments("Root/Example('Content1')")).toEqual(['Root', 'Example', "('Content1')"]);
|
|
50
|
+
expect(path_helper_1.PathHelper.getSegments("Root/Example/('Content1')")).toEqual(['Root', 'Example', "('Content1')"]);
|
|
128
51
|
});
|
|
129
52
|
});
|
|
130
53
|
describe('#getParentPath()', () => {
|
|
131
|
-
it('Should return the parent path
|
|
54
|
+
it('Should return the parent path', () => {
|
|
132
55
|
expect(path_helper_1.PathHelper.getParentPath('Root/Example/Content')).toBe('Root/Example');
|
|
133
56
|
});
|
|
134
|
-
it('Should return the parent path in case of more than 1 segments with item path', () => {
|
|
135
|
-
expect(path_helper_1.PathHelper.getParentPath("Root/Example('Content')")).toBe('Root/Example');
|
|
136
|
-
});
|
|
137
57
|
it('Should return the path in case of 1 segments', () => {
|
|
138
58
|
expect(path_helper_1.PathHelper.getParentPath('Root')).toBe('Root');
|
|
139
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-helper.spec.js","sourceRoot":"","sources":["../src/path-helper.spec.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE1C;;GAEG;AACU,QAAA,eAAe,GAAG,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACzD,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"path-helper.spec.js","sourceRoot":"","sources":["../src/path-helper.spec.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE1C;;GAEG;AACU,QAAA,eAAe,GAAG,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACzD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAA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AAU,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC/E,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;YACtD,MAAM,CAAC,wBAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/value-observer.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { ObservableValue, ValueChangeCallback } from './observable-value';
|
|
|
24
24
|
* @param T This type parameter is the value type to observe
|
|
25
25
|
*/
|
|
26
26
|
export declare class ValueObserver<T> implements Disposable {
|
|
27
|
-
|
|
27
|
+
readonly observable: ObservableValue<T>;
|
|
28
28
|
callback: ValueChangeCallback<T>;
|
|
29
29
|
/**
|
|
30
30
|
* Disposes the ValueObserver instance. Unsubscribes from the observable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-observer.d.ts","sourceRoot":"","sources":["../src/value-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,UAAU;
|
|
1
|
+
{"version":3,"file":"value-observer.d.ts","sourceRoot":"","sources":["../src/value-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,UAAU;aAarB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC;IAAS,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAZnG;;OAEG;IACI,OAAO;IAId;;;;OAIG;gBACyB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAS,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC;CACpG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-observer.js","sourceRoot":"","sources":["../src/value-observer.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,aAAa;IAQxB;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"value-observer.js","sourceRoot":"","sources":["../src/value-observer.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,aAAa;IAQxB;;;;OAIG;IACH,YAA4B,UAA8B,EAAS,QAAgC;QAAvE,eAAU,GAAV,UAAU,CAAoB;QAAS,aAAQ,GAAR,QAAQ,CAAwB;IAAG,CAAC;IAZvG;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;CAQF;AAdD,sCAcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furystack/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "General utilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/furystack/furystack",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/jest": "^27.0
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}
|
|
37
|
+
"@types/jest": "^27.4.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from './disposable'
|
|
2
2
|
export * from './deep-merge'
|
|
3
|
-
export * from './filter-async'
|
|
4
3
|
export * from './debounce'
|
|
5
4
|
export * from './observable-value'
|
|
6
|
-
export * from './retrier'
|
|
7
5
|
export * from './value-observer'
|
|
8
6
|
export * from './path-helper'
|
|
9
7
|
export * from './sleep-async'
|
package/src/path-helper.spec.ts
CHANGED
|
@@ -4,32 +4,6 @@ import { PathHelper } from './path-helper'
|
|
|
4
4
|
* Path Helper tests
|
|
5
5
|
*/
|
|
6
6
|
export const pathHelperTests = describe('PathHelper', () => {
|
|
7
|
-
describe('#isItemSegment()', () => {
|
|
8
|
-
it('Should return true for item segments with string key "(\'Item1\')"', () => {
|
|
9
|
-
expect(PathHelper.isItemSegment("('Item1')")).toBe(true)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
it('Should return true for item segments with numeric key "(42)"', () => {
|
|
13
|
-
expect(PathHelper.isItemSegment('(42)')).toBe(true)
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
it('Should return false for string keys w/o quotes', () => {
|
|
17
|
-
expect(PathHelper.isItemSegment('(invalidValue)')).toBe(false)
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('Should return false for invalid string keys', () => {
|
|
21
|
-
expect(PathHelper.isItemSegment('(123invalidValue)')).toBe(false)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('Should return false for non-item segments', () => {
|
|
25
|
-
expect(PathHelper.isItemSegment('Item1')).toBe(false)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('Should return false for inconsistent quotation', () => {
|
|
29
|
-
expect(PathHelper.isItemSegment("('123invalidValue)")).toBe(false)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
|
|
33
7
|
describe('#trimSlashes()', () => {
|
|
34
8
|
it('should trim from the beginning of the segment', () => {
|
|
35
9
|
expect(PathHelper.trimSlashes('/segment')).toBe('segment')
|
|
@@ -48,75 +22,6 @@ export const pathHelperTests = describe('PathHelper', () => {
|
|
|
48
22
|
})
|
|
49
23
|
})
|
|
50
24
|
|
|
51
|
-
describe('#isItemPath()', () => {
|
|
52
|
-
it('should return true for item paths', () => {
|
|
53
|
-
const isAnItem = PathHelper.isItemPath("/workspace('project')")
|
|
54
|
-
expect(isAnItem).toBe(true)
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('should return false for collection paths', () => {
|
|
58
|
-
const isNotAnItem = PathHelper.isItemPath('/workspace/project')
|
|
59
|
-
expect(isNotAnItem).toBe(false)
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
it('should return true for reference paths', () => {
|
|
63
|
-
const isAnItem = PathHelper.isItemPath("/workspace/('project')/CustomAction")
|
|
64
|
-
expect(isAnItem).toBe(true)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
it('should return true for reference paths with ids', () => {
|
|
68
|
-
const isAnItem = PathHelper.isItemPath('/workspaces/(22)/CustomAction')
|
|
69
|
-
expect(isAnItem).toBe(true)
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
describe('#getContentUrlbyId()', () => {
|
|
74
|
-
it('should return by path if the provided value is a path', () => {
|
|
75
|
-
const url = PathHelper.getContentUrl('/workspace/project')
|
|
76
|
-
expect(url).toBe("workspace/('project')")
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
it('should return by id if the provided value is id', () => {
|
|
80
|
-
const contentUrl = PathHelper.getContentUrl(1)
|
|
81
|
-
expect(contentUrl).toBe('content(1)')
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
describe('#getContentUrlbyId()', () => {
|
|
86
|
-
it('should create the path with the correct format', () => {
|
|
87
|
-
const contentUrl = PathHelper.getContentUrlbyId(1)
|
|
88
|
-
expect(contentUrl).toBe('content(1)')
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
describe('#getContentUrlByPath()', () => {
|
|
93
|
-
it('should return a proper item path by the given path', () => {
|
|
94
|
-
const contentUrl = PathHelper.getContentUrlByPath('/workspace/project')
|
|
95
|
-
expect(contentUrl).toBe("workspace/('project')")
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
it('should return the path itself if it is an item path already', () => {
|
|
99
|
-
const contentUrl = PathHelper.getContentUrlByPath("/workspace('project')")
|
|
100
|
-
expect(contentUrl).toBe("workspace/('project')")
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
it('should return the path itself for reference paths', () => {
|
|
104
|
-
const contentUrl = PathHelper.getContentUrlByPath("/workspace('project')/Owner")
|
|
105
|
-
expect(contentUrl).toBe("workspace/('project')/Owner")
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
it('should return an error message if the given argument is an empty string', () => {
|
|
109
|
-
expect(() => {
|
|
110
|
-
PathHelper.getContentUrlByPath('')
|
|
111
|
-
}).toThrow()
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
it('should return a proper item path for Root only', () => {
|
|
115
|
-
const path = PathHelper.getContentUrlByPath('/Root')
|
|
116
|
-
expect(path).toBe("('Root')")
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
|
|
120
25
|
describe('#joinPaths()', () => {
|
|
121
26
|
it('should join with slashes', () => {
|
|
122
27
|
const joined = PathHelper.joinPaths('path1', 'path2', 'path3')
|
|
@@ -150,19 +55,15 @@ export const pathHelperTests = describe('PathHelper', () => {
|
|
|
150
55
|
|
|
151
56
|
describe('#getSegments()', () => {
|
|
152
57
|
it('Should split the path to segments', () => {
|
|
153
|
-
expect(PathHelper.getSegments("Root/Example('Content1')")).toEqual(['Root', 'Example', "('Content1')"])
|
|
58
|
+
expect(PathHelper.getSegments("Root/Example/('Content1')")).toEqual(['Root', 'Example', "('Content1')"])
|
|
154
59
|
})
|
|
155
60
|
})
|
|
156
61
|
|
|
157
62
|
describe('#getParentPath()', () => {
|
|
158
|
-
it('Should return the parent path
|
|
63
|
+
it('Should return the parent path', () => {
|
|
159
64
|
expect(PathHelper.getParentPath('Root/Example/Content')).toBe('Root/Example')
|
|
160
65
|
})
|
|
161
66
|
|
|
162
|
-
it('Should return the parent path in case of more than 1 segments with item path', () => {
|
|
163
|
-
expect(PathHelper.getParentPath("Root/Example('Content')")).toBe('Root/Example')
|
|
164
|
-
})
|
|
165
|
-
|
|
166
67
|
it('Should return the path in case of 1 segments', () => {
|
|
167
68
|
expect(PathHelper.getParentPath('Root')).toBe('Root')
|
|
168
69
|
})
|