@weapp-core/shared 3.0.0 → 3.0.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/README.md +41 -0
- package/dist/index.d.ts +101 -16
- package/dist/index.js +318 -441
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @weapp-core/shared
|
|
2
|
+
|
|
3
|
+
## 简介
|
|
4
|
+
|
|
5
|
+
`@weapp-core/shared` 汇总 weapp-vite 生态内的通用工具函数与依赖封装,供多个包复用。
|
|
6
|
+
|
|
7
|
+
## 特性
|
|
8
|
+
|
|
9
|
+
- 常用字符串与路径处理工具
|
|
10
|
+
- 对象合并与判定工具
|
|
11
|
+
- 统一导出常用第三方工具(`defu`、`get`、`set`、`object-hash`)
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @weapp-core/shared
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 使用
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
addExtension,
|
|
24
|
+
defu,
|
|
25
|
+
escapeStringRegexp,
|
|
26
|
+
objectHash,
|
|
27
|
+
removeExtension,
|
|
28
|
+
} from '@weapp-core/shared'
|
|
29
|
+
|
|
30
|
+
const name = addExtension('pages/index/index')
|
|
31
|
+
const cleaned = removeExtension('app.json')
|
|
32
|
+
const hash = objectHash({ foo: 'bar' })
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 配置
|
|
36
|
+
|
|
37
|
+
暂无额外配置。
|
|
38
|
+
|
|
39
|
+
## 相关链接
|
|
40
|
+
|
|
41
|
+
- 仓库:https://github.com/weapp-vite/weapp-vite
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,110 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { default as objectHash } from 'object-hash';
|
|
4
|
-
export { default as get } from 'get-value';
|
|
5
|
-
export { default as set } from 'set-value';
|
|
1
|
+
import objectHash from "object-hash";
|
|
2
|
+
import set from "set-value";
|
|
6
3
|
|
|
4
|
+
//#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.d.ts
|
|
5
|
+
type Input = Record<string | number | symbol, any>;
|
|
6
|
+
type IgnoredInput = boolean | number | null | any[] | Record<never, any> | undefined;
|
|
7
|
+
type Merger = <T extends Input, K extends keyof T>(object: T, key: keyof T, value: T[K], namespace: string) => any;
|
|
8
|
+
type nullish = null | undefined | void;
|
|
9
|
+
type MergeObjects<Destination extends Input, Defaults extends Input> = Destination extends Defaults ? Destination : Omit<Destination, keyof Destination & keyof Defaults> & Omit<Defaults, keyof Destination & keyof Defaults> & { -readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge<Destination[Key], Defaults[Key]> };
|
|
10
|
+
type Defu<S extends Input, D extends Array<Input | IgnoredInput>> = D extends [infer F, ...infer Rest] ? F extends Input ? Rest extends Array<Input | IgnoredInput> ? Defu<MergeObjects<S, F>, Rest> : MergeObjects<S, F> : F extends IgnoredInput ? Rest extends Array<Input | IgnoredInput> ? Defu<S, Rest> : S : S : S;
|
|
11
|
+
type DefuFn = <Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source, ...defaults: Defaults) => Defu<Source, Defaults>;
|
|
12
|
+
interface DefuInstance {
|
|
13
|
+
<Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source | IgnoredInput, ...defaults: Defaults): Defu<Source, Defaults>;
|
|
14
|
+
fn: DefuFn;
|
|
15
|
+
arrayFn: DefuFn;
|
|
16
|
+
extend(merger?: Merger): DefuFn;
|
|
17
|
+
}
|
|
18
|
+
type MergeArrays<Destination, Source> = Destination extends Array<infer DestinationType> ? Source extends Array<infer SourceType> ? Array<DestinationType | SourceType> : Source | Array<DestinationType> : Source | Destination;
|
|
19
|
+
type Merge<Destination extends Input, Defaults extends Input> = Destination extends nullish ? Defaults extends nullish ? nullish : Defaults : Defaults extends nullish ? Destination : Destination extends Array<any> ? Defaults extends Array<any> ? MergeArrays<Destination, Defaults> : Destination | Defaults : Destination extends Function ? Destination | Defaults : Destination extends RegExp ? Destination | Defaults : Destination extends Promise<any> ? Destination | Defaults : Defaults extends Function ? Destination | Defaults : Defaults extends RegExp ? Destination | Defaults : Defaults extends Promise<any> ? Destination | Defaults : Destination extends Input ? Defaults extends Input ? MergeObjects<Destination, Defaults> : Destination | Defaults : Destination | Defaults;
|
|
20
|
+
declare const defu: DefuInstance;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../../node_modules/.pnpm/get-value@4.0.1/node_modules/get-value/index.d.ts
|
|
23
|
+
declare function get<T>(obj: T): T;
|
|
24
|
+
declare function get(obj: object, key: string | string[], options?: get.Options): any;
|
|
25
|
+
declare namespace get {
|
|
26
|
+
interface Options {
|
|
27
|
+
/**
|
|
28
|
+
* The default value to return when get-value cannot result a value from the given object.
|
|
29
|
+
*
|
|
30
|
+
* default: `undefined`
|
|
31
|
+
*/
|
|
32
|
+
default?: any;
|
|
33
|
+
/**
|
|
34
|
+
* If defined, this function is called on each resolved value.
|
|
35
|
+
* Useful if you want to do `.hasOwnProperty` or `Object.prototype.propertyIsEnumerable`.
|
|
36
|
+
*/
|
|
37
|
+
isValid?: (<K extends string>(key: K, object: Record<K, any>) => boolean) | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Custom function to use for splitting the string into object path segments.
|
|
40
|
+
*
|
|
41
|
+
* default: `String.split`
|
|
42
|
+
*/
|
|
43
|
+
split?: ((s: string) => string[]) | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The separator to use for spliting the string.
|
|
46
|
+
* (this is probably not needed when `options.split` is used).
|
|
47
|
+
*
|
|
48
|
+
* default: `"."`
|
|
49
|
+
*/
|
|
50
|
+
separator?: string | RegExp | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Customize how the object path is created when iterating over path segments.
|
|
53
|
+
*
|
|
54
|
+
* default: `Array.join`
|
|
55
|
+
*/
|
|
56
|
+
join?: ((segs: string[]) => string) | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The character to use when re-joining the string to check for keys
|
|
59
|
+
* with dots in them (this is probably not needed when `options.join` is used).
|
|
60
|
+
* This can be a different value than the separator, since the separator can be a string or regex.
|
|
61
|
+
*
|
|
62
|
+
* default: `"."`
|
|
63
|
+
*/
|
|
64
|
+
joinChar?: string | undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/index.d.ts
|
|
69
|
+
/**
|
|
70
|
+
* @description 转义字符串中的正则特殊字符
|
|
71
|
+
*/
|
|
7
72
|
declare function escapeStringRegexp(str: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* @description 移除文件名的最后一个扩展名
|
|
75
|
+
*/
|
|
8
76
|
declare function removeExtension(file: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* @description 移除文件名的所有扩展名(多重后缀)
|
|
79
|
+
*/
|
|
9
80
|
declare function removeExtensionDeep(file: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* @description 若缺少扩展名则追加(默认 .js)
|
|
83
|
+
*/
|
|
10
84
|
declare function addExtension(filename: string, ext?: string): string;
|
|
11
|
-
|
|
12
|
-
|
|
85
|
+
/**
|
|
86
|
+
* @description 将单个值转换为数组
|
|
87
|
+
*/
|
|
88
|
+
declare function arrify<T>(val: T | readonly T[]): T[];
|
|
89
|
+
/**
|
|
90
|
+
* @description defu 合并策略:当目标/来源为数组时直接覆盖
|
|
91
|
+
*/
|
|
13
92
|
declare const defuOverrideArray: <Source extends {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
93
|
+
[x: string]: any;
|
|
94
|
+
[x: number]: any;
|
|
95
|
+
[x: symbol]: any;
|
|
17
96
|
}, Defaults extends Array<{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} | (number | boolean | any[] | Record<never, any> | null | undefined)>>(source: Source, ...defaults: Defaults) =>
|
|
97
|
+
[x: string]: any;
|
|
98
|
+
[x: number]: any;
|
|
99
|
+
[x: symbol]: any;
|
|
100
|
+
} | (number | boolean | any[] | Record<never, any> | null | undefined)>>(source: Source, ...defaults: Defaults) => Defu<Source, Defaults>;
|
|
101
|
+
/**
|
|
102
|
+
* @description 判断是否为非 null 的对象
|
|
103
|
+
*/
|
|
22
104
|
declare function isObject(x: unknown): x is Record<string | symbol | number, unknown>;
|
|
105
|
+
/**
|
|
106
|
+
* @description 判断对象是否为空对象
|
|
107
|
+
*/
|
|
23
108
|
declare function isEmptyObject(obj: unknown): boolean;
|
|
24
|
-
|
|
25
|
-
export { addExtension, arrify, defuOverrideArray, escapeStringRegexp, isEmptyObject, isObject, removeExtension, removeExtensionDeep };
|
|
109
|
+
//#endregion
|
|
110
|
+
export { addExtension, arrify, defu, defuOverrideArray, escapeStringRegexp, get, isEmptyObject, isObject, objectHash, removeExtension, removeExtensionDeep, set };
|
package/dist/index.js
CHANGED
|
@@ -1,478 +1,355 @@
|
|
|
1
|
+
import { extname } from "node:path";
|
|
2
|
+
import objectHash from "object-hash";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
1
4
|
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProp$1 = Object.defineProperty;
|
|
3
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
-
};
|
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
13
11
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
+
key = keys[i];
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp$1(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
20
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
|
|
30
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.8_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js
|
|
31
|
-
import path from "path";
|
|
32
|
-
import { fileURLToPath } from "url";
|
|
33
|
-
var init_esm_shims = __esm({
|
|
34
|
-
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.8_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
35
|
-
"use strict";
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// ../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js
|
|
40
|
-
var require_is_primitive = __commonJS({
|
|
41
|
-
"../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js"(exports, module) {
|
|
42
|
-
"use strict";
|
|
43
|
-
init_esm_shims();
|
|
44
|
-
module.exports = function isPrimitive(val) {
|
|
45
|
-
if (typeof val === "object") {
|
|
46
|
-
return val === null;
|
|
47
|
-
}
|
|
48
|
-
return typeof val !== "function";
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
54
|
-
var require_isobject = __commonJS({
|
|
55
|
-
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
|
|
56
|
-
"use strict";
|
|
57
|
-
init_esm_shims();
|
|
58
|
-
module.exports = function isObject3(val) {
|
|
59
|
-
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// ../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js
|
|
65
|
-
var require_is_plain_object = __commonJS({
|
|
66
|
-
"../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports, module) {
|
|
67
|
-
"use strict";
|
|
68
|
-
init_esm_shims();
|
|
69
|
-
var isObject3 = require_isobject();
|
|
70
|
-
function isObjectObject(o) {
|
|
71
|
-
return isObject3(o) === true && Object.prototype.toString.call(o) === "[object Object]";
|
|
72
|
-
}
|
|
73
|
-
module.exports = function isPlainObject2(o) {
|
|
74
|
-
var ctor, prot;
|
|
75
|
-
if (isObjectObject(o) === false) return false;
|
|
76
|
-
ctor = o.constructor;
|
|
77
|
-
if (typeof ctor !== "function") return false;
|
|
78
|
-
prot = ctor.prototype;
|
|
79
|
-
if (isObjectObject(prot) === false) return false;
|
|
80
|
-
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// ../../node_modules/.pnpm/set-value@4.1.0/node_modules/set-value/index.js
|
|
89
|
-
var require_set_value = __commonJS({
|
|
90
|
-
"../../node_modules/.pnpm/set-value@4.1.0/node_modules/set-value/index.js"(exports, module) {
|
|
91
|
-
"use strict";
|
|
92
|
-
init_esm_shims();
|
|
93
|
-
var { deleteProperty } = Reflect;
|
|
94
|
-
var isPrimitive = require_is_primitive();
|
|
95
|
-
var isPlainObject2 = require_is_plain_object();
|
|
96
|
-
var isObject3 = (value) => {
|
|
97
|
-
return typeof value === "object" && value !== null || typeof value === "function";
|
|
98
|
-
};
|
|
99
|
-
var isUnsafeKey = (key) => {
|
|
100
|
-
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
101
|
-
};
|
|
102
|
-
var validateKey = (key) => {
|
|
103
|
-
if (!isPrimitive(key)) {
|
|
104
|
-
throw new TypeError("Object keys must be strings or symbols");
|
|
105
|
-
}
|
|
106
|
-
if (isUnsafeKey(key)) {
|
|
107
|
-
throw new Error(`Cannot set unsafe key: "${key}"`);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
var toStringKey = (input) => {
|
|
111
|
-
return Array.isArray(input) ? input.flat().map(String).join(",") : input;
|
|
112
|
-
};
|
|
113
|
-
var createMemoKey = (input, options) => {
|
|
114
|
-
if (typeof input !== "string" || !options) return input;
|
|
115
|
-
let key = input + ";";
|
|
116
|
-
if (options.arrays !== void 0) key += `arrays=${options.arrays};`;
|
|
117
|
-
if (options.separator !== void 0) key += `separator=${options.separator};`;
|
|
118
|
-
if (options.split !== void 0) key += `split=${options.split};`;
|
|
119
|
-
if (options.merge !== void 0) key += `merge=${options.merge};`;
|
|
120
|
-
if (options.preservePaths !== void 0) key += `preservePaths=${options.preservePaths};`;
|
|
121
|
-
return key;
|
|
122
|
-
};
|
|
123
|
-
var memoize = (input, options, fn) => {
|
|
124
|
-
const key = toStringKey(options ? createMemoKey(input, options) : input);
|
|
125
|
-
validateKey(key);
|
|
126
|
-
const value = setValue.cache.get(key) || fn();
|
|
127
|
-
setValue.cache.set(key, value);
|
|
128
|
-
return value;
|
|
129
|
-
};
|
|
130
|
-
var splitString = (input, options = {}) => {
|
|
131
|
-
const sep = options.separator || ".";
|
|
132
|
-
const preserve = sep === "/" ? false : options.preservePaths;
|
|
133
|
-
if (typeof input === "string" && preserve !== false && /\//.test(input)) {
|
|
134
|
-
return [input];
|
|
135
|
-
}
|
|
136
|
-
const parts = [];
|
|
137
|
-
let part = "";
|
|
138
|
-
const push = (part2) => {
|
|
139
|
-
let number;
|
|
140
|
-
if (part2.trim() !== "" && Number.isInteger(number = Number(part2))) {
|
|
141
|
-
parts.push(number);
|
|
142
|
-
} else {
|
|
143
|
-
parts.push(part2);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
for (let i = 0; i < input.length; i++) {
|
|
147
|
-
const value = input[i];
|
|
148
|
-
if (value === "\\") {
|
|
149
|
-
part += input[++i];
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
if (value === sep) {
|
|
153
|
-
push(part);
|
|
154
|
-
part = "";
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
part += value;
|
|
158
|
-
}
|
|
159
|
-
if (part) {
|
|
160
|
-
push(part);
|
|
161
|
-
}
|
|
162
|
-
return parts;
|
|
163
|
-
};
|
|
164
|
-
var split2 = (input, options) => {
|
|
165
|
-
if (options && typeof options.split === "function") return options.split(input);
|
|
166
|
-
if (typeof input === "symbol") return [input];
|
|
167
|
-
if (Array.isArray(input)) return input;
|
|
168
|
-
return memoize(input, options, () => splitString(input, options));
|
|
169
|
-
};
|
|
170
|
-
var assignProp = (obj, prop, value, options) => {
|
|
171
|
-
validateKey(prop);
|
|
172
|
-
if (value === void 0) {
|
|
173
|
-
deleteProperty(obj, prop);
|
|
174
|
-
} else if (options && options.merge) {
|
|
175
|
-
const merge = options.merge === "function" ? options.merge : Object.assign;
|
|
176
|
-
if (merge && isPlainObject2(obj[prop]) && isPlainObject2(value)) {
|
|
177
|
-
obj[prop] = merge(obj[prop], value);
|
|
178
|
-
} else {
|
|
179
|
-
obj[prop] = value;
|
|
180
|
-
}
|
|
181
|
-
} else {
|
|
182
|
-
obj[prop] = value;
|
|
183
|
-
}
|
|
184
|
-
return obj;
|
|
185
|
-
};
|
|
186
|
-
var setValue = (target, path2, value, options) => {
|
|
187
|
-
if (!path2 || !isObject3(target)) return target;
|
|
188
|
-
const keys = split2(path2, options);
|
|
189
|
-
let obj = target;
|
|
190
|
-
for (let i = 0; i < keys.length; i++) {
|
|
191
|
-
const key = keys[i];
|
|
192
|
-
const next = keys[i + 1];
|
|
193
|
-
validateKey(key);
|
|
194
|
-
if (next === void 0) {
|
|
195
|
-
assignProp(obj, key, value, options);
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
if (typeof next === "number" && !Array.isArray(obj[key])) {
|
|
199
|
-
obj = obj[key] = [];
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
if (!isObject3(obj[key])) {
|
|
203
|
-
obj[key] = {};
|
|
204
|
-
}
|
|
205
|
-
obj = obj[key];
|
|
206
|
-
}
|
|
207
|
-
return target;
|
|
208
|
-
};
|
|
209
|
-
setValue.split = split2;
|
|
210
|
-
setValue.cache = /* @__PURE__ */ new Map();
|
|
211
|
-
setValue.clear = () => {
|
|
212
|
-
setValue.cache = /* @__PURE__ */ new Map();
|
|
213
|
-
};
|
|
214
|
-
module.exports = setValue;
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
// src/index.ts
|
|
219
|
-
init_esm_shims();
|
|
220
|
-
import { extname } from "path";
|
|
221
|
-
|
|
222
|
-
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
223
|
-
init_esm_shims();
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
|
|
22
|
+
value: mod,
|
|
23
|
+
enumerable: true
|
|
24
|
+
}) : target, mod));
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
224
27
|
function isPlainObject(value) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
if (Symbol.iterator in value) {
|
|
233
|
-
return false;
|
|
234
|
-
}
|
|
235
|
-
if (Symbol.toStringTag in value) {
|
|
236
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
237
|
-
}
|
|
238
|
-
return true;
|
|
28
|
+
if (value === null || typeof value !== "object") return false;
|
|
29
|
+
const prototype = Object.getPrototypeOf(value);
|
|
30
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
31
|
+
if (Symbol.iterator in value) return false;
|
|
32
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
33
|
+
return true;
|
|
239
34
|
}
|
|
240
35
|
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
257
|
-
object[key] = [...value, ...object[key]];
|
|
258
|
-
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
259
|
-
object[key] = _defu(
|
|
260
|
-
value,
|
|
261
|
-
object[key],
|
|
262
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
263
|
-
merger
|
|
264
|
-
);
|
|
265
|
-
} else {
|
|
266
|
-
object[key] = value;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
return object;
|
|
36
|
+
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
37
|
+
const object = Object.assign({}, defaults);
|
|
38
|
+
for (const key in baseObject) {
|
|
39
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
40
|
+
const value = baseObject[key];
|
|
41
|
+
if (value === null || value === void 0) continue;
|
|
42
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
43
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
44
|
+
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
45
|
+
else object[key] = value;
|
|
46
|
+
}
|
|
47
|
+
return object;
|
|
270
48
|
}
|
|
271
49
|
function createDefu(merger) {
|
|
272
|
-
|
|
273
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
274
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
275
|
-
);
|
|
50
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
276
51
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
52
|
+
const defu = createDefu();
|
|
53
|
+
createDefu((object, key, currentValue) => {
|
|
54
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
55
|
+
object[key] = currentValue(object[key]);
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
283
58
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
59
|
+
createDefu((object, key, currentValue) => {
|
|
60
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
61
|
+
object[key] = currentValue(object[key]);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
289
64
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
var
|
|
298
|
-
var isObject = /* @__PURE__ */ __name((v) => v !== null && typeof v === "object", "isObject");
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region ../../node_modules/.pnpm/get-value@4.0.1/node_modules/get-value/dist/index.mjs
|
|
67
|
+
var __defProp = Object.defineProperty;
|
|
68
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
69
|
+
value,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
72
|
+
var isObject$1 = /* @__PURE__ */ __name((v) => v !== null && typeof v === "object", "isObject");
|
|
299
73
|
var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
return segs[0] + joinChar + segs[1];
|
|
74
|
+
if (typeof options.join === "function") return options.join(segs);
|
|
75
|
+
return segs[0] + joinChar + segs[1];
|
|
304
76
|
}, "join");
|
|
305
|
-
var split = /* @__PURE__ */ __name((
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
return path2.split(splitChar);
|
|
77
|
+
var split = /* @__PURE__ */ __name((path, splitChar, options) => {
|
|
78
|
+
if (typeof options.split === "function") return options.split(path);
|
|
79
|
+
return path.split(splitChar);
|
|
310
80
|
}, "split");
|
|
311
81
|
var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
return true;
|
|
82
|
+
if (typeof options?.isValid === "function") return options.isValid(key, target);
|
|
83
|
+
return true;
|
|
316
84
|
}, "isValid");
|
|
317
85
|
var isValidObject = /* @__PURE__ */ __name((v) => {
|
|
318
|
-
|
|
86
|
+
return isObject$1(v) || typeof v === "function";
|
|
319
87
|
}, "isValidObject");
|
|
320
|
-
var
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
let hasProp = false;
|
|
358
|
-
let n = idx + 1;
|
|
359
|
-
while (n < len) {
|
|
360
|
-
prop = join([prop, segs[n++]], joinChar, options);
|
|
361
|
-
if (hasProp = target[prop] !== void 0) {
|
|
362
|
-
if (!isValid(prop, target, options)) {
|
|
363
|
-
return options.default;
|
|
364
|
-
}
|
|
365
|
-
target = target[prop];
|
|
366
|
-
idx = n - 1;
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
if (!hasProp) {
|
|
371
|
-
return options.default;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
} while (++idx < len && isValidObject(target));
|
|
375
|
-
if (idx === len) {
|
|
376
|
-
return target;
|
|
377
|
-
}
|
|
378
|
-
return options.default;
|
|
88
|
+
var index_default = /* @__PURE__ */ __name((target, path, options = {}) => {
|
|
89
|
+
if (!isObject$1(options)) options = { default: options };
|
|
90
|
+
if (!isValidObject(target)) return typeof options.default !== "undefined" ? options.default : target;
|
|
91
|
+
if (typeof path === "number") path = String(path);
|
|
92
|
+
const pathIsArray = Array.isArray(path);
|
|
93
|
+
const pathIsString = typeof path === "string";
|
|
94
|
+
const splitChar = options.separator || ".";
|
|
95
|
+
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
96
|
+
if (!pathIsString && !pathIsArray) return target;
|
|
97
|
+
if (target[path] !== void 0) return isValid(path, target, options) ? target[path] : options.default;
|
|
98
|
+
const segs = pathIsArray ? path : split(path, splitChar, options);
|
|
99
|
+
const len = segs.length;
|
|
100
|
+
let idx = 0;
|
|
101
|
+
do {
|
|
102
|
+
let prop = segs[idx];
|
|
103
|
+
if (typeof prop !== "string") prop = String(prop);
|
|
104
|
+
while (prop && prop.slice(-1) === "\\") prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
|
|
105
|
+
if (target[prop] !== void 0) {
|
|
106
|
+
if (!isValid(prop, target, options)) return options.default;
|
|
107
|
+
target = target[prop];
|
|
108
|
+
} else {
|
|
109
|
+
let hasProp = false;
|
|
110
|
+
let n = idx + 1;
|
|
111
|
+
while (n < len) {
|
|
112
|
+
prop = join([prop, segs[n++]], joinChar, options);
|
|
113
|
+
if (hasProp = target[prop] !== void 0) {
|
|
114
|
+
if (!isValid(prop, target, options)) return options.default;
|
|
115
|
+
target = target[prop];
|
|
116
|
+
idx = n - 1;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (!hasProp) return options.default;
|
|
121
|
+
}
|
|
122
|
+
} while (++idx < len && isValidObject(target));
|
|
123
|
+
if (idx === len) return target;
|
|
124
|
+
return options.default;
|
|
379
125
|
}, "getValue");
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
126
|
+
/*!
|
|
127
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
128
|
+
*
|
|
129
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
130
|
+
* Released under the MIT License.
|
|
131
|
+
*/
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region ../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js
|
|
134
|
+
/*!
|
|
135
|
+
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
|
136
|
+
*
|
|
137
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
138
|
+
* Released under the MIT License.
|
|
139
|
+
*/
|
|
140
|
+
var require_is_primitive = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
141
|
+
module.exports = function isPrimitive(val) {
|
|
142
|
+
if (typeof val === "object") return val === null;
|
|
143
|
+
return typeof val !== "function";
|
|
144
|
+
};
|
|
145
|
+
}));
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
148
|
+
/*!
|
|
149
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
150
|
+
*
|
|
151
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
152
|
+
* Released under the MIT License.
|
|
153
|
+
*/
|
|
154
|
+
var require_isobject = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
155
|
+
module.exports = function isObject(val) {
|
|
156
|
+
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
157
|
+
};
|
|
158
|
+
}));
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js
|
|
161
|
+
/*!
|
|
162
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
163
|
+
*
|
|
164
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
165
|
+
* Released under the MIT License.
|
|
166
|
+
*/
|
|
167
|
+
var require_is_plain_object = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
168
|
+
var isObject = require_isobject();
|
|
169
|
+
function isObjectObject(o) {
|
|
170
|
+
return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
|
|
171
|
+
}
|
|
172
|
+
module.exports = function isPlainObject(o) {
|
|
173
|
+
var ctor, prot;
|
|
174
|
+
if (isObjectObject(o) === false) return false;
|
|
175
|
+
ctor = o.constructor;
|
|
176
|
+
if (typeof ctor !== "function") return false;
|
|
177
|
+
prot = ctor.prototype;
|
|
178
|
+
if (isObjectObject(prot) === false) return false;
|
|
179
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
|
|
180
|
+
return true;
|
|
181
|
+
};
|
|
182
|
+
}));
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/index.ts
|
|
185
|
+
var import_set_value = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
186
|
+
const { deleteProperty } = Reflect;
|
|
187
|
+
const isPrimitive = require_is_primitive();
|
|
188
|
+
const isPlainObject = require_is_plain_object();
|
|
189
|
+
const isObject = (value) => {
|
|
190
|
+
return typeof value === "object" && value !== null || typeof value === "function";
|
|
191
|
+
};
|
|
192
|
+
const isUnsafeKey = (key) => {
|
|
193
|
+
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
194
|
+
};
|
|
195
|
+
const validateKey = (key) => {
|
|
196
|
+
if (!isPrimitive(key)) throw new TypeError("Object keys must be strings or symbols");
|
|
197
|
+
if (isUnsafeKey(key)) throw new Error(`Cannot set unsafe key: "${key}"`);
|
|
198
|
+
};
|
|
199
|
+
const toStringKey = (input) => {
|
|
200
|
+
return Array.isArray(input) ? input.flat().map(String).join(",") : input;
|
|
201
|
+
};
|
|
202
|
+
const createMemoKey = (input, options) => {
|
|
203
|
+
if (typeof input !== "string" || !options) return input;
|
|
204
|
+
let key = input + ";";
|
|
205
|
+
if (options.arrays !== void 0) key += `arrays=${options.arrays};`;
|
|
206
|
+
if (options.separator !== void 0) key += `separator=${options.separator};`;
|
|
207
|
+
if (options.split !== void 0) key += `split=${options.split};`;
|
|
208
|
+
if (options.merge !== void 0) key += `merge=${options.merge};`;
|
|
209
|
+
if (options.preservePaths !== void 0) key += `preservePaths=${options.preservePaths};`;
|
|
210
|
+
return key;
|
|
211
|
+
};
|
|
212
|
+
const memoize = (input, options, fn) => {
|
|
213
|
+
const key = toStringKey(options ? createMemoKey(input, options) : input);
|
|
214
|
+
validateKey(key);
|
|
215
|
+
const value = setValue.cache.get(key) || fn();
|
|
216
|
+
setValue.cache.set(key, value);
|
|
217
|
+
return value;
|
|
218
|
+
};
|
|
219
|
+
const splitString = (input, options = {}) => {
|
|
220
|
+
const sep = options.separator || ".";
|
|
221
|
+
const preserve = sep === "/" ? false : options.preservePaths;
|
|
222
|
+
if (typeof input === "string" && preserve !== false && /\//.test(input)) return [input];
|
|
223
|
+
const parts = [];
|
|
224
|
+
let part = "";
|
|
225
|
+
const push = (part) => {
|
|
226
|
+
let number;
|
|
227
|
+
if (part.trim() !== "" && Number.isInteger(number = Number(part))) parts.push(number);
|
|
228
|
+
else parts.push(part);
|
|
229
|
+
};
|
|
230
|
+
for (let i = 0; i < input.length; i++) {
|
|
231
|
+
const value = input[i];
|
|
232
|
+
if (value === "\\") {
|
|
233
|
+
part += input[++i];
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (value === sep) {
|
|
237
|
+
push(part);
|
|
238
|
+
part = "";
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
part += value;
|
|
242
|
+
}
|
|
243
|
+
if (part) push(part);
|
|
244
|
+
return parts;
|
|
245
|
+
};
|
|
246
|
+
const split = (input, options) => {
|
|
247
|
+
if (options && typeof options.split === "function") return options.split(input);
|
|
248
|
+
if (typeof input === "symbol") return [input];
|
|
249
|
+
if (Array.isArray(input)) return input;
|
|
250
|
+
return memoize(input, options, () => splitString(input, options));
|
|
251
|
+
};
|
|
252
|
+
const assignProp = (obj, prop, value, options) => {
|
|
253
|
+
validateKey(prop);
|
|
254
|
+
if (value === void 0) deleteProperty(obj, prop);
|
|
255
|
+
else if (options && options.merge) {
|
|
256
|
+
const merge = options.merge === "function" ? options.merge : Object.assign;
|
|
257
|
+
if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) obj[prop] = merge(obj[prop], value);
|
|
258
|
+
else obj[prop] = value;
|
|
259
|
+
} else obj[prop] = value;
|
|
260
|
+
return obj;
|
|
261
|
+
};
|
|
262
|
+
const setValue = (target, path, value, options) => {
|
|
263
|
+
if (!path || !isObject(target)) return target;
|
|
264
|
+
const keys = split(path, options);
|
|
265
|
+
let obj = target;
|
|
266
|
+
for (let i = 0; i < keys.length; i++) {
|
|
267
|
+
const key = keys[i];
|
|
268
|
+
const next = keys[i + 1];
|
|
269
|
+
validateKey(key);
|
|
270
|
+
if (next === void 0) {
|
|
271
|
+
assignProp(obj, key, value, options);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
if (typeof next === "number" && !Array.isArray(obj[key])) {
|
|
275
|
+
obj = obj[key] = [];
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (!isObject(obj[key])) obj[key] = {};
|
|
279
|
+
obj = obj[key];
|
|
280
|
+
}
|
|
281
|
+
return target;
|
|
282
|
+
};
|
|
283
|
+
setValue.split = split;
|
|
284
|
+
setValue.cache = /* @__PURE__ */ new Map();
|
|
285
|
+
setValue.clear = () => {
|
|
286
|
+
setValue.cache = /* @__PURE__ */ new Map();
|
|
287
|
+
};
|
|
288
|
+
module.exports = setValue;
|
|
289
|
+
})))(), 1);
|
|
290
|
+
const SPECIAL_CHARS_RE = /[|\\{}()[\]^$+*?.]/g;
|
|
291
|
+
const HYPHEN_RE = /-/g;
|
|
292
|
+
const LAST_EXT_RE = /\.[^/.]+$/;
|
|
293
|
+
const ALL_EXT_RE = /(\.[^/.]+)+$/;
|
|
294
|
+
/**
|
|
295
|
+
* @description 转义字符串中的正则特殊字符
|
|
296
|
+
*/
|
|
384
297
|
function escapeStringRegexp(str) {
|
|
385
|
-
|
|
298
|
+
return str.replace(SPECIAL_CHARS_RE, "\\$&").replace(HYPHEN_RE, "\\x2d");
|
|
386
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* @description 移除文件名的最后一个扩展名
|
|
302
|
+
*/
|
|
387
303
|
function removeExtension(file) {
|
|
388
|
-
|
|
304
|
+
return file.replace(LAST_EXT_RE, "");
|
|
389
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* @description 移除文件名的所有扩展名(多重后缀)
|
|
308
|
+
*/
|
|
390
309
|
function removeExtensionDeep(file) {
|
|
391
|
-
|
|
310
|
+
return file.replace(ALL_EXT_RE, "");
|
|
392
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* @description 若缺少扩展名则追加(默认 .js)
|
|
314
|
+
*/
|
|
393
315
|
function addExtension(filename, ext = ".js") {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
return result;
|
|
316
|
+
let result = `${filename}`;
|
|
317
|
+
if (!extname(filename)) result += ext;
|
|
318
|
+
return result;
|
|
399
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* @description 将单个值转换为数组
|
|
322
|
+
*/
|
|
400
323
|
function arrify(val) {
|
|
401
|
-
|
|
324
|
+
if (Array.isArray(val)) return [...val];
|
|
325
|
+
return [val];
|
|
402
326
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
327
|
+
/**
|
|
328
|
+
* @description defu 合并策略:当目标/来源为数组时直接覆盖
|
|
329
|
+
*/
|
|
330
|
+
const defuOverrideArray = createDefu((obj, key, value) => {
|
|
331
|
+
if (Array.isArray(obj[key]) && Array.isArray(value)) {
|
|
332
|
+
obj[key] = value;
|
|
333
|
+
return true;
|
|
334
|
+
}
|
|
408
335
|
});
|
|
409
|
-
|
|
410
|
-
|
|
336
|
+
/**
|
|
337
|
+
* @description 判断是否为非 null 的对象
|
|
338
|
+
*/
|
|
339
|
+
function isObject(x) {
|
|
340
|
+
return typeof x === "object" && x !== null;
|
|
411
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* @description 判断对象是否为空对象
|
|
344
|
+
*/
|
|
412
345
|
function isEmptyObject(obj) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
return false;
|
|
346
|
+
if (isObject(obj)) {
|
|
347
|
+
let name;
|
|
348
|
+
for (name in obj) return false;
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
return false;
|
|
421
352
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
arrify,
|
|
426
|
-
defu,
|
|
427
|
-
defuOverrideArray,
|
|
428
|
-
escapeStringRegexp,
|
|
429
|
-
index_default as get,
|
|
430
|
-
isEmptyObject,
|
|
431
|
-
isObject2 as isObject,
|
|
432
|
-
objectHash,
|
|
433
|
-
removeExtension,
|
|
434
|
-
removeExtensionDeep,
|
|
435
|
-
export_set as set
|
|
436
|
-
};
|
|
437
|
-
/*! Bundled license information:
|
|
438
|
-
|
|
439
|
-
is-primitive/index.js:
|
|
440
|
-
(*!
|
|
441
|
-
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
|
442
|
-
*
|
|
443
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
444
|
-
* Released under the MIT License.
|
|
445
|
-
*)
|
|
446
|
-
|
|
447
|
-
isobject/index.js:
|
|
448
|
-
(*!
|
|
449
|
-
* isobject <https://github.com/jonschlinkert/isobject>
|
|
450
|
-
*
|
|
451
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
452
|
-
* Released under the MIT License.
|
|
453
|
-
*)
|
|
454
|
-
|
|
455
|
-
is-plain-object/index.js:
|
|
456
|
-
(*!
|
|
457
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
458
|
-
*
|
|
459
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
460
|
-
* Released under the MIT License.
|
|
461
|
-
*)
|
|
462
|
-
|
|
463
|
-
set-value/index.js:
|
|
464
|
-
(*!
|
|
465
|
-
* set-value <https://github.com/jonschlinkert/set-value>
|
|
466
|
-
*
|
|
467
|
-
* Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
|
|
468
|
-
* Released under the MIT License.
|
|
469
|
-
*)
|
|
470
|
-
|
|
471
|
-
get-value/dist/index.mjs:
|
|
472
|
-
(*!
|
|
473
|
-
* get-value <https://github.com/jonschlinkert/get-value>
|
|
474
|
-
*
|
|
475
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
476
|
-
* Released under the MIT License.
|
|
477
|
-
*)
|
|
478
|
-
*/
|
|
353
|
+
//#endregion
|
|
354
|
+
var set = import_set_value.default;
|
|
355
|
+
export { addExtension, arrify, defu, defuOverrideArray, escapeStringRegexp, index_default as get, isEmptyObject, isObject, objectHash, removeExtension, removeExtensionDeep, set };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-core/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"description": "@weapp-core/shared",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"dev": "
|
|
50
|
-
"build": "
|
|
49
|
+
"dev": "tsdown -w --sourcemap",
|
|
50
|
+
"build": "tsdown",
|
|
51
51
|
"test": "vitest run",
|
|
52
52
|
"test:dev": "vitest",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
53
54
|
"release": "pnpm publish",
|
|
54
55
|
"lint": "eslint .",
|
|
55
56
|
"lint:fix": "eslint . --fix",
|