Update Flow to 0.32 (#2606)

Motivation: Better libs needed in an upcoming PR.
This commit is contained in:
Erik Arvidsson
2016-09-22 15:22:20 -07:00
committed by GitHub
parent e5541f9343
commit 21b8fc2b4f
7 changed files with 6 additions and 12 deletions

View File

@@ -35,7 +35,7 @@
"chokidar": "^1.6.0",
"commander": "^2.9.0",
"documentation": "documentationjs/documentation#a71bb03681cd145723218910145c835dd5171a74",
"flow-bin": "0.30.0",
"flow-bin": "^0.32.0",
"fs-extra": "^0.30.0",
"mocha": "^2.5.3",
"nyc": "^8.3.0"

View File

@@ -83,7 +83,6 @@ function fetch(url: string, options: FetchOptions = {}): Promise<BufResponse> {
}
function arrayBufferToBuffer(ab: ArrayBuffer): Buffer {
// $FlowIssue: Node type declaration doesn't include ArrayBuffer.
return new Buffer(ab);
}

View File

@@ -183,7 +183,6 @@ class DbCollection {
insert(item: ChunkItem, options: Object = {}): Promise<number> {
return new Promise((resolve, reject) => {
options.w = 1;
//$FlowIssue
const data = new Binary(new Buffer(item.data.buffer));
this._coll.insert({hash: item.hash, data: data}, options, (err, result) => {
if (err) {
@@ -236,7 +235,6 @@ function recordToItem(record: DbRecord): ChunkItem {
function makeTempDir(): Promise<string> {
return new Promise((resolve, reject) => {
//$FlowIssue
fs.mkdtemp('/tmp/put-cache-', (err, folder) => {
if (err) {
reject(err);

View File

@@ -148,7 +148,7 @@ suite('Struct', () => {
});
});
function assertDiff(expect: [string], s1: Struct, s2: Struct) {
function assertDiff(expect: string[], s1: Struct, s2: Struct) {
const actual = structDiff(s1, s2);
assert.deepEqual(expect, actual);
}

View File

@@ -27,7 +27,7 @@
"classnames": "^2.1.3",
"csv": "^1.1.0",
"flickr-oauth-and-upload": "^0.8.0",
"flow-bin": "^0.30.0",
"flow-bin": "^0.32.0",
"http-server": "^0.9.0",
"humanize": "^0.0.9",
"mocha": "^2.5.3",

View File

@@ -7,7 +7,6 @@
import argv from 'yargs';
import {
DatasetSpec,
invariant,
isSubtype,
makeListType,
makeStructType,
@@ -96,17 +95,15 @@ async function main(): Promise<void> {
return output.commit(await result).then(() => db.close());
}
function getGeo(input: Struct): Struct {
invariant(input.place);
function getGeo(input): Struct {
return newStruct('Geoposition', {
latitude: input.place.location.latitude,
longitude: input.place.location.longitude,
});
}
async function getSizes(input: Struct): Promise<Map<Struct, string>> {
async function getSizes(input): Promise<Map<Struct, string>> {
let result = Promise.resolve(new Map());
invariant(input.images);
await input.images.forEach(v => {
result = result.then(m => m.set(
newStruct('', {width: v.width, height: v.height}),

View File

@@ -27,7 +27,7 @@
"classnames": "^2.1.3",
"csv": "^1.1.0",
"flickr-oauth-and-upload": "^0.8.0",
"flow-bin": "^0.30.0",
"flow-bin": "^0.32.0",
"http-server": "^0.9.0",
"humanize": "^0.0.9",
"mocha": "^2.5.3",