summaryrefslogtreecommitdiff
path: root/std/encoding/toml.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-10-09 17:22:22 -0400
committerRyan Dahl <ry@tinyclouds.org>2019-10-09 17:22:22 -0400
commit93f7f00c956c14620ef031626f124b57397ca867 (patch)
treec5a9f536e79d2c8d2d02897511a9138acaf35394 /std/encoding/toml.ts
parent28293acd9c12a94f5d769706291032e844c7b92b (diff)
Run deno_std tests in github actions
Diffstat (limited to 'std/encoding/toml.ts')
-rw-r--r--std/encoding/toml.ts36
1 files changed, 21 insertions, 15 deletions
diff --git a/std/encoding/toml.ts b/std/encoding/toml.ts
index 0cbd51ba0..3b4b03d20 100644
--- a/std/encoding/toml.ts
+++ b/std/encoding/toml.ts
@@ -393,9 +393,11 @@ 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(".");
}
@@ -415,20 +417,24 @@ 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]);
+ 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]);
}
- 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]);
+ );
+ 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 k = propPrim.concat(propObj);
for (let i = 0; i < k.length; i++) {
const prop = k[i];