summaryrefslogtreecommitdiff
path: root/std/encoding/toml.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-11-14 05:42:34 +1100
committerRy Dahl <ry@tinyclouds.org>2019-11-13 13:42:34 -0500
commit9837d324a7c3f5e1c850dadabfd670edad4aa85b (patch)
treea81de8e9e15f64edd2ccb6e30a351ca3b2305035 /std/encoding/toml.ts
parent279191ad9447c66fe1278589a7be242d035bb68b (diff)
Update to TypeScript 3.7 (#3275)
and update to prettier 1.19 Also, update `assert()` and remove not null assertions where possibly in `cli`. Closes #3273
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];