@ktjs/shared 0.20.0 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,28 @@
1
1
  declare const $isArray: (arg: any) => arg is any[];
2
+ declare const $ArrayFrom: {
3
+ <T>(arrayLike: ArrayLike<T>): T[];
4
+ <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
5
+ <T>(iterable: Iterable<T> | ArrayLike<T>): T[];
6
+ <T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
7
+ };
8
+ declare const $is: (value1: any, value2: any) => boolean;
9
+ declare const $assign: {
10
+ <T extends {}, U>(target: T, source: U): T & U;
11
+ <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
12
+ <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
13
+ (target: object, ...sources: any[]): any;
14
+ };
2
15
  declare const $hasOwn: (v: PropertyKey) => boolean;
16
+ declare const $toString: () => string;
3
17
  declare const $keys: <T>(o: T) => Array<keyof T>;
4
18
  declare const $defines: <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T;
19
+ declare const $define: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T;
5
20
  declare const $entries: <T>(o: T) => Array<[keyof T, T[keyof T]]>;
6
21
  declare const $isThenable: (o: any) => o is Promise<any>;
7
22
 
8
23
  declare const $throw: (message: string) => never;
9
24
 
25
+ declare const $replaceWith: (...nodes: (Node | string)[]) => void;
10
26
  /**
11
27
  * & Remove `bind` because it is shockingly slower than wrapper
12
28
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -48,5 +64,5 @@ declare const emplaceParams: (path: string, params: Record<string, string>) => s
48
64
  */
49
65
  declare const extractParams: (pattern: string, path: string) => Record<string, string> | null;
50
66
 
51
- export { $append, $appendChild, $buttonDisabledGetter, $buttonDisabledSetter, $defines, $emptyFn, $entries, $hasOwn, $isArray, $isThenable, $keys, $throw, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
67
+ export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isThenable, $keys, $replaceWith, $throw, $toString, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
52
68
  export type { ChangeHandler };
@@ -3,9 +3,14 @@ var __ktjs_shared__ = (function (exports) {
3
3
 
4
4
  // Cached native methods for performance optimization
5
5
  const $isArray = Array.isArray;
6
+ const $ArrayFrom = Array.from;
7
+ const $is = Object.is;
8
+ const $assign = Object.assign;
6
9
  const $hasOwn = Object.prototype.hasOwnProperty;
10
+ const $toString = Object.prototype.toString;
7
11
  const $keys = Object.keys;
8
12
  const $defines = Object.defineProperties;
13
+ const $define = Object.defineProperty;
9
14
  const $entries = Object.entries;
10
15
  const $isThenable = (o) => typeof o === 'object' && o !== null && typeof o.then === 'function';
11
16
 
@@ -22,6 +27,7 @@ var __ktjs_shared__ = (function (exports) {
22
27
 
23
28
  // DOM manipulation utilities
24
29
  // # dom natives
30
+ const $replaceWith = Element.prototype.replaceWith;
25
31
  /**
26
32
  * & Remove `bind` because it is shockingly slower than wrapper
27
33
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -160,20 +166,26 @@ var __ktjs_shared__ = (function (exports) {
160
166
 
161
167
  // Shared utilities and cached native methods for kt.js framework
162
168
  // Re-export all utilities
163
- Object.defineProperty(window, '@ktjs/shared', { value: '0.20.0' });
169
+ Object.defineProperty(window, '@ktjs/shared', { value: '0.20.2' });
164
170
 
171
+ exports.$ArrayFrom = $ArrayFrom;
165
172
  exports.$append = $append;
166
173
  exports.$appendChild = $appendChild;
174
+ exports.$assign = $assign;
167
175
  exports.$buttonDisabledGetter = $buttonDisabledGetter;
168
176
  exports.$buttonDisabledSetter = $buttonDisabledSetter;
177
+ exports.$define = $define;
169
178
  exports.$defines = $defines;
170
179
  exports.$emptyFn = $emptyFn;
171
180
  exports.$entries = $entries;
172
181
  exports.$hasOwn = $hasOwn;
182
+ exports.$is = $is;
173
183
  exports.$isArray = $isArray;
174
184
  exports.$isThenable = $isThenable;
175
185
  exports.$keys = $keys;
186
+ exports.$replaceWith = $replaceWith;
176
187
  exports.$throw = $throw;
188
+ exports.$toString = $toString;
177
189
  exports.buildQuery = buildQuery;
178
190
  exports.emplaceParams = emplaceParams;
179
191
  exports.extractParams = extractParams;
@@ -3,9 +3,14 @@ var __ktjs_shared__ = (function (exports) {
3
3
 
4
4
  // Cached native methods for performance optimization
5
5
  var $isArray = Array.isArray;
6
+ var $ArrayFrom = Array.from;
7
+ var $is = Object.is;
8
+ var $assign = Object.assign;
6
9
  var $hasOwn = Object.prototype.hasOwnProperty;
10
+ var $toString = Object.prototype.toString;
7
11
  var $keys = Object.keys;
8
12
  var $defines = Object.defineProperties;
13
+ var $define = Object.defineProperty;
9
14
  var $entries = Object.entries;
10
15
  var $isThenable = function (o) {
11
16
  return typeof o === 'object' && o !== null && typeof o.then === 'function';
@@ -25,6 +30,7 @@ var __ktjs_shared__ = (function (exports) {
25
30
  // DOM manipulation utilities
26
31
  var _a;
27
32
  // # dom natives
33
+ var $replaceWith = Element.prototype.replaceWith;
28
34
  /**
29
35
  * & Remove `bind` because it is shockingly slower than wrapper
30
36
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -173,20 +179,26 @@ var __ktjs_shared__ = (function (exports) {
173
179
 
174
180
  // Shared utilities and cached native methods for kt.js framework
175
181
  // Re-export all utilities
176
- Object.defineProperty(window, '@ktjs/shared', { value: '0.20.0' });
182
+ Object.defineProperty(window, '@ktjs/shared', { value: '0.20.2' });
177
183
 
184
+ exports.$ArrayFrom = $ArrayFrom;
178
185
  exports.$append = $append;
179
186
  exports.$appendChild = $appendChild;
187
+ exports.$assign = $assign;
180
188
  exports.$buttonDisabledGetter = $buttonDisabledGetter;
181
189
  exports.$buttonDisabledSetter = $buttonDisabledSetter;
190
+ exports.$define = $define;
182
191
  exports.$defines = $defines;
183
192
  exports.$emptyFn = $emptyFn;
184
193
  exports.$entries = $entries;
185
194
  exports.$hasOwn = $hasOwn;
195
+ exports.$is = $is;
186
196
  exports.$isArray = $isArray;
187
197
  exports.$isThenable = $isThenable;
188
198
  exports.$keys = $keys;
199
+ exports.$replaceWith = $replaceWith;
189
200
  exports.$throw = $throw;
201
+ exports.$toString = $toString;
190
202
  exports.buildQuery = buildQuery;
191
203
  exports.emplaceParams = emplaceParams;
192
204
  exports.extractParams = extractParams;
package/dist/index.mjs CHANGED
@@ -1,8 +1,13 @@
1
1
  // Cached native methods for performance optimization
2
2
  const $isArray = Array.isArray;
3
+ const $ArrayFrom = Array.from;
4
+ const $is = Object.is;
5
+ const $assign = Object.assign;
3
6
  const $hasOwn = Object.prototype.hasOwnProperty;
7
+ const $toString = Object.prototype.toString;
4
8
  const $keys = Object.keys;
5
9
  const $defines = Object.defineProperties;
10
+ const $define = Object.defineProperty;
6
11
  const $entries = Object.entries;
7
12
  const $isThenable = (o) => typeof o === 'object' && o !== null && typeof o.then === 'function';
8
13
 
@@ -19,6 +24,7 @@ const $emptyFn = (() => true);
19
24
 
20
25
  // DOM manipulation utilities
21
26
  // # dom natives
27
+ const $replaceWith = Element.prototype.replaceWith;
22
28
  /**
23
29
  * & Remove `bind` because it is shockingly slower than wrapper
24
30
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -157,6 +163,6 @@ const extractParams = (pattern, path) => {
157
163
 
158
164
  // Shared utilities and cached native methods for kt.js framework
159
165
  // Re-export all utilities
160
- Object.defineProperty(window, '@ktjs/shared', { value: '0.20.0' });
166
+ Object.defineProperty(window, '@ktjs/shared', { value: '0.20.2' });
161
167
 
162
- export { $append, $appendChild, $buttonDisabledGetter, $buttonDisabledSetter, $defines, $emptyFn, $entries, $hasOwn, $isArray, $isThenable, $keys, $throw, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
168
+ export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isThenable, $keys, $replaceWith, $throw, $toString, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/shared",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
4
4
  "description": "Shared utilities and cached native methods for kt.js framework",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",