@furystack/utils 3.1.8 → 4.0.1

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.
Files changed (107) hide show
  1. package/{dist → esm}/debounce.js +1 -5
  2. package/esm/debounce.js.map +1 -0
  3. package/{dist → esm}/deep-merge.js +2 -7
  4. package/esm/deep-merge.js.map +1 -0
  5. package/{dist → esm}/disposable.js +2 -9
  6. package/esm/disposable.js.map +1 -0
  7. package/esm/index.js +11 -0
  8. package/esm/index.js.map +1 -0
  9. package/{dist → esm}/observable-value.js +5 -16
  10. package/esm/observable-value.js.map +1 -0
  11. package/{dist → esm}/path-helper.js +1 -10
  12. package/esm/path-helper.js.map +1 -0
  13. package/esm/sleep-async.js +8 -0
  14. package/esm/sleep-async.js.map +1 -0
  15. package/esm/sort-by.js +15 -0
  16. package/esm/sort-by.js.map +1 -0
  17. package/{dist → esm}/trace.js +5 -9
  18. package/esm/trace.js.map +1 -0
  19. package/esm/tuple.js +7 -0
  20. package/esm/tuple.js.map +1 -0
  21. package/{dist → esm}/value-observer.js +2 -7
  22. package/esm/value-observer.js.map +1 -0
  23. package/package.json +22 -9
  24. package/src/debounce.spec.ts +20 -17
  25. package/src/deep-merge.spec.ts +1 -0
  26. package/src/deep-merge.ts +0 -1
  27. package/src/disposable.spec.ts +23 -15
  28. package/src/disposable.ts +0 -2
  29. package/src/observable-value.spec.ts +36 -19
  30. package/src/observable-value.ts +1 -7
  31. package/src/path-helper.spec.ts +1 -0
  32. package/src/path-helper.ts +0 -5
  33. package/src/sleep-async.spec.ts +1 -0
  34. package/src/sleep-async.ts +0 -1
  35. package/src/sort-by.spec.ts +1 -0
  36. package/src/trace.spec.ts +48 -26
  37. package/src/trace.ts +0 -1
  38. package/src/tuple.spec.ts +1 -0
  39. package/src/tuple.ts +0 -1
  40. package/src/value-observer.ts +1 -2
  41. package/types/deep-merge.d.ts +0 -1
  42. package/types/deep-merge.d.ts.map +1 -1
  43. package/types/disposable.d.ts +0 -2
  44. package/types/disposable.d.ts.map +1 -1
  45. package/types/observable-value.d.ts +1 -7
  46. package/types/observable-value.d.ts.map +1 -1
  47. package/types/path-helper.d.ts +0 -5
  48. package/types/path-helper.d.ts.map +1 -1
  49. package/types/sleep-async.d.ts +0 -1
  50. package/types/sleep-async.d.ts.map +1 -1
  51. package/types/trace.d.ts +0 -1
  52. package/types/trace.d.ts.map +1 -1
  53. package/types/tuple.d.ts +0 -1
  54. package/types/tuple.d.ts.map +1 -1
  55. package/types/value-observer.d.ts +1 -2
  56. package/types/value-observer.d.ts.map +1 -1
  57. package/dist/debounce.js.map +0 -1
  58. package/dist/debounce.spec.js +0 -40
  59. package/dist/debounce.spec.js.map +0 -1
  60. package/dist/deep-merge.js.map +0 -1
  61. package/dist/deep-merge.spec.js +0 -31
  62. package/dist/deep-merge.spec.js.map +0 -1
  63. package/dist/disposable.js.map +0 -1
  64. package/dist/disposable.spec.js +0 -112
  65. package/dist/disposable.spec.js.map +0 -1
  66. package/dist/index.js +0 -27
  67. package/dist/index.js.map +0 -1
  68. package/dist/observable-value.js.map +0 -1
  69. package/dist/observable-value.spec.js +0 -116
  70. package/dist/observable-value.spec.js.map +0 -1
  71. package/dist/path-helper.js.map +0 -1
  72. package/dist/path-helper.spec.js +0 -62
  73. package/dist/path-helper.spec.js.map +0 -1
  74. package/dist/sleep-async.js +0 -13
  75. package/dist/sleep-async.js.map +0 -1
  76. package/dist/sleep-async.spec.js +0 -16
  77. package/dist/sleep-async.spec.js.map +0 -1
  78. package/dist/sort-by.js +0 -19
  79. package/dist/sort-by.js.map +0 -1
  80. package/dist/sort-by.spec.js +0 -22
  81. package/dist/sort-by.spec.js.map +0 -1
  82. package/dist/trace.js.map +0 -1
  83. package/dist/trace.spec.js +0 -169
  84. package/dist/trace.spec.js.map +0 -1
  85. package/dist/tuple.js +0 -12
  86. package/dist/tuple.js.map +0 -1
  87. package/dist/tuple.spec.js +0 -9
  88. package/dist/tuple.spec.js.map +0 -1
  89. package/dist/value-observer.js.map +0 -1
  90. package/types/debounce.spec.d.ts +0 -5
  91. package/types/debounce.spec.d.ts.map +0 -1
  92. package/types/deep-merge.spec.d.ts +0 -2
  93. package/types/deep-merge.spec.d.ts.map +0 -1
  94. package/types/disposable.spec.d.ts +0 -22
  95. package/types/disposable.spec.d.ts.map +0 -1
  96. package/types/observable-value.spec.d.ts +0 -5
  97. package/types/observable-value.spec.d.ts.map +0 -1
  98. package/types/path-helper.spec.d.ts +0 -5
  99. package/types/path-helper.spec.d.ts.map +0 -1
  100. package/types/sleep-async.spec.d.ts +0 -5
  101. package/types/sleep-async.spec.d.ts.map +0 -1
  102. package/types/sort-by.spec.d.ts +0 -2
  103. package/types/sort-by.spec.d.ts.map +0 -1
  104. package/types/trace.spec.d.ts +0 -2
  105. package/types/trace.spec.d.ts.map +0 -1
  106. package/types/tuple.spec.d.ts +0 -2
  107. package/types/tuple.spec.d.ts.map +0 -1
@@ -1,64 +1,77 @@
1
+ import { describe, it, expect, vi } from 'vitest'
1
2
  import { ObservableValue } from './observable-value'
2
3
 
3
4
  /**
4
5
  * Observable Value tests
5
6
  */
6
7
  export const observableTests = describe('Observable', () => {
7
- it('should be constructed without initial value', (done) => {
8
+ it('should be constructed without initial value', () => {
8
9
  const v = new ObservableValue()
10
+ const doneCallback = vi.fn()
9
11
  v.subscribe(() => {
10
12
  expect(v.getValue()).toBe(undefined)
11
- done()
13
+ doneCallback()
12
14
  }, true)
13
15
  expect(v).toBeInstanceOf(ObservableValue)
16
+ expect(doneCallback).toBeCalled()
14
17
  })
15
18
 
16
- it('should be constructed with initial value', (done) => {
19
+ it('should be constructed with initial value', () => {
17
20
  const v = new ObservableValue(1)
21
+ const doneCallback = vi.fn()
22
+
18
23
  v.subscribe(() => {
19
24
  expect(v.getValue()).toBe(1)
20
- done()
25
+ doneCallback()
21
26
  }, true)
27
+ expect(doneCallback).toBeCalled()
22
28
  })
23
29
 
24
30
  describe('Subscription callback', () => {
25
- it('should be triggered only when a value is changed', (done) => {
31
+ it('should be triggered only when a value is changed', () => {
26
32
  const v = new ObservableValue(1)
33
+ const doneCallback = vi.fn()
34
+
27
35
  v.subscribe(() => {
28
36
  expect(v.getValue()).toBe(2)
29
- done()
37
+ doneCallback()
30
38
  }, false)
31
39
  v.setValue(1)
32
40
  v.setValue(1)
33
41
  v.setValue(2)
42
+ expect(doneCallback).toBeCalledTimes(1)
34
43
  })
35
44
 
36
- it('should be triggered only on change when getLast is false', (done) => {
45
+ it('should be triggered only on change when getLast is false', () => {
37
46
  const v = new ObservableValue(1)
47
+ const doneCallback = vi.fn()
48
+
38
49
  v.subscribe((value) => {
39
50
  expect(value).toBe(2)
40
- done()
51
+ doneCallback()
41
52
  }, false)
42
53
  v.setValue(2)
54
+ expect(doneCallback).toBeCalledTimes(1)
43
55
  })
44
56
  })
45
57
 
46
58
  describe('Unsubscribe', () => {
47
- it('should remove the subscription on unsubscribe()', (done) => {
48
- const callback1 = () => {
49
- done(Error('Shouldnt be triggered'))
50
- }
59
+ it('should remove the subscription on unsubscribe()', () => {
60
+ const shouldNotCall = vi.fn()
51
61
 
52
- const callback2 = (value: number) => {
62
+ const doneCallback = vi.fn((value: number) => {
53
63
  expect(value).toBe(2)
54
- done()
55
- }
64
+ })
65
+
56
66
  const v = new ObservableValue(1)
57
- const observer1 = v.subscribe(callback1)
58
- v.subscribe(callback2)
67
+ const observer1 = v.subscribe(shouldNotCall)
68
+ v.subscribe(doneCallback)
59
69
 
60
70
  v.unsubscribe(observer1)
61
71
  v.setValue(2)
72
+
73
+ expect(doneCallback).toBeCalledTimes(1)
74
+ expect(shouldNotCall).not.toBeCalled()
62
75
  })
63
76
 
64
77
  it('should remove the subscription on Observable dispose', () => {
@@ -109,10 +122,12 @@ export const observableTests = describe('Observable', () => {
109
122
  ).toThrowError('Observable already disposed')
110
123
  })
111
124
 
112
- it('should remove the subscription only from the disposed Observer', (done) => {
125
+ it('should remove the subscription only from the disposed Observer', () => {
126
+ const doneCallback = vi.fn()
127
+
113
128
  class Alma {
114
129
  public Callback() {
115
- done()
130
+ doneCallback()
116
131
  }
117
132
  }
118
133
  const v = new ObservableValue(1)
@@ -122,6 +137,8 @@ export const observableTests = describe('Observable', () => {
122
137
  observer.dispose()
123
138
  expect(v.getObservers().length).toBe(1)
124
139
  v.setValue(3)
140
+
141
+ expect(doneCallback).toBeCalledTimes(1)
125
142
  })
126
143
  })
127
144
  })
@@ -24,7 +24,7 @@ export type ValueChangeCallback<T> = (next: T) => void
24
24
  * ```ts
25
25
  * const observableValue = new ObservableValue<number>(0);
26
26
  * const observer = observableValue.subscribe((newValue) => {
27
- * console.log("Value changed:", newValue);
27
+ * console.log("Value changed:", newValue);
28
28
  * });
29
29
  * // To update the value
30
30
  * observableValue.setValue(Math.random());
@@ -33,7 +33,6 @@ export type ValueChangeCallback<T> = (next: T) => void
33
33
  * // if you want to dispose the whole observableValue with all of its observers:
34
34
  * observableValue.dispose();
35
35
  * ```
36
- *
37
36
  * @param T Generic argument to indicate the value type
38
37
  */
39
38
  export class ObservableValue<T> implements Disposable {
@@ -55,7 +54,6 @@ export class ObservableValue<T> implements Disposable {
55
54
 
56
55
  /**
57
56
  * Subscribes to a value changes
58
- *
59
57
  * @param callback The callback method that will be called on each change
60
58
  * @param getLast Will call the callback with the last known value right after subscription
61
59
  * @returns The ValueObserver instance
@@ -74,7 +72,6 @@ export class ObservableValue<T> implements Disposable {
74
72
 
75
73
  /**
76
74
  * The observer will unsubscribe from the Observable
77
- *
78
75
  * @param observer The ValueObserver instance
79
76
  * @returns if unsubscribing was successfull
80
77
  */
@@ -84,7 +81,6 @@ export class ObservableValue<T> implements Disposable {
84
81
 
85
82
  /**
86
83
  * Gets the current Value
87
- *
88
84
  * @returns The current value
89
85
  */
90
86
  public getValue(): T {
@@ -96,7 +92,6 @@ export class ObservableValue<T> implements Disposable {
96
92
 
97
93
  /**
98
94
  * Sets a new value and notifies the observers.
99
- *
100
95
  * @param newValue The new value to be set
101
96
  */
102
97
  public setValue(newValue: T) {
@@ -113,7 +108,6 @@ export class ObservableValue<T> implements Disposable {
113
108
 
114
109
  /**
115
110
  * Gets the observers
116
- *
117
111
  * @returns The subscribed observers
118
112
  */
119
113
  public getObservers() {
@@ -1,3 +1,4 @@
1
+ import { describe, it, expect } from 'vitest'
1
2
  import { PathHelper } from './path-helper'
2
3
 
3
4
  /**
@@ -6,7 +6,6 @@
6
6
  export class PathHelper {
7
7
  /**
8
8
  * Trims the slash characters from the beginning and from the end of the path to avoid duplicated slashes
9
- *
10
9
  * @param {string} path The source path that should be trimmed
11
10
  * @returns the trimmed path
12
11
  */
@@ -23,7 +22,6 @@ export class PathHelper {
23
22
  /**
24
23
  * Splits a full path into path segments,
25
24
  * e.g.: /Root/Example/stuff
26
- *
27
25
  * @param path The path to be splitted
28
26
  * @returns {string[]} the segments for the path
29
27
  */
@@ -33,7 +31,6 @@ export class PathHelper {
33
31
 
34
32
  /**
35
33
  * Method that allows to join paths without multiple or missing slashes
36
- *
37
34
  * @param args The list of the paths to join
38
35
  * @returns the joined path string
39
36
  */
@@ -43,7 +40,6 @@ export class PathHelper {
43
40
 
44
41
  /**
45
42
  * Checks if the ancestorPath is really the ancestor of the descendantPath
46
- *
47
43
  * @param {string} ancestorPath the ancestor path
48
44
  * @param {string} descendantPath the descendant path
49
45
  * @returns {boolean} if the provided path is the ancestor of the descendant
@@ -57,7 +53,6 @@ export class PathHelper {
57
53
  * e.g. "/Root/Example/Content" will return "/Root/Example"
58
54
  *
59
55
  * "Root" will always return "Root"
60
- *
61
56
  * @param path The content path
62
57
  * @returns the parent path
63
58
  */
@@ -1,3 +1,4 @@
1
+ import { describe, it, expect } from 'vitest'
1
2
  import { sleepAsync } from './sleep-async'
2
3
 
3
4
  /**
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Returns a simple promise that will be resolved within a discrete timeout
3
- *
4
3
  * @param timeout The timeout in millisecs
5
4
  */
6
5
  export const sleepAsync = (timeout = 250) =>
@@ -1,3 +1,4 @@
1
+ import { describe, it, expect } from 'vitest'
1
2
  import './sort-by'
2
3
  describe('sortBy', () => {
3
4
  it('Should sort by ascending by default', () => {
package/src/trace.spec.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { describe, it, expect, vi } from 'vitest'
1
2
  import { Trace } from './trace'
2
3
 
3
4
  class MockClass {
@@ -30,22 +31,25 @@ class MockClass {
30
31
 
31
32
  export const traceTests = describe('Trace tests', () => {
32
33
  describe('Static method traces', () => {
33
- it('Static Methods call should be traced with args', (done) => {
34
+ it('Static Methods call should be traced with args', () => {
34
35
  const args = [1, 2, 3]
36
+ const doneCallback = vi.fn()
35
37
  const observer = Trace.method({
36
38
  object: MockClass,
37
39
  method: MockClass.addStatic,
38
40
  onCalled: (traceData) => {
39
41
  expect(args).toEqual(traceData.methodArguments)
40
42
  observer.dispose()
41
- done()
43
+ doneCallback()
42
44
  },
43
45
  })
44
46
  MockClass.addStatic(...args)
47
+ expect(doneCallback).toBeCalled()
45
48
  })
46
49
 
47
- it('Static Methods call should be traced with args and return value', (done) => {
50
+ it('Static Methods call should be traced with args and return value', () => {
48
51
  const args = [1, 2, 3]
52
+ const doneCallback = vi.fn()
49
53
  const observer = Trace.method({
50
54
  object: MockClass,
51
55
  method: MockClass.addStatic,
@@ -53,19 +57,23 @@ export const traceTests = describe('Trace tests', () => {
53
57
  expect(args).toEqual(traceData.methodArguments)
54
58
  expect(traceData.returned).toBe(1 + 2 + 3)
55
59
  observer.dispose()
56
- done()
60
+ doneCallback()
57
61
  },
58
62
  })
59
63
  MockClass.addStatic(...args)
64
+ expect(doneCallback).toBeCalled()
60
65
  })
61
66
 
62
- it("shouldn't be triggered after observer is disposed", (done) => {
67
+ it("shouldn't be triggered after observer is disposed", () => {
63
68
  const args = [1, 2, 3]
69
+ const shouldNotCall = vi.fn()
70
+ const doneCallback = vi.fn()
71
+
64
72
  const observer = Trace.method({
65
73
  object: MockClass,
66
74
  method: MockClass.addStatic,
67
75
  onCalled: () => {
68
- done("Shouldn't be triggered here")
76
+ shouldNotCall("Shouldn't be triggered here")
69
77
  },
70
78
  })
71
79
  const observer2 = Trace.method({
@@ -73,19 +81,23 @@ export const traceTests = describe('Trace tests', () => {
73
81
  method: MockClass.addStatic,
74
82
  onCalled: () => {
75
83
  observer2.dispose()
76
- done()
84
+ doneCallback()
77
85
  },
78
86
  })
79
87
  observer.dispose()
80
88
  const returned = MockClass.addStatic(...args)
81
89
  expect(returned).toEqual(1 + 2 + 3)
90
+ expect(doneCallback).toBeCalled()
91
+ expect(shouldNotCall).not.toBeCalled()
82
92
  })
83
93
  })
84
94
 
85
95
  describe('Instance method traces', () => {
86
- it('should be traced with arguments', (done) => {
96
+ it('should be traced with arguments', () => {
87
97
  const instance = new MockClass()
88
98
  const args = [1, 2, 3]
99
+ const doneCallback = vi.fn()
100
+
89
101
  const observer = Trace.method({
90
102
  object: instance,
91
103
  method: instance.addInstance,
@@ -93,15 +105,18 @@ export const traceTests = describe('Trace tests', () => {
93
105
  expect(args).toEqual(traceData.methodArguments)
94
106
  expect(traceData.returned).toBe(1 + 2 + 3)
95
107
  observer.dispose()
96
- done()
108
+ doneCallback()
97
109
  },
98
110
  })
99
111
  instance.addInstance(...args)
112
+ expect(doneCallback).toBeCalled()
100
113
  })
101
114
 
102
- it('should be traced asynchronously', (done) => {
115
+ it('should be traced asynchronously', async () => {
103
116
  const instance = new MockClass()
104
117
  const args = [1, 2, 3]
118
+ const doneCallback = vi.fn()
119
+
105
120
  const observer = Trace.method({
106
121
  object: instance,
107
122
  method: instance.addInstanceAsync,
@@ -111,14 +126,17 @@ export const traceTests = describe('Trace tests', () => {
111
126
  const { returned } = traceData
112
127
  expect(returned).toBe(1 + 2 + 3)
113
128
  observer.dispose()
114
- done()
129
+ doneCallback()
115
130
  },
116
131
  })
117
- instance.addInstanceAsync(...args)
132
+ await instance.addInstanceAsync(...args)
133
+ expect(doneCallback).toBeCalled()
118
134
  })
119
135
 
120
- it("should have a valid 'this' scope", (done) => {
136
+ it("should have a valid 'this' scope", () => {
121
137
  const instance = new MockClass('testValue')
138
+ const doneCallback = vi.fn()
139
+
122
140
  const observer = Trace.method({
123
141
  object: instance,
124
142
  method: instance.testScope,
@@ -126,15 +144,18 @@ export const traceTests = describe('Trace tests', () => {
126
144
  if (traceData.returned) {
127
145
  expect(traceData.returned).toBe('testValue')
128
146
  observer.dispose()
129
- done()
147
+ doneCallback()
130
148
  }
131
149
  },
132
150
  })
133
151
  expect(instance.testScope()).toBe('testValue')
152
+ expect(doneCallback).toBeCalled()
134
153
  })
135
154
 
136
- it('should handle throwing errors', (done) => {
155
+ it('should handle throwing errors', () => {
137
156
  const instance = new MockClass('testValue')
157
+ const doneCallback = vi.fn()
158
+
138
159
  const observer = Trace.method({
139
160
  object: instance,
140
161
  method: instance.testError,
@@ -142,17 +163,20 @@ export const traceTests = describe('Trace tests', () => {
142
163
  if (traceData.error) {
143
164
  expect(traceData.error.message).toBe('message')
144
165
  observer.dispose()
145
- done()
166
+ doneCallback()
146
167
  }
147
168
  },
148
169
  })
149
170
  expect(() => {
150
171
  instance.testError('message')
151
172
  }).toThrow()
173
+ expect(doneCallback).toBeCalled()
152
174
  })
153
175
 
154
- it('should handle throwing errors with asyncs', (done) => {
176
+ it('should handle throwing errors with asyncs', async () => {
155
177
  const instance = new MockClass('testValue')
178
+ const doneCallback = vi.fn()
179
+
156
180
  const observer = Trace.method({
157
181
  object: instance,
158
182
  method: instance.testErrorAsync,
@@ -161,18 +185,16 @@ export const traceTests = describe('Trace tests', () => {
161
185
  if (traceData.error) {
162
186
  expect(traceData.error.message).toBe('message')
163
187
  observer.dispose()
164
- done()
188
+ doneCallback()
165
189
  }
166
190
  },
167
191
  })
168
- instance
169
- .testErrorAsync('message')
170
- .then(() => {
171
- done('Should throw error')
172
- })
173
- .catch(() => {
174
- /** ignore, done handled in the onError callback */
175
- })
192
+ try {
193
+ await instance.testErrorAsync('message')
194
+ } catch (error) {
195
+ // ignore
196
+ }
197
+ expect(doneCallback).toBeCalled()
176
198
  })
177
199
  })
178
200
  })
package/src/trace.ts CHANGED
@@ -202,7 +202,6 @@ export class Trace {
202
202
 
203
203
  /**
204
204
  * Creates an observer that will be observe method calls, finishes and errors
205
- *
206
205
  * @param options The options object for the trace
207
206
  * @returns the trace object that can be disposed after usage
208
207
  */
package/src/tuple.spec.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { tuple } from './tuple'
2
+ import { describe, it, expect } from 'vitest'
2
3
 
3
4
  describe('Tuple', () => {
4
5
  it('Should return a Tuple object', () => {
package/src/tuple.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Factory method for creating a Tuple instance.
3
- *
4
3
  * @param args The argument list to create
5
4
  * @returns alma asd
6
5
  */
@@ -11,7 +11,7 @@ import type { ObservableValue, ValueChangeCallback } from './observable-value'
11
11
  *
12
12
  * const observableValue = new ObservableValue<number>(0);
13
13
  * const observer = observableValue.subscribe((newValue) => {
14
- * console.log("Value changed:", newValue);
14
+ * console.log("Value changed:", newValue);
15
15
  * });
16
16
  *
17
17
  * // To update the value
@@ -21,7 +21,6 @@ import type { ObservableValue, ValueChangeCallback } from './observable-value'
21
21
  * // if you want to dispose the whole observableValue with all of its observers:
22
22
  * observableValue.dispose();
23
23
  * ```
24
- *
25
24
  * @param T This type parameter is the value type to observe
26
25
  */
27
26
  export class ValueObserver<T> implements Disposable {
@@ -6,7 +6,6 @@ export type DeepPartial<T> = {
6
6
  };
7
7
  /**
8
8
  * Deep merge two objects.
9
- *
10
9
  * @param target The source object to be merged
11
10
  * @param sources The source objects
12
11
  * @returns A new instance with the merged values
@@ -1 +1 @@
1
- {"version":3,"file":"deep-merge.d.ts","sourceRoot":"","sources":["../src/deep-merge.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAA;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,iEAmBrB,CAAA"}
1
+ {"version":3,"file":"deep-merge.d.ts","sourceRoot":"","sources":["../src/deep-merge.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAA;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,SAAS,iEAmBrB,CAAA"}
@@ -34,7 +34,6 @@ export interface Disposable {
34
34
  }
35
35
  /**
36
36
  * Method that accepts an IDisposable resource that will be disposed after the callback
37
- *
38
37
  * @param resource The resource that is used in the callback and will be disposed afterwards
39
38
  * @param callback The callback that will be executed synchrounously before the resource will be disposed
40
39
  * @returns the value that will be returned by the callback method
@@ -42,7 +41,6 @@ export interface Disposable {
42
41
  export declare const using: <T extends Disposable, TReturns>(resource: T, callback: (r: T) => TReturns) => TReturns;
43
42
  /**
44
43
  * Method that accepts an IDisposable resource that will be disposed after the callback
45
- *
46
44
  * @param resource The resource that is used in the callback and will be disposed afterwards
47
45
  * @param callback The callback that will be executed asynchrounously before the resource will be disposed
48
46
  * @returns A promise that will be resolved with a return value after the resource is disposed
@@ -1 +1 @@
1
- {"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM;AAEN;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,yFAMjB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,2GAYtB,CAAA"}
1
+ {"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM;AAEN;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,yFAMjB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,2GAYtB,CAAA"}
@@ -19,7 +19,7 @@ export type ValueChangeCallback<T> = (next: T) => void;
19
19
  * ```ts
20
20
  * const observableValue = new ObservableValue<number>(0);
21
21
  * const observer = observableValue.subscribe((newValue) => {
22
- * console.log("Value changed:", newValue);
22
+ * console.log("Value changed:", newValue);
23
23
  * });
24
24
  * // To update the value
25
25
  * observableValue.setValue(Math.random());
@@ -28,7 +28,6 @@ export type ValueChangeCallback<T> = (next: T) => void;
28
28
  * // if you want to dispose the whole observableValue with all of its observers:
29
29
  * observableValue.dispose();
30
30
  * ```
31
- *
32
31
  * @param T Generic argument to indicate the value type
33
32
  */
34
33
  export declare class ObservableValue<T> implements Disposable {
@@ -42,7 +41,6 @@ export declare class ObservableValue<T> implements Disposable {
42
41
  private currentValue;
43
42
  /**
44
43
  * Subscribes to a value changes
45
- *
46
44
  * @param callback The callback method that will be called on each change
47
45
  * @param getLast Will call the callback with the last known value right after subscription
48
46
  * @returns The ValueObserver instance
@@ -50,26 +48,22 @@ export declare class ObservableValue<T> implements Disposable {
50
48
  subscribe(callback: ValueChangeCallback<T>, getLast?: boolean): ValueObserver<T>;
51
49
  /**
52
50
  * The observer will unsubscribe from the Observable
53
- *
54
51
  * @param observer The ValueObserver instance
55
52
  * @returns if unsubscribing was successfull
56
53
  */
57
54
  unsubscribe(observer: ValueObserver<T>): boolean;
58
55
  /**
59
56
  * Gets the current Value
60
- *
61
57
  * @returns The current value
62
58
  */
63
59
  getValue(): T;
64
60
  /**
65
61
  * Sets a new value and notifies the observers.
66
- *
67
62
  * @param newValue The new value to be set
68
63
  */
69
64
  setValue(newValue: T): void;
70
65
  /**
71
66
  * Gets the observers
72
- *
73
67
  * @returns The subscribed observers
74
68
  */
75
69
  getObservers(): readonly ValueObserver<T>[];
@@ -1 +1 @@
1
- {"version":3,"file":"observable-value.d.ts","sourceRoot":"","sources":["../src/observable-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;;CAIxD;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,UAAU;IACnD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,OAAO,CAAC,WAAW,CAAQ;IAE3B;;OAEG;IACI,OAAO;IAId,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,YAAY,CAAI;IAExB;;;;;;OAMG;IACI,SAAS,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,OAAO,UAAQ;IAYlE;;;;;OAKG;IACI,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAI7C;;;;OAIG;IACI,QAAQ,IAAI,CAAC;IAOpB;;;;OAIG;IACI,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAY3B;;;;OAIG;IACI,YAAY;IAInB;;OAEG;gBACS,YAAY,CAAC,EAAE,CAAC;CAK7B"}
1
+ {"version":3,"file":"observable-value.d.ts","sourceRoot":"","sources":["../src/observable-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;;CAIxD;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,UAAU;IACnD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,OAAO,CAAC,WAAW,CAAQ;IAE3B;;OAEG;IACI,OAAO;IAId,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,YAAY,CAAI;IAExB;;;;;OAKG;IACI,SAAS,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,OAAO,UAAQ;IAYlE;;;;OAIG;IACI,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAI7C;;;OAGG;IACI,QAAQ,IAAI,CAAC;IAOpB;;;OAGG;IACI,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAY3B;;;OAGG;IACI,YAAY;IAInB;;OAEG;gBACS,YAAY,CAAC,EAAE,CAAC;CAK7B"}
@@ -6,7 +6,6 @@
6
6
  export declare class PathHelper {
7
7
  /**
8
8
  * Trims the slash characters from the beginning and from the end of the path to avoid duplicated slashes
9
- *
10
9
  * @param {string} path The source path that should be trimmed
11
10
  * @returns the trimmed path
12
11
  */
@@ -14,21 +13,18 @@ export declare class PathHelper {
14
13
  /**
15
14
  * Splits a full path into path segments,
16
15
  * e.g.: /Root/Example/stuff
17
- *
18
16
  * @param path The path to be splitted
19
17
  * @returns {string[]} the segments for the path
20
18
  */
21
19
  static getSegments(path: string): string[];
22
20
  /**
23
21
  * Method that allows to join paths without multiple or missing slashes
24
- *
25
22
  * @param args The list of the paths to join
26
23
  * @returns the joined path string
27
24
  */
28
25
  static joinPaths(...args: string[]): string;
29
26
  /**
30
27
  * Checks if the ancestorPath is really the ancestor of the descendantPath
31
- *
32
28
  * @param {string} ancestorPath the ancestor path
33
29
  * @param {string} descendantPath the descendant path
34
30
  * @returns {boolean} if the provided path is the ancestor of the descendant
@@ -39,7 +35,6 @@ export declare class PathHelper {
39
35
  * e.g. "/Root/Example/Content" will return "/Root/Example"
40
36
  *
41
37
  * "Root" will always return "Root"
42
- *
43
38
  * @param path The content path
44
39
  * @returns the parent path
45
40
  */
@@ -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;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"}
1
+ {"version":3,"file":"path-helper.d.ts","sourceRoot":"","sources":["../src/path-helper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAU;IACrB;;;;OAIG;WACW,WAAW,CAAC,IAAI,EAAE,MAAM;IAUtC;;;;;OAKG;WACW,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIjD;;;;OAIG;WACW,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIzC;;;;;OAKG;WACW,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO;IAIjF;;;;;;;OAOG;WACW,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;WAQnC,SAAS,CAAC,IAAI,EAAE,MAAM;CAGrC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Returns a simple promise that will be resolved within a discrete timeout
3
- *
4
3
  * @param timeout The timeout in millisecs
5
4
  */
6
5
  export declare const sleepAsync: (timeout?: number) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"sleep-async.d.ts","sourceRoot":"","sources":["../src/sleep-async.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,qCAKpB,CAAA"}
1
+ {"version":3,"file":"sleep-async.d.ts","sourceRoot":"","sources":["../src/sleep-async.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU,qCAKpB,CAAA"}
package/types/trace.d.ts CHANGED
@@ -111,7 +111,6 @@ export declare class Trace {
111
111
  private static callMethodAsync;
112
112
  /**
113
113
  * Creates an observer that will be observe method calls, finishes and errors
114
- *
115
114
  * @param options The options object for the trace
116
115
  * @returns the trace object that can be disposed after usage
117
116
  */
@@ -1 +1 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,EAAE,OAAO,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAAE,KAAK,SAAS,OAAO,EAAE;IACzG;;OAEG;IACH,MAAM,EAAE,CAAC,CAAA;IACT;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,KAAK,IAAI,CAAA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AEjE,OAAO,CAAC,MAAM,CAAC,cAAc;IAQ7B,OAAO,CAAC,MAAM,CAAC,UAAU;IAazB,OAAO,CAAC,MAAM,CAAC,aAAa;IAe5B,OAAO,CAAC,MAAM,CAAC,UAAU;IAgBzB,OAAO,CAAC,MAAM,CAAC,UAAU;mBAiBJ,eAAe;IAiBpC;;;;OAIG;WACW,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,GAAG,EAAE,KAAK,SAAS,GAAG,EAAE,EACjG,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,GAC7C,UAAU;CA0Cd"}
package/types/tuple.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Factory method for creating a Tuple instance.
3
- *
4
3
  * @param args The argument list to create
5
4
  * @returns alma asd
6
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../src/tuple.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,uCAA2C,CAAA"}
1
+ {"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../src/tuple.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,KAAK,uCAA2C,CAAA"}