@weapp-core/shared 0.0.2-alpha.2 → 1.0.0

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.cjs CHANGED
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -59,7 +59,7 @@ var require_isobject = __commonJS({
59
59
  "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports2, module2) {
60
60
  "use strict";
61
61
  init_cjs_shims();
62
- module2.exports = function isObject(val) {
62
+ module2.exports = function isObject2(val) {
63
63
  return val != null && typeof val === "object" && Array.isArray(val) === false;
64
64
  };
65
65
  }
@@ -70,9 +70,9 @@ var require_is_plain_object = __commonJS({
70
70
  "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports2, module2) {
71
71
  "use strict";
72
72
  init_cjs_shims();
73
- var isObject = require_isobject();
73
+ var isObject2 = require_isobject();
74
74
  function isObjectObject(o) {
75
- return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
75
+ return isObject2(o) === true && Object.prototype.toString.call(o) === "[object Object]";
76
76
  }
77
77
  module2.exports = function isPlainObject2(o) {
78
78
  var ctor, prot;
@@ -97,7 +97,7 @@ var require_set_value = __commonJS({
97
97
  var { deleteProperty } = Reflect;
98
98
  var isPrimitive = require_is_primitive();
99
99
  var isPlainObject2 = require_is_plain_object();
100
- var isObject = (value) => {
100
+ var isObject2 = (value) => {
101
101
  return typeof value === "object" && value !== null || typeof value === "function";
102
102
  };
103
103
  var isUnsafeKey = (key) => {
@@ -188,7 +188,7 @@ var require_set_value = __commonJS({
188
188
  return obj;
189
189
  };
190
190
  var setValue = (target, path, value, options) => {
191
- if (!path || !isObject(target)) return target;
191
+ if (!path || !isObject2(target)) return target;
192
192
  const keys = split(path, options);
193
193
  let obj = target;
194
194
  for (let i = 0; i < keys.length; i++) {
@@ -203,7 +203,7 @@ var require_set_value = __commonJS({
203
203
  obj = obj[key] = [];
204
204
  continue;
205
205
  }
206
- if (!isObject(obj[key])) {
206
+ if (!isObject2(obj[key])) {
207
207
  obj[key] = {};
208
208
  }
209
209
  obj = obj[key];
@@ -224,9 +224,9 @@ var require_get_value = __commonJS({
224
224
  "../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports2, module2) {
225
225
  "use strict";
226
226
  init_cjs_shims();
227
- var isObject = require_isobject();
227
+ var isObject2 = require_isobject();
228
228
  module2.exports = function(target, path, options) {
229
- if (!isObject(options)) {
229
+ if (!isObject2(options)) {
230
230
  options = { default: options };
231
231
  }
232
232
  if (!isValidObject(target)) {
@@ -304,7 +304,7 @@ var require_get_value = __commonJS({
304
304
  return true;
305
305
  }
306
306
  function isValidObject(val) {
307
- return isObject(val) || Array.isArray(val) || typeof val === "function";
307
+ return isObject2(val) || Array.isArray(val) || typeof val === "function";
308
308
  }
309
309
  }
310
310
  });
@@ -318,6 +318,7 @@ __export(src_exports, {
318
318
  defuOverrideArray: () => defuOverrideArray,
319
319
  escapeStringRegexp: () => escapeStringRegexp,
320
320
  get: () => import_get_value.default,
321
+ isObject: () => isObject,
321
322
  removeExtension: () => removeExtension,
322
323
  set: () => import_set_value.default
323
324
  });
@@ -419,6 +420,9 @@ var defuOverrideArray = createDefu((obj, key, value) => {
419
420
  return true;
420
421
  }
421
422
  });
423
+ function isObject(x) {
424
+ return typeof x === "object" && x !== null;
425
+ }
422
426
  // Annotate the CommonJS export names for ESM import in node:
423
427
  0 && (module.exports = {
424
428
  addExtension,
@@ -427,6 +431,7 @@ var defuOverrideArray = createDefu((obj, key, value) => {
427
431
  defuOverrideArray,
428
432
  escapeStringRegexp,
429
433
  get,
434
+ isObject,
430
435
  removeExtension,
431
436
  set
432
437
  });
package/dist/index.d.cts CHANGED
@@ -12,10 +12,11 @@ declare const defuOverrideArray: <Source extends {
12
12
  [x: string]: any;
13
13
  [x: number]: any;
14
14
  [x: symbol]: any;
15
- }, Defaults extends ({
15
+ }, Defaults extends Array<{
16
16
  [x: string]: any;
17
17
  [x: number]: any;
18
18
  [x: symbol]: any;
19
- } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
19
+ } | (number | boolean | any[] | Record<never, any> | null | undefined)>>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
20
+ declare function isObject(x: unknown): x is Record<string | symbol | number, unknown>;
20
21
 
21
- export { addExtension, arrify, defuOverrideArray, escapeStringRegexp, removeExtension };
22
+ export { addExtension, arrify, defuOverrideArray, escapeStringRegexp, isObject, removeExtension };
package/dist/index.d.ts CHANGED
@@ -12,10 +12,11 @@ declare const defuOverrideArray: <Source extends {
12
12
  [x: string]: any;
13
13
  [x: number]: any;
14
14
  [x: symbol]: any;
15
- }, Defaults extends ({
15
+ }, Defaults extends Array<{
16
16
  [x: string]: any;
17
17
  [x: number]: any;
18
18
  [x: symbol]: any;
19
- } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
19
+ } | (number | boolean | any[] | Record<never, any> | null | undefined)>>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
20
+ declare function isObject(x: unknown): x is Record<string | symbol | number, unknown>;
20
21
 
21
- export { addExtension, arrify, defuOverrideArray, escapeStringRegexp, removeExtension };
22
+ export { addExtension, arrify, defuOverrideArray, escapeStringRegexp, isObject, removeExtension };
package/dist/index.js CHANGED
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js"() {
33
33
  "use strict";
34
34
  }
35
35
  });
@@ -53,7 +53,7 @@ var require_isobject = __commonJS({
53
53
  "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
54
54
  "use strict";
55
55
  init_esm_shims();
56
- module.exports = function isObject(val) {
56
+ module.exports = function isObject2(val) {
57
57
  return val != null && typeof val === "object" && Array.isArray(val) === false;
58
58
  };
59
59
  }
@@ -64,9 +64,9 @@ var require_is_plain_object = __commonJS({
64
64
  "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports, module) {
65
65
  "use strict";
66
66
  init_esm_shims();
67
- var isObject = require_isobject();
67
+ var isObject2 = require_isobject();
68
68
  function isObjectObject(o) {
69
- return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
69
+ return isObject2(o) === true && Object.prototype.toString.call(o) === "[object Object]";
70
70
  }
71
71
  module.exports = function isPlainObject2(o) {
72
72
  var ctor, prot;
@@ -91,7 +91,7 @@ var require_set_value = __commonJS({
91
91
  var { deleteProperty } = Reflect;
92
92
  var isPrimitive = require_is_primitive();
93
93
  var isPlainObject2 = require_is_plain_object();
94
- var isObject = (value) => {
94
+ var isObject2 = (value) => {
95
95
  return typeof value === "object" && value !== null || typeof value === "function";
96
96
  };
97
97
  var isUnsafeKey = (key) => {
@@ -182,7 +182,7 @@ var require_set_value = __commonJS({
182
182
  return obj;
183
183
  };
184
184
  var setValue = (target, path, value, options) => {
185
- if (!path || !isObject(target)) return target;
185
+ if (!path || !isObject2(target)) return target;
186
186
  const keys = split(path, options);
187
187
  let obj = target;
188
188
  for (let i = 0; i < keys.length; i++) {
@@ -197,7 +197,7 @@ var require_set_value = __commonJS({
197
197
  obj = obj[key] = [];
198
198
  continue;
199
199
  }
200
- if (!isObject(obj[key])) {
200
+ if (!isObject2(obj[key])) {
201
201
  obj[key] = {};
202
202
  }
203
203
  obj = obj[key];
@@ -218,9 +218,9 @@ var require_get_value = __commonJS({
218
218
  "../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports, module) {
219
219
  "use strict";
220
220
  init_esm_shims();
221
- var isObject = require_isobject();
221
+ var isObject2 = require_isobject();
222
222
  module.exports = function(target, path, options) {
223
- if (!isObject(options)) {
223
+ if (!isObject2(options)) {
224
224
  options = { default: options };
225
225
  }
226
226
  if (!isValidObject(target)) {
@@ -298,7 +298,7 @@ var require_get_value = __commonJS({
298
298
  return true;
299
299
  }
300
300
  function isValidObject(val) {
301
- return isObject(val) || Array.isArray(val) || typeof val === "function";
301
+ return isObject2(val) || Array.isArray(val) || typeof val === "function";
302
302
  }
303
303
  }
304
304
  });
@@ -401,6 +401,9 @@ var defuOverrideArray = createDefu((obj, key, value) => {
401
401
  return true;
402
402
  }
403
403
  });
404
+ function isObject(x) {
405
+ return typeof x === "object" && x !== null;
406
+ }
404
407
  var export_get = import_get_value.default;
405
408
  var export_set = import_set_value.default;
406
409
  export {
@@ -410,6 +413,7 @@ export {
410
413
  defuOverrideArray,
411
414
  escapeStringRegexp,
412
415
  export_get as get,
416
+ isObject,
413
417
  removeExtension,
414
418
  export_set as set
415
419
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/shared",
3
3
  "type": "module",
4
- "version": "0.0.2-alpha.2",
4
+ "version": "1.0.0",
5
5
  "description": "@weapp-core/shared",
6
6
  "author": "",
7
7
  "license": "ISC",