summaryrefslogtreecommitdiff
path: root/std/testing/format.ts
diff options
context:
space:
mode:
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) {