Update with flow lint (#46)
* Flow lint warning fixes * Flow updates fro new flow-bin
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
// ISC, Copyright 2017 Jaco Greeff
|
||||
// @flow
|
||||
|
||||
import type { FormatOutputType, InterfaceOutputType } from '@polkadot/api-jsonrpc/types';
|
||||
import type { FormatterFunction } from './types';
|
||||
import type { InterfaceOutputType } from '@polkadot/api-jsonrpc/types';
|
||||
|
||||
const headerDecode = require('@polkadot/primitives-json/header/decode');
|
||||
|
||||
const echo = require('./echo');
|
||||
const util = require('./util');
|
||||
|
||||
const formatters: { [FormatOutputType]: FormatterFunction } = {
|
||||
const formatters = {
|
||||
'Header': headerDecode,
|
||||
'OutData': echo,
|
||||
'StorageData': echo
|
||||
};
|
||||
|
||||
module.exports = function formatOutput (output: InterfaceOutputType, value: any): any {
|
||||
module.exports = function formatOutput (output: InterfaceOutputType, value: mixed): mixed {
|
||||
return util.format(formatters, output.type, value);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user