summaryrefslogtreecommitdiff
path: root/std/encoding/toml.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/encoding/toml.ts')
-rw-r--r--std/encoding/toml.ts36
1 files changed, 15 insertions, 21 deletions
diff --git a/std/encoding/toml.ts b/std/encoding/toml.ts
index 3b4b03d20..0cbd51ba0 100644
--- a/std/encoding/toml.ts
+++ b/std/encoding/toml.ts
@@ -393,11 +393,9 @@ function joinKeys(keys: string[]): string {
// Dotted keys are a sequence of bare or quoted keys joined with a dot.
// This allows for grouping similar properties together:
return keys
- .map(
- (str: string): string => {
- return str.match(/[^A-Za-z0-9_-]/) ? `"${str}"` : str;
- }
- )
+ .map((str: string): string => {
+ return str.match(/[^A-Za-z0-9_-]/) ? `"${str}"` : str;
+ })
.join(".");
}
@@ -417,24 +415,20 @@ class Dumper {
_parse(obj: Record<string, unknown>, keys: string[] = []): string[] {
const out = [];
const props = Object.keys(obj);
- const propObj = props.filter(
- (e: string): boolean => {
- if (obj[e] instanceof Array) {
- const d: unknown[] = obj[e] as unknown[];
- return !this._isSimplySerializable(d[0]);
- }
- return !this._isSimplySerializable(obj[e]);
+ const propObj = props.filter((e: string): boolean => {
+ if (obj[e] instanceof Array) {
+ const d: unknown[] = obj[e] as unknown[];
+ return !this._isSimplySerializable(d[0]);
}
- );
- const propPrim = props.filter(
- (e: string): boolean => {
- if (obj[e] instanceof Array) {
- const d: unknown[] = obj[e] as unknown[];
- return this._isSimplySerializable(d[0]);
- }
- return this._isSimplySerializable(obj[e]);
+ return !this._isSimplySerializable(obj[e]);
+ });
+ const propPrim = props.filter((e: string): boolean => {
+ if (obj[e] instanceof Array) {
+ const d: unknown[] = obj[e] as unknown[];
+ return this._isSimplySerializable(d[0]);
}
- );
+ return this._isSimplySerializable(obj[e]);
+ });
const k = propPrim.concat(propObj);
for (let i = 0; i < k.length; i++) {
const prop = k[i];