Skip to content

Commit 3c4cd98

Browse files
committed
Add a whole bunch of flow typing
1 parent 2a55c87 commit 3c4cd98

16 files changed

+319
-36
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
}]
88
],
99
"plugins": [
10+
"transform-flow-strip-types",
1011
"transform-async-generator-functions"
1112
],
1213
"env": {

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
.idea/
12
build/
3+
flow-typed/

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"Boolean": "boolean",
1212
"Number": "number",
1313
"String": "string",
14-
"Symbol": "symbol",
14+
"symbol": "Symbol",
1515
"Function": "function",
1616
"Null": "null",
1717
"Undefined": "undefined",

.flowconfig

Whitespace-only changes.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# project
22
.nyc_output/
33
build/
4+
coverage/
45

56
# node
67
node_modules/

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ lib_asset_files := $(shell find lib -type f ! -name "*.js" ! -name ".eslintrc.*"
1919

2020
build_files := $(lib_files:lib/%=build/%)
2121
build_asset_files := $(lib_asset_files:lib/%=build/%)
22-
build_package_files := build/README.md build/package.json
22+
build_package_files := build/README.md build/package.json build/license
2323

2424

2525
# Build
@@ -50,6 +50,12 @@ build: node_modules ${build_files} ${build_asset_files} ${build_package_files}
5050

5151
full-test: lint test cover
5252

53+
flow:
54+
flow
55+
56+
flow-stop:
57+
flow stop
58+
5359
lint:
5460
eslint lib
5561

@@ -58,12 +64,13 @@ test: build
5864

5965
cover: node_modules
6066
cd lib && BABEL_ENV=cover nyc ${test_command}
67+
mv lib/coverage .
6168

6269
clean:
6370
rm -rf build .nyc_output
6471

6572
maintainer-clean: clean
66-
rm -rf node_modules
73+
rm -rf node_modules coverage
6774

6875

69-
.PHONY: all lint test cover clean maintainer-clean
76+
.PHONY: all full-test flow flow-stop lint test cover clean maintainer-clean

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
11
# Stream Async Iterator
2+
3+
## Installation
4+
5+
```
6+
$ npm install stream-async-iterator
7+
```
8+
9+
10+
## Overview
11+
12+
`stream-async-iterator` provides a wrapper that implements `Symbol.asyncIterator`.
13+
14+
15+
## References
16+
17+
- https://github.com/tc39/proposal-async-iteration
18+
- https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-generator-functions

flow-typed/npm/chai_v3.5.x.js

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
// flow-typed signature: e5aa81c42ca6ea865682f7caf64c5940
2+
// flow-typed version: be297a96f4/chai_v3.5.x/flow_>=v0.24.0
3+
4+
/* @flow */
5+
declare module "chai" {
6+
7+
declare type ExpectChain<T> = {
8+
and: ExpectChain<T>,
9+
at: ExpectChain<T>,
10+
be: ExpectChain<T>,
11+
been: ExpectChain<T>,
12+
have: ExpectChain<T>,
13+
has: ExpectChain<T>,
14+
is: ExpectChain<T>,
15+
of: ExpectChain<T>,
16+
same: ExpectChain<T>,
17+
that: ExpectChain<T>,
18+
to: ExpectChain<T>,
19+
which: ExpectChain<T>,
20+
with: ExpectChain<T>,
21+
22+
not: ExpectChain<T>,
23+
deep: ExpectChain<T>,
24+
any: ExpectChain<T>,
25+
all: ExpectChain<T>,
26+
27+
a: ExpectChain<T> & (type: string) => ExpectChain<T>,
28+
an: ExpectChain<T> & (type: string) => ExpectChain<T>,
29+
30+
include: ExpectChain<T> & (value: mixed) => ExpectChain<T>,
31+
includes: ExpectChain<T> & (value: mixed) => ExpectChain<T>,
32+
contain: ExpectChain<T> & (value: mixed) => ExpectChain<T>,
33+
contains: ExpectChain<T> & (value: mixed) => ExpectChain<T>,
34+
35+
eql: (value: T) => ExpectChain<T>,
36+
equal: (value: T) => ExpectChain<T>,
37+
equals: (value: T) => ExpectChain<T>,
38+
39+
above: (value: T & number) => ExpectChain<T>,
40+
least: (value: T & number) => ExpectChain<T>,
41+
below: (value: T & number) => ExpectChain<T>,
42+
most: (value: T & number) => ExpectChain<T>,
43+
within: (start: T & number, finish: T & number) => ExpectChain<T>,
44+
45+
instanceof: (constructor: mixed) => ExpectChain<T>,
46+
property: (
47+
<P>(name: string, value?: P) => ExpectChain<P>
48+
& (name: string) => ExpectChain<mixed>
49+
),
50+
51+
length: ExpectChain<number>,
52+
lengthOf: (value: number) => ExpectChain<T>,
53+
54+
match: (regex: RegExp) => ExpectChain<T>,
55+
string: (string: string) => ExpectChain<T>,
56+
57+
key: (key: string) => ExpectChain<T>,
58+
keys: (key: string | Array<string>, ...keys: Array<string>) => ExpectChain<T>,
59+
60+
throw: <E>(err: Class<E> | Error | RegExp | string, msg?: RegExp | string) => ExpectChain<T>,
61+
62+
respondTo: (method: string) => ExpectChain<T>,
63+
itself: ExpectChain<T>,
64+
65+
satisfy: (method: (value: T) => bool) => ExpectChain<T>,
66+
67+
closeTo: (expected: T & number, delta: number) => ExpectChain<T>,
68+
69+
members: (set: mixed) => ExpectChain<T>,
70+
oneOf: (list: Array<T>) => ExpectChain<T>,
71+
72+
change: (obj: mixed, key: string) => ExpectChain<T>,
73+
increase: (obj: mixed, key: string) => ExpectChain<T>,
74+
decrease: (obj: mixed, key: string) => ExpectChain<T>,
75+
76+
// dirty-chai
77+
ok: () => ExpectChain<T>,
78+
true: () => ExpectChain<T>,
79+
false: () => ExpectChain<T>,
80+
null: () => ExpectChain<T>,
81+
undefined: () => ExpectChain<T>,
82+
exist: () => ExpectChain<T>,
83+
empty: () => ExpectChain<T>,
84+
85+
// chai-immutable
86+
size: (n: number) => ExpectChain<T>,
87+
88+
// sinon-chai
89+
called: () => ExpectChain<T>,
90+
callCount: (n: number) => ExpectChain<T>,
91+
calledOnce: () => ExpectChain<T>,
92+
calledBefore: (spy: mixed) => ExpectChain<T>,
93+
calledAfter: (spy: mixed) => ExpectChain<T>,
94+
calledWith: (...args: Array<mixed>) => ExpectChain<T>,
95+
calledWithMatch: (...args: Array<mixed>) => ExpectChain<T>,
96+
calledWithExactly: (...args: Array<mixed>) => ExpectChain<T>,
97+
};
98+
99+
declare function expect<T>(actual: T): ExpectChain<T>;
100+
101+
declare function use(plugin: (chai: Object, utils: Object) => void): void;
102+
103+
declare class assert {
104+
static(expression: mixed, message?: string): void;
105+
static fail(actual: mixed, expected: mixed, message?: string, operator?: string): void;
106+
107+
static isOk(object: mixed, message?: string): void;
108+
static isNotOk(object: mixed, message?: string): void;
109+
110+
static equal(actual: mixed, expected: mixed, message?: string): void;
111+
static notEqual(actual: mixed, expected: mixed, message?: string): void;
112+
113+
static strictEqual(act: mixed, exp: mixed, msg?: string): void;
114+
static notStrictEqual(act: mixed, exp: mixed, msg?: string): void;
115+
116+
static deepEqual(act: mixed, exp: mixed, msg?: string): void;
117+
static notDeepEqual(act: mixed, exp: mixed, msg?: string): void;
118+
119+
static isTrue(val: mixed, msg?: string): void;
120+
static isNotTrue(val: mixed, msg?: string): void;
121+
static isFalse(val: mixed, msg?: string): void;
122+
static isNotFalse(val: mixed, msg?: string): void;
123+
124+
static isNull(val: mixed, msg?: string): void;
125+
static isNotNull(val: mixed, msg?: string): void;
126+
127+
static isUndefined(val: mixed, msg?: string): void;
128+
static isDefined(val: mixed, msg?: string): void;
129+
130+
static isNaN(val: mixed, msg?: string): void;
131+
static isNotNaN(val: mixed, msg?: string): void;
132+
133+
static isAbove(val: number, abv: number, msg?: string): void;
134+
static isBelow(val: number, blw: number, msg?: string): void;
135+
136+
static isAtMost(val: number, atmst: number, msg?: string): void;
137+
static isAtLeast(val: number, atlst: number, msg?: string): void;
138+
139+
static isFunction(val: mixed, msg?: string): void;
140+
static isNotFunction(val: mixed, msg?: string): void;
141+
142+
static isObject(val: mixed, msg?: string): void;
143+
static isNotObject(val: mixed, msg?: string): void;
144+
145+
static isArray(val: mixed, msg?: string): void;
146+
static isNotArray(val: mixed, msg?: string): void;
147+
148+
static isString(val: mixed, msg?: string): void;
149+
static isNotString(val: mixed, msg?: string): void;
150+
151+
static isNumber(val: mixed, msg?: string): void;
152+
static isNotNumber(val: mixed, msg?: string): void;
153+
154+
static isBoolean(val: mixed, msg?: string): void;
155+
static isNotBoolean(val: mixed, msg?: string): void;
156+
157+
static typeOf(val: mixed, type: string, msg?: string): void;
158+
static notTypeOf(val: mixed, type: string, msg?: string): void;
159+
160+
static instanceOf(val: mixed, constructor: Function, msg?: string): void;
161+
static notInstanceOf(val: mixed, constructor: Function, msg?: string): void;
162+
163+
static include(exp: string, inc: mixed, msg?: string): void;
164+
static include(exp: Array<mixed>, inc: mixed, msg?: string): void;
165+
166+
static notInclude(exp: string, inc: mixed, msg?: string): void;
167+
static notInclude(exp: Array<mixed>, inc: mixed, msg?: string): void;
168+
169+
static match(exp: mixed, re: RegExp, msg?: string): void;
170+
static notMatch(exp: mixed, re: RegExp, msg?: string): void;
171+
172+
static property(obj: Object, prop: string, msg?: string): void;
173+
static notProperty(obj: Object, prop: string, msg?: string): void;
174+
static deepProperty(obj: Object, prop: string, msg?: string): void;
175+
static notDeepProperty(obj: Object, prop: string, msg?: string): void;
176+
177+
static propertyVal(obj: Object, prop: string, val: mixed, msg?: string): void;
178+
static propertyNotVal(obj: Object, prop: string, val: mixed, msg?: string): void;
179+
180+
static deepPropertyVal(obj: Object, prop: string, val: mixed, msg?: string): void;
181+
static deepPropertyNotVal(obj: Object, prop: string, val: mixed, msg?: string): void;
182+
183+
static lengthOf(exp: mixed, len: number, msg?: string): void;
184+
}
185+
186+
declare var config: {
187+
includeStack: boolean,
188+
showDiff: boolean,
189+
truncateThreshold: boolean
190+
};
191+
}

flow-typed/npm/mocha_v3.1.x.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// flow-typed signature: 6b82cf8c1da27b4f0fa7a58e5ed5babf
2+
// flow-typed version: edf70dde46/mocha_v3.1.x/flow_>=v0.22.x
3+
4+
type TestFunction = ((done: () => void) => void | Promise<mixed>);
5+
6+
declare var describe : {
7+
(name:string, spec:() => void): void;
8+
only(description:string, spec:() => void): void;
9+
skip(description:string, spec:() => void): void;
10+
timeout(ms:number): void;
11+
};
12+
13+
declare var context : typeof describe;
14+
15+
declare var it : {
16+
(name:string, spec?:TestFunction): void;
17+
only(description:string, spec:TestFunction): void;
18+
skip(description:string, spec:TestFunction): void;
19+
timeout(ms:number): void;
20+
};
21+
22+
declare function before(method : TestFunction):void;
23+
declare function beforeEach(method : TestFunction):void;
24+
declare function after(method : TestFunction):void;
25+
declare function afterEach(method : TestFunction):void;

0 commit comments

Comments
 (0)