Skip to content

Commit 7bf9d14

Browse files
committed
refactor: move result normalize fn to traverse (encapsulate)
1 parent 4fd3d26 commit 7bf9d14

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const ObjectKeys = Object.keys.bind(Object);
22
export const isBool = (value: unknown): value is boolean => typeof value == 'boolean';
33
export const isString = (value: unknown): value is string => typeof value == 'string';
44
export const isNumber = (value: unknown): value is number =>
5-
typeof value == 'number' && !isNaN(value as number) && Number.isFinite(value);
5+
typeof value == 'number' && Number.isFinite(value);
66

77
export function isPlainObject(maybeObject: any): maybeObject is Record<string, any> {
88
return (
@@ -30,7 +30,3 @@ export function toObj(value: any) {
3030
? value
3131
: ({} as Record<string, any>);
3232
}
33-
34-
export function normalizeResult(result: Record<string, any>) {
35-
return ObjectKeys(result).length <= 0 ? null : result;
36-
}

0 commit comments

Comments
 (0)