-
-
Notifications
You must be signed in to change notification settings - Fork 0
flat
Aierse edited this page Oct 17, 2023
·
2 revisions
JSON makes flat
import JSONExtend from "@aierse/json-extend";
const json = {
required: {
id: "test",
password: "test"
},
notRequired: {
phone: "010-1234-5678",
memo: "",
etc: undefined
},
}
// JSON makes flat
json = JSONExtend.flat(json)
/*
{
id: "test",
password: "test",
phone: "010-1234-5678",
memo: "",
etc: undefined
}