@rspack/core 1.0.0-alpha.5 → 1.0.0-beta.1
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/compiled/zod/index.d.ts +138 -52
- package/compiled/zod/index.js +300 -103
- package/compiled/zod/package.json +1 -1
- package/compiled/zod-validation-error/index.js +6 -6
- package/dist/Compilation.d.ts +22 -4
- package/dist/Compilation.js +64 -49
- package/dist/Compiler.d.ts +11 -10
- package/dist/Compiler.js +42 -42
- package/dist/ErrorHelpers.js +2 -4
- package/dist/Module.d.ts +1 -0
- package/dist/Module.js +3 -6
- package/dist/ModuleTypeConstants.d.ts +45 -69
- package/dist/ModuleTypeConstants.js +24 -77
- package/dist/NormalModule.d.ts +1 -0
- package/dist/NormalModule.js +1 -0
- package/dist/Stats.js +4 -6
- package/dist/Template.d.ts +31 -147
- package/dist/Template.js +40 -236
- package/dist/builtin-loader/lightningcss/index.d.ts +89 -0
- package/dist/builtin-loader/lightningcss/index.js +175 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +25 -49
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.js +9 -13
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +4 -3
- package/dist/builtin-plugin/EntryPlugin.js +1 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +29 -5
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +9 -9
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +4 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +5 -15
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +15 -23
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/base.js +1 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +17 -66
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +2 -0
- package/dist/builtin-plugin/css-extract/hmr/{normalize-url.js → normalizeUrl.js} +15 -24
- package/dist/builtin-plugin/css-extract/loader.d.ts +8 -3
- package/dist/builtin-plugin/css-extract/loader.js +28 -17
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapter.js +39 -25
- package/dist/config/adapterRuleUse.d.ts +5 -5
- package/dist/config/adapterRuleUse.js +23 -1
- package/dist/config/browserslistTargetHandler.d.ts +17 -15
- package/dist/config/browserslistTargetHandler.js +27 -33
- package/dist/config/defaults.js +27 -31
- package/dist/config/normalization.d.ts +8 -3
- package/dist/config/normalization.js +7 -5
- package/dist/config/target.d.ts +48 -109
- package/dist/config/target.js +50 -86
- package/dist/config/zod.d.ts +2660 -2305
- package/dist/config/zod.js +38 -19
- package/dist/container/ContainerPlugin.d.ts +7 -7
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/container/options.js +1 -1
- package/dist/exports.d.ts +4 -4
- package/dist/exports.js +2 -2
- package/dist/lib/AbstractMethodError.d.ts +12 -3
- package/dist/lib/AbstractMethodError.js +29 -21
- package/dist/lib/Cache.d.ts +40 -46
- package/dist/lib/Cache.js +43 -78
- package/dist/lib/CacheFacade.d.ts +119 -143
- package/dist/lib/CacheFacade.js +123 -123
- package/dist/lib/EntryOptionPlugin.d.ts +19 -2
- package/dist/lib/EntryOptionPlugin.js +22 -6
- package/dist/lib/EnvironmentPlugin.d.ts +17 -10
- package/dist/lib/EnvironmentPlugin.js +16 -15
- package/dist/lib/HookWebpackError.d.ts +27 -33
- package/dist/lib/HookWebpackError.js +33 -34
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/{ignoreWarningsPlugin.js → IgnoreWarningsPlugin.js} +17 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +18 -9
- package/dist/lib/LoaderOptionsPlugin.js +38 -14
- package/dist/lib/LoaderTargetPlugin.d.ts +17 -8
- package/dist/lib/LoaderTargetPlugin.js +17 -15
- package/dist/lib/ModuleFilenameHelpers.d.ts +10 -1
- package/dist/lib/ModuleFilenameHelpers.js +10 -3
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +15 -5
- package/dist/lib/NormalModuleReplacementPlugin.js +15 -5
- package/dist/lib/WebpackError.d.ts +29 -22
- package/dist/lib/WebpackError.js +17 -29
- package/dist/lib/cache/getLazyHashedEtag.d.ts +24 -24
- package/dist/lib/cache/getLazyHashedEtag.js +20 -23
- package/dist/lib/cache/mergeEtags.d.ts +15 -9
- package/dist/lib/cache/mergeEtags.js +23 -22
- package/dist/lib/formatLocation.d.ts +13 -8
- package/dist/lib/formatLocation.js +20 -20
- package/dist/loader-runner/LoaderLoadingError.d.ts +11 -1
- package/dist/loader-runner/LoaderLoadingError.js +3 -5
- package/dist/loader-runner/index.js +7 -9
- package/dist/loader-runner/loadLoader.d.ts +11 -2
- package/dist/loader-runner/loadLoader.js +17 -19
- package/dist/logging/createConsoleLogger.js +2 -6
- package/dist/logging/truncateArgs.js +5 -9
- package/dist/node/nodeConsole.js +1 -3
- package/dist/rspackOptionsApply.js +2 -2
- package/dist/stats/DefaultStatsFactoryPlugin.js +18 -8
- package/dist/stats/DefaultStatsPresetPlugin.js +4 -4
- package/dist/stats/DefaultStatsPrinterPlugin.js +11 -16
- package/dist/stats/StatsFactory.js +13 -17
- package/dist/stats/StatsPrinter.js +7 -9
- package/dist/util/AssetInfo.js +11 -7
- package/dist/util/SplitChunkSize.js +1 -1
- package/dist/util/cleverMerge.d.ts +33 -57
- package/dist/util/cleverMerge.js +89 -145
- package/dist/util/comparators.d.ts +1 -1
- package/dist/util/comparators.js +3 -5
- package/dist/util/createHash.d.ts +4 -3
- package/dist/util/createHash.js +31 -45
- package/dist/util/fs.js +9 -13
- package/dist/util/hash/BatchedHash.d.ts +24 -9
- package/dist/util/hash/BatchedHash.js +16 -13
- package/dist/util/hash/index.d.ts +9 -9
- package/dist/util/hash/index.js +14 -11
- package/dist/util/hash/md4.d.ts +29 -2
- package/dist/util/hash/md4.js +7 -3
- package/dist/util/hash/wasm-hash.d.ts +52 -5
- package/dist/util/hash/wasm-hash.js +19 -22
- package/dist/util/hash/xxhash64.d.ts +29 -2
- package/dist/util/hash/xxhash64.js +7 -3
- package/dist/util/identifier.js +9 -15
- package/dist/util/index.js +1 -1
- package/dist/util/memoize.js +7 -9
- package/package.json +9 -8
- package/compiled/enhanced-resolve/index.js +0 -5566
- package/dist/builtin-plugin/css-extract/hmr/normalize-url.d.ts +0 -2
- package/dist/lib/ignoreWarningsPlugin.d.ts +0 -7
|
@@ -19,7 +19,7 @@ const printSizes = (sizes, { formatSize = (n) => `${n}` }) => {
|
|
|
19
19
|
if (keys.length > 1) {
|
|
20
20
|
return keys.map(key => `${formatSize(sizes[key])} (${key})`).join(" ");
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
if (keys.length === 1) {
|
|
23
23
|
return formatSize(sizes[keys[0]]);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
@@ -242,9 +242,7 @@ const SIMPLE_PRINTERS = {
|
|
|
242
242
|
providedExportsCount === usedExports.length) {
|
|
243
243
|
return cyan(formatFlag("all exports used"));
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
return cyan(formatFlag(`only some exports used: ${usedExports.join(", ")}`));
|
|
247
|
-
}
|
|
245
|
+
return cyan(formatFlag(`only some exports used: ${usedExports.join(", ")}`));
|
|
248
246
|
}
|
|
249
247
|
}
|
|
250
248
|
},
|
|
@@ -909,23 +907,20 @@ const AVAILABLE_FORMATS = {
|
|
|
909
907
|
];
|
|
910
908
|
if (time < times[3])
|
|
911
909
|
return `${time}${unit}`;
|
|
912
|
-
|
|
910
|
+
if (time < times[2])
|
|
913
911
|
return bold(`${time}${unit}`);
|
|
914
|
-
|
|
912
|
+
if (time < times[1])
|
|
915
913
|
return green(`${time}${unit}`);
|
|
916
|
-
|
|
914
|
+
if (time < times[0])
|
|
917
915
|
return yellow(`${time}${unit}`);
|
|
918
|
-
|
|
919
|
-
return red(`${time}${unit}`);
|
|
916
|
+
return red(`${time}${unit}`);
|
|
920
917
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
unit = " s";
|
|
926
|
-
}
|
|
927
|
-
return `${boldQuantity ? bold(timeStr) : timeStr}${unit}`;
|
|
918
|
+
let timeStr = time.toString();
|
|
919
|
+
if (time > 1000) {
|
|
920
|
+
timeStr = `${(time / 1000).toFixed(2)}`;
|
|
921
|
+
unit = " s";
|
|
928
922
|
}
|
|
923
|
+
return `${boldQuantity ? bold(timeStr) : timeStr}${unit}`;
|
|
929
924
|
},
|
|
930
925
|
formatError: (msg, { green, yellow, red }) => {
|
|
931
926
|
let message = msg;
|
|
@@ -98,16 +98,14 @@ class StatsFactory {
|
|
|
98
98
|
if (this._inCreate) {
|
|
99
99
|
return this._create(type, data, baseContext);
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
this._inCreate = false;
|
|
110
|
-
}
|
|
101
|
+
try {
|
|
102
|
+
this._inCreate = true;
|
|
103
|
+
return this._create(type, data, baseContext);
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
for (const key of Object.keys(this._caches))
|
|
107
|
+
this._caches[key].clear();
|
|
108
|
+
this._inCreate = false;
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
_create(type, data, baseContext) {
|
|
@@ -168,13 +166,11 @@ class StatsFactory {
|
|
|
168
166
|
// run result on merged items
|
|
169
167
|
return this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, result, (h, r) => h.call(r, context));
|
|
170
168
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, object, (h, r) => h.call(r, context));
|
|
177
|
-
}
|
|
169
|
+
const object = {};
|
|
170
|
+
// run extract on value
|
|
171
|
+
this._forEachLevel(this.hooks.extract, this._caches.extract, type, h => h.call(object, data, context));
|
|
172
|
+
// run result on extracted object
|
|
173
|
+
return this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, object, (h, r) => h.call(r, context));
|
|
178
174
|
}
|
|
179
175
|
}
|
|
180
176
|
exports.StatsFactory = StatsFactory;
|
|
@@ -80,15 +80,13 @@ class StatsPrinter {
|
|
|
80
80
|
if (this._inPrint) {
|
|
81
81
|
return this._print(type, object, baseContext);
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this._inPrint = false;
|
|
91
|
-
}
|
|
83
|
+
try {
|
|
84
|
+
this._inPrint = true;
|
|
85
|
+
return this._print(type, object, baseContext);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
this._levelHookCache.clear();
|
|
89
|
+
this._inPrint = false;
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
_print(type, object, baseContext) {
|
package/dist/util/AssetInfo.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.JsAssetInfo = void 0;
|
|
4
4
|
class JsAssetInfo {
|
|
5
5
|
static __from_binding(jsAssetInfo) {
|
|
6
|
-
const { immutable, minimized, development, hotModuleReplacement, related,
|
|
6
|
+
const { immutable, minimized, development, hotModuleReplacement, related, chunkhash, fullhash, contenthash, javascriptModule, sourceFilename, extras } = jsAssetInfo;
|
|
7
7
|
return {
|
|
8
8
|
...extras,
|
|
9
9
|
immutable,
|
|
@@ -11,14 +11,15 @@ class JsAssetInfo {
|
|
|
11
11
|
development,
|
|
12
12
|
hotModuleReplacement,
|
|
13
13
|
related,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
fullhash,
|
|
15
|
+
chunkhash,
|
|
16
|
+
contenthash,
|
|
16
17
|
javascriptModule,
|
|
17
18
|
sourceFilename
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
static __to_binding(assetInfo = {}) {
|
|
21
|
-
let { immutable = false, minimized = false, development = false, hotModuleReplacement = false, related = {},
|
|
22
|
+
let { immutable = false, minimized = false, development = false, hotModuleReplacement = false, related = {}, fullhash = [], chunkhash = [], contenthash = [], javascriptModule, sourceFilename, ...extras } = assetInfo;
|
|
22
23
|
extras = extras ?? {};
|
|
23
24
|
return {
|
|
24
25
|
immutable,
|
|
@@ -26,9 +27,12 @@ class JsAssetInfo {
|
|
|
26
27
|
development,
|
|
27
28
|
hotModuleReplacement,
|
|
28
29
|
related,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
fullhash,
|
|
31
|
+
chunkhash,
|
|
32
|
+
contenthash,
|
|
33
|
+
extras,
|
|
34
|
+
javascriptModule,
|
|
35
|
+
sourceFilename
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -1,42 +1,16 @@
|
|
|
1
|
-
export type ObjectParsedPropertyEntry = {
|
|
2
|
-
/**
|
|
3
|
-
* base value
|
|
4
|
-
*/
|
|
5
|
-
base: any | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* the name of the selector property
|
|
8
|
-
*/
|
|
9
|
-
byProperty: string | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* value depending on selector property, merged with base
|
|
12
|
-
*/
|
|
13
|
-
byValues: Map<string, any>;
|
|
14
|
-
};
|
|
15
|
-
export type ParsedObject = {
|
|
16
|
-
/**
|
|
17
|
-
* static properties (key is property name)
|
|
18
|
-
*/
|
|
19
|
-
static: Map<string, ObjectParsedPropertyEntry>;
|
|
20
|
-
/**
|
|
21
|
-
* dynamic part
|
|
22
|
-
*/
|
|
23
|
-
dynamic: {
|
|
24
|
-
byProperty: string;
|
|
25
|
-
fn: Function;
|
|
26
|
-
} | undefined;
|
|
27
|
-
};
|
|
28
1
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/cleverMerge.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
34
9
|
*/
|
|
35
|
-
|
|
10
|
+
type Obj = Record<PropertyKey, any>;
|
|
11
|
+
export declare const DELETE: unique symbol;
|
|
36
12
|
/**
|
|
37
13
|
* Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
|
|
38
|
-
* @template T
|
|
39
|
-
* @template O
|
|
40
14
|
* @example
|
|
41
15
|
* // performs cleverMerge(first, second), stores the result in WeakMap and returns result
|
|
42
16
|
* cachedCleverMerge({a: 1}, {a: 2})
|
|
@@ -44,35 +18,37 @@ export function cachedSetProperty<T>(obj: Partial<T>, property: string, value: s
|
|
|
44
18
|
* // when same arguments passed, gets the result from WeakMap and returns it.
|
|
45
19
|
* cachedCleverMerge({a: 1}, {a: 2})
|
|
46
20
|
* {a: 2}
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
21
|
+
* @param first first object
|
|
22
|
+
* @param second second object
|
|
23
|
+
* @returns merged object of first and second object
|
|
50
24
|
*/
|
|
51
|
-
export
|
|
25
|
+
export declare const cachedCleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
|
|
26
|
+
/**
|
|
27
|
+
* @param obj object
|
|
28
|
+
* @param property property
|
|
29
|
+
* @param value assignment value
|
|
30
|
+
* @returns new object
|
|
31
|
+
*/
|
|
32
|
+
export declare const cachedSetProperty: (obj: Obj, property: string, value: string | number | boolean) => Obj;
|
|
52
33
|
/**
|
|
53
34
|
* Merges two objects. Objects are deeply clever merged.
|
|
54
35
|
* Arrays might reference the old value with "...".
|
|
55
36
|
* Non-object values take preference over object values.
|
|
56
|
-
* @
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
59
|
-
* @param {O} second second object
|
|
60
|
-
* @returns {T & O | T | O} merged object of first and second object
|
|
37
|
+
* @param first first object
|
|
38
|
+
* @param second second object
|
|
39
|
+
* @returns merged object of first and second object
|
|
61
40
|
*/
|
|
62
|
-
export
|
|
41
|
+
export declare const cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
|
|
63
42
|
/**
|
|
64
|
-
* @
|
|
65
|
-
* @
|
|
66
|
-
* @param {T} obj the object
|
|
67
|
-
* @param {P} byProperty the by description
|
|
68
|
-
* @param {...any} values values
|
|
69
|
-
* @returns {Omit<T, P>|undefined} object with merged byProperty
|
|
43
|
+
* @param obj the object
|
|
44
|
+
* @returns the object without operations like "..." or DELETE
|
|
70
45
|
*/
|
|
71
|
-
export
|
|
46
|
+
export declare const removeOperations: <O extends Obj>(obj: O) => O;
|
|
72
47
|
/**
|
|
73
|
-
* @
|
|
74
|
-
* @param
|
|
75
|
-
* @
|
|
48
|
+
* @param obj the object
|
|
49
|
+
* @param byProperty the by description
|
|
50
|
+
* @param values values
|
|
51
|
+
* @returns object with merged byProperty
|
|
76
52
|
*/
|
|
77
|
-
export
|
|
78
|
-
export
|
|
53
|
+
export declare const resolveByProperty: <O extends Obj | null, P extends PropertyKey>(obj: O, byProperty: P, ...values: any[]) => Omit<O, P> | undefined;
|
|
54
|
+
export {};
|