@ktjs/shared 0.20.3 → 0.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -20,7 +20,12 @@ declare const $define: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor
20
20
  declare const $entries: <T>(o: T) => Array<[keyof T, T[keyof T]]>;
21
21
  declare const $isThenable: (o: any) => o is Promise<any>;
22
22
 
23
+ /**
24
+ * * Actually, these functions will be replaced as they are by @rollup/plugin-replace
25
+ * @see ./.scripts/replace.mjs
26
+ */
23
27
  declare const $throw: (message: string) => never;
28
+ declare const $warn: (message: string) => void;
24
29
 
25
30
  type otherstring = string & {};
26
31
 
@@ -88,6 +93,7 @@ type ChangeTriggerField = 'value' | 'checked' | 'selected' | 'valueAsDate' | 'va
88
93
 
89
94
  type InputElementTag = 'input' | 'select' | 'textarea';
90
95
 
96
+ declare const $isNode: (x: any) => boolean;
91
97
  /**
92
98
  * & Remove `bind` because it is shockingly slower than wrapper
93
99
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -136,5 +142,5 @@ declare const emplaceParams: (path: string, params: Record<string, string>) => s
136
142
  */
137
143
  declare const extractParams: (pattern: string, path: string) => Record<string, string> | null;
138
144
 
139
- export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isThenable, $keys, $throw, $toString, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
145
+ export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isNode, $isThenable, $keys, $throw, $toString, $warn, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
140
146
  export type { ChangeHandler, ChangeTriggerField, HTMLTag, InputElementTag, MathMLTag, NoTextNodeTag, NonSpecialTags, SVGTag, otherstring };
@@ -15,8 +15,15 @@ var __ktjs_shared__ = (function (exports) {
15
15
  const $isThenable = (o) => typeof o === 'object' && o !== null && typeof o.then === 'function';
16
16
 
17
17
  // Error handling utilities
18
+ /**
19
+ * * Actually, these functions will be replaced as they are by @rollup/plugin-replace
20
+ * @see ./.scripts/replace.mjs
21
+ */
18
22
  const $throw = (message) => {
19
- throw new Error('@ktjs/shared: ' + message);
23
+ throw new Error('[kt.js error]' + message);
24
+ };
25
+ const $warn = (message) => {
26
+ console.warn('[kt.js warn] ' + message);
20
27
  };
21
28
 
22
29
  // String manipulation utilities
@@ -27,6 +34,7 @@ var __ktjs_shared__ = (function (exports) {
27
34
 
28
35
  // DOM manipulation utilities
29
36
  // # dom natives
37
+ const $isNode = (x) => x?.nodeType > 0;
30
38
  /**
31
39
  * & Remove `bind` because it is shockingly slower than wrapper
32
40
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -172,8 +180,9 @@ var __ktjs_shared__ = (function (exports) {
172
180
  };
173
181
 
174
182
  // Shared utilities and cached native methods for kt.js framework
183
+ // import './misc/symbol-polyfill.js';
175
184
  // Re-export all utilities
176
- Object.defineProperty(window, '@ktjs/shared', { value: '0.20.3' });
185
+ Object.defineProperty(window, '__ktjs__', { value: '0.22.3' });
177
186
 
178
187
  exports.$ArrayFrom = $ArrayFrom;
179
188
  exports.$append = $append;
@@ -188,10 +197,12 @@ var __ktjs_shared__ = (function (exports) {
188
197
  exports.$hasOwn = $hasOwn;
189
198
  exports.$is = $is;
190
199
  exports.$isArray = $isArray;
200
+ exports.$isNode = $isNode;
191
201
  exports.$isThenable = $isThenable;
192
202
  exports.$keys = $keys;
193
203
  exports.$throw = $throw;
194
204
  exports.$toString = $toString;
205
+ exports.$warn = $warn;
195
206
  exports.applyModel = applyModel;
196
207
  exports.buildQuery = buildQuery;
197
208
  exports.emplaceParams = emplaceParams;
@@ -17,8 +17,15 @@ var __ktjs_shared__ = (function (exports) {
17
17
  };
18
18
 
19
19
  // Error handling utilities
20
+ /**
21
+ * * Actually, these functions will be replaced as they are by @rollup/plugin-replace
22
+ * @see ./.scripts/replace.mjs
23
+ */
20
24
  var $throw = function (message) {
21
- throw new Error('@ktjs/shared: ' + message);
25
+ throw new Error('[kt.js error]' + message);
26
+ };
27
+ var $warn = function (message) {
28
+ console.warn('[kt.js warn] ' + message);
22
29
  };
23
30
 
24
31
  // String manipulation utilities
@@ -30,6 +37,7 @@ var __ktjs_shared__ = (function (exports) {
30
37
  // DOM manipulation utilities
31
38
  var _a;
32
39
  // # dom natives
40
+ var $isNode = function (x) { return (x === null || x === void 0 ? void 0 : x.nodeType) > 0; };
33
41
  /**
34
42
  * & Remove `bind` because it is shockingly slower than wrapper
35
43
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -185,8 +193,9 @@ var __ktjs_shared__ = (function (exports) {
185
193
  };
186
194
 
187
195
  // Shared utilities and cached native methods for kt.js framework
196
+ // import './misc/symbol-polyfill.js';
188
197
  // Re-export all utilities
189
- Object.defineProperty(window, '@ktjs/shared', { value: '0.20.3' });
198
+ Object.defineProperty(window, '__ktjs__', { value: '0.22.3' });
190
199
 
191
200
  exports.$ArrayFrom = $ArrayFrom;
192
201
  exports.$append = $append;
@@ -201,10 +210,12 @@ var __ktjs_shared__ = (function (exports) {
201
210
  exports.$hasOwn = $hasOwn;
202
211
  exports.$is = $is;
203
212
  exports.$isArray = $isArray;
213
+ exports.$isNode = $isNode;
204
214
  exports.$isThenable = $isThenable;
205
215
  exports.$keys = $keys;
206
216
  exports.$throw = $throw;
207
217
  exports.$toString = $toString;
218
+ exports.$warn = $warn;
208
219
  exports.applyModel = applyModel;
209
220
  exports.buildQuery = buildQuery;
210
221
  exports.emplaceParams = emplaceParams;
package/dist/index.mjs CHANGED
@@ -12,8 +12,15 @@ const $entries = Object.entries;
12
12
  const $isThenable = (o) => typeof o === 'object' && o !== null && typeof o.then === 'function';
13
13
 
14
14
  // Error handling utilities
15
+ /**
16
+ * * Actually, these functions will be replaced as they are by @rollup/plugin-replace
17
+ * @see ./.scripts/replace.mjs
18
+ */
15
19
  const $throw = (message) => {
16
- throw new Error('@ktjs/shared: ' + message);
20
+ throw new Error('[kt.js error]' + message);
21
+ };
22
+ const $warn = (message) => {
23
+ console.warn('[kt.js warn] ' + message);
17
24
  };
18
25
 
19
26
  // String manipulation utilities
@@ -24,6 +31,7 @@ const $emptyFn = (() => true);
24
31
 
25
32
  // DOM manipulation utilities
26
33
  // # dom natives
34
+ const $isNode = (x) => x?.nodeType > 0;
27
35
  /**
28
36
  * & Remove `bind` because it is shockingly slower than wrapper
29
37
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -169,7 +177,8 @@ const extractParams = (pattern, path) => {
169
177
  };
170
178
 
171
179
  // Shared utilities and cached native methods for kt.js framework
180
+ // import './misc/symbol-polyfill.js';
172
181
  // Re-export all utilities
173
- Object.defineProperty(window, '@ktjs/shared', { value: '0.20.3' });
182
+ Object.defineProperty(window, '__ktjs__', { value: '0.22.3' });
174
183
 
175
- export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isThenable, $keys, $throw, $toString, applyModel, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
184
+ export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isNode, $isThenable, $keys, $throw, $toString, $warn, applyModel, 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.3",
3
+ "version": "0.22.3",
4
4
  "description": "Shared utilities and cached native methods for kt.js framework",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",