clientnode 4.0.1436 → 4.0.1438

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 (142) hide show
  1. package/dist/Lock.js +83 -94
  2. package/dist/Logger.js +163 -715
  3. package/dist/Semaphore.js +46 -81
  4. package/dist/array.js +337 -568
  5. package/dist/cli.js +37 -71
  6. package/dist/constants.js +110 -209
  7. package/dist/context.js +25 -229
  8. package/dist/cookie.js +48 -226
  9. package/dist/data-transfer.js +166 -725
  10. package/dist/datetime.js +241 -1059
  11. package/dist/domNode.js +277 -441
  12. package/dist/expression/evaluators.js +234 -1112
  13. package/dist/expression/helper.js +82 -135
  14. package/dist/expression/index.js +10 -1245
  15. package/dist/expression/indicator-functions.js +21 -239
  16. package/dist/expression/type.js +4 -34
  17. package/dist/filesystem.js +323 -309
  18. package/dist/function.js +51 -125
  19. package/dist/index.js +26 -2709
  20. package/dist/indicators.js +68 -440
  21. package/dist/module.js +98 -163
  22. package/dist/number.js +25 -423
  23. package/dist/object.js +774 -852
  24. package/dist/process.js +38 -245
  25. package/dist/property-types.js +96 -157
  26. package/dist/scope.js +56 -1825
  27. package/dist/string.js +603 -909
  28. package/dist/test-helper.js +171 -541
  29. package/dist/type.js +8 -37
  30. package/dist/utility.js +91 -336
  31. package/package.json +9 -10
  32. package/dist/Lock.d.ts +0 -39
  33. package/dist/Logger.d.ts +0 -102
  34. package/dist/Semaphore.d.ts +0 -29
  35. package/dist/array.d.ts +0 -150
  36. package/dist/bundle/Lock.js +0 -111
  37. package/dist/bundle/Logger.js +0 -705
  38. package/dist/bundle/Semaphore.js +0 -100
  39. package/dist/bundle/array.js +0 -648
  40. package/dist/bundle/cli.js +0 -85
  41. package/dist/bundle/constants.js +0 -225
  42. package/dist/bundle/context.js +0 -243
  43. package/dist/bundle/cookie.js +0 -262
  44. package/dist/bundle/data-transfer.js +0 -741
  45. package/dist/bundle/datetime.js +0 -1064
  46. package/dist/bundle/domNode.js +0 -471
  47. package/dist/bundle/expression/evaluators.js +0 -1115
  48. package/dist/bundle/expression/helper.js +0 -106
  49. package/dist/bundle/expression/index.js +0 -1223
  50. package/dist/bundle/expression/indicator-functions.js +0 -235
  51. package/dist/bundle/expression/type.js +0 -50
  52. package/dist/bundle/filesystem.js +0 -374
  53. package/dist/bundle/function.js +0 -105
  54. package/dist/bundle/index.js +0 -2686
  55. package/dist/bundle/indicators.js +0 -459
  56. package/dist/bundle/module.js +0 -180
  57. package/dist/bundle/number.js +0 -425
  58. package/dist/bundle/object.js +0 -1004
  59. package/dist/bundle/process.js +0 -275
  60. package/dist/bundle/property-types.js +0 -167
  61. package/dist/bundle/scope.js +0 -1808
  62. package/dist/bundle/string.js +0 -1095
  63. package/dist/bundle/test-helper.js +0 -690
  64. package/dist/bundle/type.js +0 -50
  65. package/dist/bundle/utility.js +0 -362
  66. package/dist/cli.d.ts +0 -31
  67. package/dist/compatible/Lock.js +0 -111
  68. package/dist/compatible/Logger.js +0 -705
  69. package/dist/compatible/Semaphore.js +0 -100
  70. package/dist/compatible/array.js +0 -648
  71. package/dist/compatible/cli.js +0 -85
  72. package/dist/compatible/constants.js +0 -225
  73. package/dist/compatible/context.js +0 -243
  74. package/dist/compatible/cookie.js +0 -262
  75. package/dist/compatible/data-transfer.js +0 -741
  76. package/dist/compatible/datetime.js +0 -1064
  77. package/dist/compatible/domNode.js +0 -471
  78. package/dist/compatible/expression/evaluators.js +0 -1115
  79. package/dist/compatible/expression/helper.js +0 -106
  80. package/dist/compatible/expression/index.js +0 -1223
  81. package/dist/compatible/expression/indicator-functions.js +0 -235
  82. package/dist/compatible/expression/type.js +0 -50
  83. package/dist/compatible/filesystem.js +0 -374
  84. package/dist/compatible/function.js +0 -105
  85. package/dist/compatible/index.js +0 -2686
  86. package/dist/compatible/indicators.js +0 -459
  87. package/dist/compatible/module.js +0 -180
  88. package/dist/compatible/number.js +0 -425
  89. package/dist/compatible/object.js +0 -1004
  90. package/dist/compatible/process.js +0 -275
  91. package/dist/compatible/property-types.js +0 -167
  92. package/dist/compatible/scope.js +0 -1808
  93. package/dist/compatible/string.js +0 -1095
  94. package/dist/compatible/test-helper.js +0 -690
  95. package/dist/compatible/type.js +0 -50
  96. package/dist/compatible/utility.js +0 -362
  97. package/dist/constants.d.ts +0 -99
  98. package/dist/context.d.ts +0 -8
  99. package/dist/cookie.d.ts +0 -31
  100. package/dist/data-transfer.d.ts +0 -45
  101. package/dist/datetime.d.ts +0 -37
  102. package/dist/domNode.d.ts +0 -82
  103. package/dist/expression/evaluators.d.ts +0 -55
  104. package/dist/expression/helper.d.ts +0 -4
  105. package/dist/expression/index.d.ts +0 -7
  106. package/dist/expression/indicator-functions.d.ts +0 -14
  107. package/dist/expression/type.d.ts +0 -70
  108. package/dist/filesystem.d.ts +0 -143
  109. package/dist/function.d.ts +0 -20
  110. package/dist/index.d.ts +0 -23
  111. package/dist/indicators.d.ts +0 -68
  112. package/dist/module.d.ts +0 -8
  113. package/dist/number.d.ts +0 -35
  114. package/dist/object.d.ts +0 -231
  115. package/dist/process.d.ts +0 -22
  116. package/dist/property-types.d.ts +0 -460
  117. package/dist/scope.d.ts +0 -44
  118. package/dist/string.d.ts +0 -312
  119. package/dist/test/Lock.d.ts +0 -1
  120. package/dist/test/Logger.d.ts +0 -1
  121. package/dist/test/Semaphore.d.ts +0 -1
  122. package/dist/test/array.d.ts +0 -1
  123. package/dist/test/cookie.d.ts +0 -1
  124. package/dist/test/data-transfer.d.ts +0 -1
  125. package/dist/test/datetime.d.ts +0 -1
  126. package/dist/test/domNode.d.ts +0 -1
  127. package/dist/test/expression/evaluators.d.ts +0 -1
  128. package/dist/test/expression/helper.d.ts +0 -1
  129. package/dist/test/expression/indicator-functions.d.ts +0 -1
  130. package/dist/test/filesystem.d.ts +0 -1
  131. package/dist/test/function.d.ts +0 -1
  132. package/dist/test/indicators.d.ts +0 -1
  133. package/dist/test/number.d.ts +0 -1
  134. package/dist/test/object.d.ts +0 -1
  135. package/dist/test/process.d.ts +0 -1
  136. package/dist/test/property-types.d.ts +0 -1
  137. package/dist/test/scope.d.ts +0 -1
  138. package/dist/test/string.d.ts +0 -1
  139. package/dist/test/utility.d.ts +0 -1
  140. package/dist/test-helper.d.ts +0 -143
  141. package/dist/type.d.ts +0 -230
  142. package/dist/utility.d.ts +0 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clientnode",
3
- "version": "4.0.1436",
3
+ "version": "4.0.1438",
4
4
  "description": "Handy utilities for any JavaScript environments.",
5
5
  "keywords": [
6
6
  "client",
@@ -82,17 +82,17 @@
82
82
  "@types/ejs": "^3.1.5",
83
83
  "@types/html-minifier": "^4.0.6",
84
84
  "@types/imagemin": "^9.0.1",
85
- "@types/node": "^26.1.0",
85
+ "@types/node": "^26.1.1",
86
86
  "@types/prop-types": "^15.7.15",
87
87
  "@types/webpack-env": "^1.18.8",
88
- "@typescript-eslint/eslint-plugin": "^8.62.1",
89
- "@typescript-eslint/parser": "^8.62.1",
88
+ "@typescript-eslint/eslint-plugin": "^8.63.0",
89
+ "@typescript-eslint/parser": "^8.63.0",
90
90
  "babel-plugin-polyfill-corejs3": "^1.0.0",
91
91
  "babel-plugin-transform-rewrite-imports": "^1.5.4",
92
92
  "clientnode": "workspace:.",
93
93
  "eslint": "^10.6.0",
94
94
  "eslint-config-google": "^0.14.0",
95
- "eslint-plugin-jsdoc": "^63.0.10",
95
+ "eslint-plugin-jsdoc": "^63.0.12",
96
96
  "favicons-webpack-plugin": "^6.0.1",
97
97
  "image-minimizer-webpack-plugin": "^5.0.0",
98
98
  "jest": "30.4.2",
@@ -100,10 +100,10 @@
100
100
  "node-fetch": "^3.3.2",
101
101
  "prop-types": "^15.8.1",
102
102
  "rimraf": "^6.1.3",
103
- "typescript-eslint": "^8.62.1",
103
+ "typescript-eslint": "^8.63.0",
104
104
  "web-documentation": "^1.0.42",
105
- "weboptimizer": "^4.0.6",
106
- "webpack-dev-server": "^5.2.5"
105
+ "weboptimizer": "^4.0.15",
106
+ "webpack-dev-server": "^6.0.0"
107
107
  },
108
108
  "peerDependencies": {
109
109
  "@types/prop-types": "*",
@@ -127,7 +127,7 @@
127
127
  "yarn": ">=4"
128
128
  },
129
129
  "resolutions": {
130
- "weboptimizer/clientnode": "4.0.1431",
130
+ "weboptimizer/clientnode": "4.0.1435",
131
131
  "colors": "1.4.0",
132
132
  "globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
133
133
  "globals@npm:^11.1.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
@@ -222,7 +222,6 @@
222
222
  }
223
223
  },
224
224
  "target:bundle": {
225
- "libraryName": "clientnode",
226
225
  "module": {
227
226
  "preprocessor": {
228
227
  "javaScript": {
package/dist/Lock.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import type { LockCallbackFunction, Mapping } from './type';
2
- /**
3
- * Represents the lock state.
4
- * @property locks - Mapping of lock descriptions to their corresponding
5
- * callbacks.
6
- */
7
- export declare class Lock<Type = string | undefined> {
8
- lock?: Array<LockCallbackFunction<Type>>;
9
- locks: Mapping<Array<LockCallbackFunction<Type>>>;
10
- /**
11
- * Initializes locks.
12
- * @param locks - Mapping of a lock description to callbacks for calling
13
- * when given lock should be released.
14
- */
15
- constructor(locks?: Mapping<Array<LockCallbackFunction<Type>>>);
16
- /**
17
- * Calling this method introduces a starting point for a critical area with
18
- * potential race conditions. The area will be bind to given description
19
- * string. So don't use same names for different areas.
20
- * @param description - A short string describing the critical areas
21
- * properties.
22
- * @param callback - A procedure which should only be executed if the
23
- * interpreter isn't in the given critical area. The lock description
24
- * string will be given to the callback function.
25
- * @param autoRelease - Release the lock after execution of given callback.
26
- * @returns Returns a promise which will be resolved after releasing lock.
27
- */
28
- acquire(description?: string, callback?: LockCallbackFunction<Type>, autoRelease?: boolean): Promise<Type>;
29
- /**
30
- * Calling this method causes the given critical area to be finished and
31
- * all functions given to "acquire()" will be executed in right order.
32
- * @param description - A short string describing the critical areas
33
- * properties.
34
- * @returns Returns the return (maybe promise resolved) value of the
35
- * callback given to the "acquire" method.
36
- */
37
- release(description?: string): Promise<Type | undefined>;
38
- }
39
- export default Lock;
package/dist/Logger.d.ts DELETED
@@ -1,102 +0,0 @@
1
- import type { LoggerOptions, Mapping } from './type';
2
- export declare const LEVELS: readonly ["error", "critical", "warn", "info", "debug"];
3
- export declare const LEVELS_COLOR: ("\u001B[0;34m" | "\u001B[32m" | "\u001B[35m" | "\u001B[31m" | "\u001B[33m")[];
4
- export type Level = typeof LEVELS[number];
5
- /**
6
- * This plugin provides such interface logic like generic controller logic for
7
- * integrating plugins into $, mutual exclusion for dependent gui elements,
8
- * logging additional string, array or function handling. A set of helper
9
- * functions to parse option objects dom trees or handle events is also
10
- * provided.
11
- * @property level - Logging level.
12
- * @property name - Logger description.
13
- */
14
- export declare class Logger {
15
- static defaultLevel: Level;
16
- static defaultName: string;
17
- static selfClass: typeof Logger;
18
- static instances: Mapping<Logger>;
19
- static runtimeVersion: number;
20
- /**
21
- * Configures all logger instances.
22
- * @param options - Options to set.
23
- */
24
- static configureAllInstances(options?: Partial<LoggerOptions>): void;
25
- level: Level;
26
- name: string;
27
- /**
28
- * Initializes logger.
29
- * @param options - Options to set.
30
- */
31
- constructor(options?: Partial<LoggerOptions>);
32
- /**
33
- * Configures logger.
34
- * @param options - Options to set.
35
- * @param options.name - Description of the logger instance.
36
- * @param options.level - Logging level to configure.
37
- */
38
- configure({ name, level }: Partial<LoggerOptions>): void;
39
- /**
40
- * Shows the given object's representation in the browsers console if
41
- * possible or in a standalone alert-window as fallback.
42
- * @param object - Any object to print.
43
- * @param force - If set to "true" given input will be shown independently
44
- * of current logging configuration or interpreter's console
45
- * implementation.
46
- * @param avoidAnnotation - If set to "true" given input has no module or
47
- * log level specific annotations.
48
- * @param level - Description of log messages importance.
49
- * @param additionalArguments - Additional values to print.
50
- */
51
- log(object: unknown, force?: boolean, avoidAnnotation?: boolean, level?: Level, ...additionalArguments: Array<unknown>): void;
52
- /**
53
- * Wrapper method for the native console method usually provided by
54
- * interpreter.
55
- * @param object - Any object to print.
56
- * @param additionalArguments - Additional arguments are used for string
57
- * formatting.
58
- */
59
- info(object: unknown, ...additionalArguments: Array<unknown>): void;
60
- /**
61
- * Wrapper method for the native console method usually provided by
62
- * interpreter.
63
- * @param object - Any object to print.
64
- * @param additionalArguments - Additional arguments are used for string
65
- * formatting.
66
- */
67
- debug(object: unknown, ...additionalArguments: Array<unknown>): void;
68
- /**
69
- * Wrapper method for the native console method usually provided by
70
- * interpreter.
71
- * @param object - Any object to print.
72
- * @param additionalArguments - Additional arguments are used for string
73
- * formatting.
74
- */
75
- error(object: unknown, ...additionalArguments: Array<unknown>): void;
76
- /**
77
- * Wrapper method for the native console method usually provided by
78
- * interpreter.
79
- * @param object - Any object to print.
80
- * @param additionalArguments - Additional arguments are used for string
81
- * formatting.
82
- */
83
- critical(object: unknown, ...additionalArguments: Array<unknown>): void;
84
- /**
85
- * Wrapper method for the native console method usually provided by
86
- * interpreter.
87
- * @param object - Any object to print.
88
- * @param additionalArguments - Additional arguments are used for string
89
- * formatting.
90
- */
91
- warn(object: unknown, ...additionalArguments: Array<unknown>): void;
92
- /**
93
- * Dumps a given object in a human-readable format.
94
- * @param object - Any object to show.
95
- * @param level - Number of levels to dig into given object recursively.
96
- * @param currentLevel - Maximal number of recursive function calls to
97
- * represent given object.
98
- * @returns Returns the serialized version of given object.
99
- */
100
- static show(object: unknown, level?: number, currentLevel?: number): string;
101
- }
102
- export default Logger;
@@ -1,29 +0,0 @@
1
- import type { AnyFunction } from './type';
2
- /**
3
- * Represents the semaphore state.
4
- * @property queue - List of waiting resource requests.
5
- * @property numberOfFreeResources - Number free allowed concurrent resource
6
- * uses.
7
- * @property numberOfResources - Number of allowed concurrent resource uses.
8
- */
9
- export declare class Semaphore {
10
- queue: Array<AnyFunction>;
11
- numberOfResources: number;
12
- numberOfFreeResources: number;
13
- /**
14
- * Initializes number of resources.
15
- * @param numberOfResources - Number of resources to manage.
16
- */
17
- constructor(numberOfResources?: number);
18
- /**
19
- * Acquires a new resource and runs given callback if available.
20
- * @returns A promise which will be resolved if requested resource is
21
- * available.
22
- */
23
- acquire(): Promise<number>;
24
- /**
25
- * Releases a resource and runs a waiting resolver if there exists some.
26
- */
27
- release(): void;
28
- }
29
- export default Semaphore;
package/dist/array.d.ts DELETED
@@ -1,150 +0,0 @@
1
- import type { Mapping, Page, PaginateOptions } from './type';
2
- /**
3
- * Summarizes given property of given item list.
4
- * @param data - Array of objects with given property name.
5
- * @param propertyName - Property name to summarize.
6
- * @param defaultValue - Value to return if property values doesn't match.
7
- * @returns Aggregated value.
8
- */
9
- export declare const aggregatePropertyIfEqual: <T = unknown>(data: Array<Mapping<unknown>>, propertyName: string, defaultValue?: T) => T;
10
- /**
11
- * Deletes every item witch has only empty attributes for given property names.
12
- * If given property names are empty each attribute will be considered. The
13
- * empty string, "null" and "undefined" will be interpreted as empty.
14
- * @param data - Data to filter.
15
- * @param propertyNames - Properties to consider.
16
- * @returns Given data without empty items.
17
- */
18
- export declare const deleteEmptyItems: <T extends Mapping<unknown> = Mapping<unknown>>(data: Array<T>, propertyNames?: Array<string | symbol>) => Array<T>;
19
- /**
20
- * Extracts all properties from all items which occur in given property names.
21
- * @param data - Data where each item should be sliced.
22
- * @param propertyNames - Property names to extract.
23
- * @returns Data with sliced items.
24
- */
25
- export declare const extract: <T = Mapping<unknown>>(data: unknown, propertyNames: Array<string>) => Array<T>;
26
- /**
27
- * Extracts all values which matches given regular expression.
28
- * @param data - Data to filter.
29
- * @param regularExpression - Pattern to match for.
30
- * @returns Filtered data.
31
- */
32
- export declare const extractIfMatches: (data: unknown, regularExpression: string | RegExp) => Array<string>;
33
- /**
34
- * Filters given data if given property is set or not.
35
- * @param data - Data to filter.
36
- * @param propertyName - Property name to check for existence.
37
- * @returns Given data without the items which doesn't have specified property.
38
- */
39
- export declare const extractIfPropertyExists: <T extends Mapping<unknown> = Mapping<unknown>>(data: unknown, propertyName: string) => Array<T>;
40
- /**
41
- * Extract given data where specified property value matches given patterns.
42
- * @param data - Data to filter.
43
- * @param propertyPattern - Mapping of property names to pattern.
44
- * @returns Filtered data.
45
- */
46
- export declare const extractIfPropertyMatches: <T = unknown>(data: unknown, propertyPattern: Mapping<RegExp | string>) => Array<T>;
47
- /**
48
- * Determines all objects which exists in "first" and in "second".
49
- * Object key which will be compared are given by "keys". If an empty array is
50
- * given each key will be compared. If an object is given corresponding initial
51
- * data key will be mapped to referenced new data key.
52
- * @param first - Referenced data to check for.
53
- * @param second - Data to check for existence.
54
- * @param keys - Keys to define equality.
55
- * @param strict - The strict parameter indicates whether "null" and
56
- * "undefined" should be interpreted as equal (takes only effect if given keys
57
- * aren't empty).
58
- * @returns Data which does exit in given initial data.
59
- */
60
- export declare const intersect: <T = unknown>(first: unknown, second: unknown, keys?: Array<string> | Mapping<number | string>, strict?: boolean) => Array<T>;
61
- /**
62
- * Converts given object into an array.
63
- * @param object - Target to convert.
64
- * @returns Generated array.
65
- */
66
- export declare const makeArray: <T = unknown>(object: unknown) => Array<T>;
67
- /**
68
- * Creates a list of items within given range.
69
- * @param range - Array of lower and upper bounds. If only one value is given
70
- * lower bound will be assumed to be zero. Both integers have to be positive
71
- * and will be contained in the resulting array. If more than two numbers are
72
- * provided given range will be returned.
73
- * @param step - Space between two consecutive values.
74
- * @param ignoreLastStep - Removes last step.
75
- * @returns Produced array of integers.
76
- */
77
- export declare const makeRange: (range: number | Array<number> | [number] | [number, number], step?: number, ignoreLastStep?: boolean) => Array<number>;
78
- /**
79
- * Merge the contents of two arrays together into the first array.
80
- * @param target - Target array.
81
- * @param source - Source array.
82
- * @returns Target array with merged given source one.
83
- */
84
- export declare const merge: <T = unknown>(target: Array<T>, source: Array<T>) => Array<T>;
85
- /**
86
- * Generates a list if pagination symbols to render a pagination from.
87
- * @param options - Configure bounds and current page of pagination to
88
- * determine.
89
- * @param options.boundaryCount - Indicates where to start pagination within
90
- * given total range.
91
- * @param options.disabled - Indicates whether to disable all items.
92
- * @param options.hideNextButton - Indicates whether to show a jump to next
93
- * item.
94
- * @param options.hidePrevButton - Indicates whether to show a jump to previous
95
- * item.
96
- * @param options.page - Indicates current visible page.
97
- * @param options.pageSize - Number of items per page.
98
- * @param options.showFirstButton - Indicates whether to show a jump to first
99
- * item.
100
- * @param options.showLastButton - Indicates whether to show a jump to last
101
- * item.
102
- * @param options.siblingCount - Number of sibling page symbols next to current
103
- * page symbol.
104
- * @param options.total - Number of all items to paginate.
105
- * @returns A list of pagination symbols.
106
- */
107
- export declare const paginate: (options?: Partial<PaginateOptions>) => Array<Page>;
108
- /**
109
- * Generates all permutations of given iterable.
110
- * @param data - Array like object.
111
- * @returns Array of permuted arrays.
112
- */
113
- export declare const permute: <T = unknown>(data: Array<T>) => Array<Array<T>>;
114
- /**
115
- * Generates all lengths permutations of given iterable.
116
- * @param data - Array like object.
117
- * @param minimalSubsetLength - Defines how long the minimal subset length
118
- * should be.
119
- * @returns Array of permuted arrays.
120
- */
121
- export declare const permuteLength: <T = unknown>(data: Array<T>, minimalSubsetLength?: number) => Array<Array<T>>;
122
- /**
123
- * Sums up given property of given item list.
124
- * @param data - The objects with specified property to sum up.
125
- * @param propertyName - Property name to sum up its value.
126
- * @returns The aggregated value.
127
- */
128
- export declare const sumUpProperty: (data: unknown, propertyName: string) => number;
129
- /**
130
- * Removes given target on given list.
131
- * @param list - Array to splice.
132
- * @param target - Target to remove from given list.
133
- * @param strict - Indicates whether to fire an exception if given target
134
- * doesn't exist given list.
135
- * @returns Item with the appended target.
136
- */
137
- export declare const removeArrayItem: <T = unknown>(list: Array<T>, target: T, strict?: boolean) => Array<T>;
138
- /**
139
- * Sorts given object of dependencies in a topological order.
140
- * @param items - Items to sort.
141
- * @returns Sorted array of given items respecting their dependencies.
142
- */
143
- export declare const sortTopological: (items: Mapping<Array<string> | string>) => Array<string>;
144
- /**
145
- * Makes all values in given iterable unique by removing duplicates (The first
146
- * occurrences will be left).
147
- * @param data - Array like object.
148
- * @returns Sliced version of given object.
149
- */
150
- export declare const unique: <T = unknown>(data: Array<T>) => Array<T>;
@@ -1,111 +0,0 @@
1
- 'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;(function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define("clientnode", [], factory);
6
- else if(typeof exports === 'object')
7
- exports["clientnode"] = factory();
8
- else
9
- root["clientnode"] = factory();
10
- })(this, function() {
11
- return /******/ (function() { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ // The require scope
14
- /******/ var __webpack_require__ = {};
15
- /******/
16
- /************************************************************************/
17
- /******/ /* webpack/runtime/define property getters */
18
- /******/ !function() {
19
- /******/ // define getter/value functions for harmony exports
20
- /******/ __webpack_require__.d = function(exports, definition) {
21
- /******/ if(Array.isArray(definition)) {
22
- /******/ var i = 0;
23
- /******/ while(i < definition.length) {
24
- /******/ var key = definition[i++];
25
- /******/ var binding = definition[i++];
26
- /******/ if(!__webpack_require__.o(exports, key)) {
27
- /******/ if(binding === 0) {
28
- /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
29
- /******/ } else {
30
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
31
- /******/ }
32
- /******/ } else if(binding === 0) { i++; }
33
- /******/ }
34
- /******/ } else {
35
- /******/ for(var key in definition) {
36
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
37
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
38
- /******/ }
39
- /******/ }
40
- /******/ }
41
- /******/ };
42
- /******/ }();
43
- /******/
44
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
45
- /******/ !function() {
46
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
47
- /******/ }();
48
- /******/
49
- /******/ /* webpack/runtime/make namespace object */
50
- /******/ !function() {
51
- /******/ // define __esModule on exports
52
- /******/ __webpack_require__.r = function(exports) {
53
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
54
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
55
- /******/ }
56
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
57
- /******/ };
58
- /******/ }();
59
- /******/
60
- /************************************************************************/
61
- var __webpack_exports__ = {};
62
- __webpack_require__.r(__webpack_exports__);
63
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
64
- /* harmony export */ Lock: function() { return /* binding */ Lock; }
65
- /* harmony export */ });
66
- // #!/usr/bin/env babel-node
67
- // -*- coding: utf-8 -*-
68
- /** @module Lock *//* !
69
- region header
70
- [Project page](https://torben.website/clientnode)
71
-
72
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
73
-
74
- License
75
- -------
76
-
77
- This library written by Torben Sickert stands under a creative commons
78
- naming 3.0 unported license.
79
- See https://creativecommons.org/licenses/by/3.0/deed.de
80
- endregion
81
- */function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
82
- * Represents the lock state.
83
- * @property locks - Mapping of lock descriptions to their corresponding
84
- * callbacks.
85
- */var Lock=/*#__PURE__*/function(){/**
86
- * Initializes locks.
87
- * @param locks - Mapping of a lock description to callbacks for calling
88
- * when given lock should be released.
89
- */function Lock(locks){if(locks===void 0){locks={}}_classCallCheck(this,Lock);_defineProperty(this,"lock",void 0);_defineProperty(this,"locks",void 0);this.locks=locks}/**
90
- * Calling this method introduces a starting point for a critical area with
91
- * potential race conditions. The area will be bind to given description
92
- * string. So don't use same names for different areas.
93
- * @param description - A short string describing the critical areas
94
- * properties.
95
- * @param callback - A procedure which should only be executed if the
96
- * interpreter isn't in the given critical area. The lock description
97
- * string will be given to the callback function.
98
- * @param autoRelease - Release the lock after execution of given callback.
99
- * @returns Returns a promise which will be resolved after releasing lock.
100
- */return _createClass(Lock,[{key:"acquire",value:function acquire(description,callback,autoRelease){var _this=this;if(autoRelease===void 0){autoRelease=false}return new Promise(function(resolve){var wrappedCallback=function wrappedCallback(description){var _result;var result;if(callback)result=callback(description);var finish=function finish(value){if(autoRelease)void _this.release(description);resolve(value);return value};if((_result=result)!==null&&_result!==void 0&&_result.then)return result.then(finish);finish(result);return result};if(description){if(Object.prototype.hasOwnProperty.call(_this.locks,description))_this.locks[description].push(wrappedCallback);else{_this.locks[description]=[];void wrappedCallback(description)}return}if(_this.lock)_this.lock.push(wrappedCallback);else{_this.lock=[];void wrappedCallback(description)}})}/**
101
- * Calling this method causes the given critical area to be finished and
102
- * all functions given to "acquire()" will be executed in right order.
103
- * @param description - A short string describing the critical areas
104
- * properties.
105
- * @returns Returns the return (maybe promise resolved) value of the
106
- * callback given to the "acquire" method.
107
- */},{key:"release",value:(function(){var _release=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(description){var _this$lock;var _callback,callback;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:if(!description){_context.n=4;break}if(!Object.prototype.hasOwnProperty.call(this.locks,description)){_context.n=3;break}_callback=this.locks[description].shift();if(!(_callback===undefined)){_context.n=1;break}delete this.locks[description];_context.n=3;break;case 1:_context.n=2;return _callback(description);case 2:return _context.a(2,_context.v);case 3:return _context.a(2);case 4:callback=(_this$lock=this.lock)===null||_this$lock===void 0?void 0:_this$lock.shift();if(!(callback===undefined)){_context.n=5;break}this.lock=undefined;_context.n=7;break;case 5:_context.n=6;return callback();case 6:return _context.a(2,_context.v);case 7:return _context.a(2)}},_callee,this)}));function release(_x){return _release.apply(this,arguments)}return release}())}])}();/* harmony default export */ __webpack_exports__["default"] = (Lock);
108
- /******/ return __webpack_exports__;
109
- /******/ })()
110
- ;
111
- });