Skip to content

Commit

Permalink
style: fix coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
Haixing-Hu committed Dec 9, 2023
1 parent 39247cd commit 8905bb0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/decycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ function convert(value, replacer, path, pathMap) {
return value.map((e, i) => convert(e, replacer, `${path}[${i}]`, pathMap));
case 'map':
return new Map(Array.from(value, ([k, v], i) => [
convert(k, replacer, `${path}[${i}].key`, pathMap),
convert(v, replacer, `${path}[${i}].value`, pathMap),
]));
convert(k, replacer, `${path}[${i}].key`, pathMap),
convert(v, replacer, `${path}[${i}].value`, pathMap),
]));
case 'set':
return new Set(Array.from(value,
(e, i) => convert(e, replacer, `${path}[${i}]`, pathMap)));
Expand Down
2 changes: 1 addition & 1 deletion src/json-stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function replacer(key, value) {
case 'number':
return value;
case 'bigint':
return String(value) + 'n';
return `${String(value)}n`;
case 'object':
switch (info.subtype) {
case 'Map':
Expand Down
2 changes: 1 addition & 1 deletion src/remove-empty-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function removeEmptyFields(obj) {
return obj.map((v) => removeEmptyFields(v)).filter((v) => v !== undefined);
case 'map':
return new Map(Array.from(obj, ([k, v]) => [k, removeEmptyFields(v)])
.filter(([_, v]) => v !== undefined));
.filter((e) => e[1] !== undefined));
case 'set':
return new Set(Array.from(obj, (v) => removeEmptyFields(v))
.filter((v) => v !== undefined));
Expand Down

0 comments on commit 8905bb0

Please sign in to comment.