Skip to content

Commit 73ff780

Browse files
committed
Add flow head-line. Add is.js
1 parent b1eb524 commit 73ff780

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @flow */
2+
13
import { mongooseModelToTypeComposer } from './modelConverter';
24

35
export default mongooseModelToTypeComposer;

src/utils/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
/* @flow */
12
import toDottedObject from './toDottedObject';
3+
import { isObject } from './is';
24

35
export {
46
toDottedObject,
7+
isObject,
58
};
69

710
export function upperFirst(string: string): string {
811
return string.charAt(0).toUpperCase() + string.slice(1);
912
}
10-
11-
export function isObject(value: mixed): boolean {
12-
return typeof value === 'object' && !Array.isArray(value) && value !== null;
13-
}

src/utils/is.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* @flow */
2+
3+
export function isString(value: mixed): boolean {
4+
return typeof value === 'string';
5+
}
6+
7+
export function isObject(value: mixed): boolean {
8+
return typeof value === 'object' && !Array.isArray(value) && value !== null;
9+
}
10+
11+
export function isFunction(value: mixed): boolean {
12+
return !!(value && value.constructor && value.call && typeof value === 'function' && value.apply);
13+
}

0 commit comments

Comments
 (0)