mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Run deno_std tests in github actions
This commit is contained in:
parent
28293acd9c
commit
93f7f00c95
53 changed files with 668 additions and 877 deletions
|
@ -8,24 +8,26 @@ export function deepAssign(
|
|||
if (!source || typeof source !== `object`) {
|
||||
return;
|
||||
}
|
||||
Object.entries(source).forEach(([key, value]: [string, unknown]): void => {
|
||||
if (value instanceof Date) {
|
||||
target[key] = new Date(value);
|
||||
return;
|
||||
Object.entries(source).forEach(
|
||||
([key, value]: [string, unknown]): void => {
|
||||
if (value instanceof Date) {
|
||||
target[key] = new Date(value);
|
||||
return;
|
||||
}
|
||||
if (!value || typeof value !== `object`) {
|
||||
target[key] = value;
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
target[key] = [];
|
||||
}
|
||||
// value is an Object
|
||||
if (typeof target[key] !== `object` || !target[key]) {
|
||||
target[key] = {};
|
||||
}
|
||||
deepAssign(target[key] as Record<string, unknown>, value!);
|
||||
}
|
||||
if (!value || typeof value !== `object`) {
|
||||
target[key] = value;
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
target[key] = [];
|
||||
}
|
||||
// value is an Object
|
||||
if (typeof target[key] !== `object` || !target[key]) {
|
||||
target[key] = {};
|
||||
}
|
||||
deepAssign(target[key] as Record<string, unknown>, value!);
|
||||
});
|
||||
);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue