@weapp-core/shared 1.0.7 → 1.0.9

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.4.0_@swc+core@1.11.21_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.11.31_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.21_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.11.31_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -408,7 +408,7 @@ function removeExtension(file) {
408
408
  return file.replace(/\.[^/.]+$/, "");
409
409
  }
410
410
  function removeExtensionDeep(file) {
411
- return file.replace(/\.[^/.]+/g, "");
411
+ return file.replace(/(\.[^/.]+)+$/, "");
412
412
  }
413
413
  function addExtension(filename, ext = ".js") {
414
414
  let result = `${filename}`;
package/dist/index.js CHANGED
@@ -27,9 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.21_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.11.31_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/esm_shims.js
31
+ import path from "path";
32
+ import { fileURLToPath } from "url";
31
33
  var init_esm_shims = __esm({
32
- "../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.21_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.11.31_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/esm_shims.js"() {
33
35
  "use strict";
34
36
  }
35
37
  });
@@ -181,9 +183,9 @@ var require_set_value = __commonJS({
181
183
  }
182
184
  return obj;
183
185
  };
184
- var setValue = (target, path, value, options) => {
185
- if (!path || !isObject3(target)) return target;
186
- const keys = split2(path, options);
186
+ var setValue = (target, path2, value, options) => {
187
+ if (!path2 || !isObject3(target)) return target;
188
+ const keys = split2(path2, options);
187
189
  let obj = target;
188
190
  for (let i = 0; i < keys.length; i++) {
189
191
  const key = keys[i];
@@ -215,7 +217,7 @@ var require_set_value = __commonJS({
215
217
 
216
218
  // src/index.ts
217
219
  init_esm_shims();
218
- import { extname } from "node:path";
220
+ import { extname } from "path";
219
221
 
220
222
  // ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
221
223
  init_esm_shims();
@@ -300,11 +302,11 @@ var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
300
302
  }
301
303
  return segs[0] + joinChar + segs[1];
302
304
  }, "join");
303
- var split = /* @__PURE__ */ __name((path, splitChar, options) => {
305
+ var split = /* @__PURE__ */ __name((path2, splitChar, options) => {
304
306
  if (typeof options.split === "function") {
305
- return options.split(path);
307
+ return options.split(path2);
306
308
  }
307
- return path.split(splitChar);
309
+ return path2.split(splitChar);
308
310
  }, "split");
309
311
  var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
310
312
  if (typeof options?.isValid === "function") {
@@ -315,27 +317,27 @@ var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
315
317
  var isValidObject = /* @__PURE__ */ __name((v) => {
316
318
  return isObject(v) || typeof v === "function";
317
319
  }, "isValidObject");
318
- var getValue = /* @__PURE__ */ __name((target, path, options = {}) => {
320
+ var getValue = /* @__PURE__ */ __name((target, path2, options = {}) => {
319
321
  if (!isObject(options)) {
320
322
  options = { default: options };
321
323
  }
322
324
  if (!isValidObject(target)) {
323
325
  return typeof options.default !== "undefined" ? options.default : target;
324
326
  }
325
- if (typeof path === "number") {
326
- path = String(path);
327
+ if (typeof path2 === "number") {
328
+ path2 = String(path2);
327
329
  }
328
- const pathIsArray = Array.isArray(path);
329
- const pathIsString = typeof path === "string";
330
+ const pathIsArray = Array.isArray(path2);
331
+ const pathIsString = typeof path2 === "string";
330
332
  const splitChar = options.separator || ".";
331
333
  const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
332
334
  if (!pathIsString && !pathIsArray) {
333
335
  return target;
334
336
  }
335
- if (target[path] !== void 0) {
336
- return isValid(path, target, options) ? target[path] : options.default;
337
+ if (target[path2] !== void 0) {
338
+ return isValid(path2, target, options) ? target[path2] : options.default;
337
339
  }
338
- const segs = pathIsArray ? path : split(path, splitChar, options);
340
+ const segs = pathIsArray ? path2 : split(path2, splitChar, options);
339
341
  const len = segs.length;
340
342
  let idx = 0;
341
343
  do {
@@ -386,7 +388,7 @@ function removeExtension(file) {
386
388
  return file.replace(/\.[^/.]+$/, "");
387
389
  }
388
390
  function removeExtensionDeep(file) {
389
- return file.replace(/\.[^/.]+/g, "");
391
+ return file.replace(/(\.[^/.]+)+$/, "");
390
392
  }
391
393
  function addExtension(filename, ext = ".js") {
392
394
  let result = `${filename}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/shared",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "description": "@weapp-core/shared",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",