all files / src/ util.js

100% Statements 7/7
100% Branches 0/0
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                     
// ISC, Copyright 2017 Jaco Greeff
// @flow
 
import type { InterfaceInputType, InterfaceOutputType } from './types';
 
function callSignature (name: string, _inputs: Array<InterfaceInputType>, _output: InterfaceOutputType): string {
  const inputs: Array<string> = _inputs.map(({ name, type }) => `${name}: ${type}`);
  const output = _output.type;
 
  return `${name}(${inputs.join(', ')}) => ${output}`;
}
 
module.exports = {
  callSignature
};