summaryrefslogtreecommitdiff
path: root/std/testing/format.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-03-29 04:03:49 +1100
committerGitHub <noreply@github.com>2020-03-28 13:03:49 -0400
commitbced52505f32d6cca4f944bb610a8a26767908a8 (patch)
treeda49a5df4b7bd6f8306248069228cd6bd0db1303 /std/testing/format.ts
parent1397b8e0e7c85762e19d88fde103342bfa563360 (diff)
Update to Prettier 2 and use ES Private Fields (#4498)
Diffstat (limited to 'std/testing/format.ts')
-rw-r--r--std/testing/format.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/std/testing/format.ts b/std/testing/format.ts
index 62fdde5eb..ee291dc23 100644
--- a/std/testing/format.ts
+++ b/std/testing/format.ts
@@ -56,7 +56,7 @@ const DEFAULT_OPTIONS: Options = {
indent: 2,
maxDepth: Infinity,
min: false,
- printFunctionName: true
+ printFunctionName: true,
};
interface BasicValueOptions {
@@ -358,8 +358,8 @@ function printIteratorValues(
return result;
}
-const getKeysOfEnumerableProperties = (object: {}): Array<string | symbol> => {
- const keys: Array<string | symbol> = Object.keys(object).sort();
+function getKeysOfEnumerableProperties<T>(object: T): Array<keyof T | symbol> {
+ const keys = Object.keys(object).sort() as Array<keyof T | symbol>;
if (Object.getOwnPropertySymbols) {
Object.getOwnPropertySymbols(object).forEach((symbol): void => {
@@ -372,7 +372,7 @@ const getKeysOfEnumerableProperties = (object: {}): Array<string | symbol> => {
}
return keys;
-};
+}
/**
* Return properties of an object
@@ -519,7 +519,7 @@ const getConfig = (options: Options): Config => ({
...options,
indent: options.min ? "" : createIndent(options.indent),
spacingInner: options.min ? " " : "\n",
- spacingOuter: options.min ? "" : "\n"
+ spacingOuter: options.min ? "" : "\n",
});
/**
@@ -531,7 +531,7 @@ const getConfig = (options: Options): Config => ({
export function format(val: any, options: Optional<Options> = {}): string {
const opts: Options = {
...DEFAULT_OPTIONS,
- ...options
+ ...options,
};
const basicResult = printBasicValue(val, opts);
if (basicResult !== null) {