svelte-meta-tags 4.0.3 → 4.0.4
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/deepMerge.js +20 -20
- package/package.json +2 -2
package/dist/deepMerge.js
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
export const deepMerge = (target, source) => {
|
|
3
3
|
if (!target || !source)
|
|
4
4
|
return target ?? source ?? {};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
const result = { ...target };
|
|
6
|
+
for (const [key, value] of Object.entries(source)) {
|
|
7
|
+
const targetValue = target[key];
|
|
8
|
+
if (targetValue instanceof Date || typeof targetValue === 'function') {
|
|
9
|
+
result[key] = targetValue;
|
|
10
|
+
}
|
|
11
|
+
else if (value instanceof Date || typeof value === 'function') {
|
|
12
|
+
result[key] = value;
|
|
13
|
+
}
|
|
14
|
+
else if (isObject(targetValue) && isObject(value)) {
|
|
15
|
+
result[key] = deepMerge(targetValue, value);
|
|
16
|
+
}
|
|
17
|
+
else if (isArray(targetValue) && isArray(value)) {
|
|
18
|
+
result[key] = value;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
result[key] = value !== undefined ? value : targetValue;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
25
|
};
|
|
26
26
|
const isObject = (obj) => obj !== null && typeof obj === 'object' && !Array.isArray(obj);
|
|
27
27
|
const isArray = (obj) => Array.isArray(obj);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-meta-tags",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Svelte Meta Tags provides components designed to help you manage SEO for Svelte projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@sveltejs/package": "^2.3.6",
|
|
28
28
|
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
|
29
29
|
"publint": "^0.2.12",
|
|
30
|
-
"svelte": "^5.1.
|
|
30
|
+
"svelte": "^5.1.2",
|
|
31
31
|
"svelte-check": "^4.0.5",
|
|
32
32
|
"tslib": "^2.8.0",
|
|
33
33
|
"typescript": "^5.6.3",
|