chore: minor Flow fixes

This commit is contained in:
Julien Fontanet 2018-11-13 11:24:23 +01:00
parent 79fb3ec8bd
commit c8da9fec0a
6 changed files with 8 additions and 5 deletions

View File

@ -4,6 +4,7 @@ module.exports = {
__DEV__: true,
$Dict: true,
$Diff: true,
$ElementType: true,
$Exact: true,
$Keys: true,
$PropertyType: true,

View File

@ -1,5 +1,6 @@
// @flow
// $FlowFixMe
import getStream from 'get-stream'
import { randomBytes } from 'crypto'
import { fromCallback, fromEvent, ignoreErrors, timeout } from 'promise-toolbox'

View File

@ -1,6 +1,5 @@
// @flow
// $FlowFixMe
import through2 from 'through2'
import { createHash } from 'crypto'
import { defer, fromEvent } from 'promise-toolbox'

View File

@ -1,6 +1,5 @@
// @flow
// $FlowFixMe
import through2 from 'through2'
import { type Readable } from 'stream'

View File

@ -147,12 +147,12 @@ const defaultSettings: Settings = {
timeout: 0,
vmTimeout: 0,
}
const getSetting = <T>(
const getSetting = <T, K: $Keys<Settings>>(
settings: $Dict<Settings>,
name: $Keys<Settings>,
name: K,
keys: string[],
defaultValue?: T
): T | any => {
): T | $ElementType<Settings, K> => {
for (let i = 0, n = keys.length; i < n; ++i) {
const objectSettings = settings[keys[i]]
if (objectSettings !== undefined) {

View File

@ -5,8 +5,11 @@ import { mergeVhd as mergeVhd_ } from 'vhd-lib'
// Use Bluebird for all promises as it provides better performance and
// less memory usage.
//
// $FlowFixMe
global.Promise = require('bluebird')
// $FlowFixMe
const config: Object = JSON.parse(process.env.XO_CONFIG)
export function mergeVhd (