All files / client/methods listfolder.js

100% Statements 4/4
0% Branches 0/1
100% Functions 3/3
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20          19x 5x   5x               4x      
/* @flow */
 
import invariant from "invariant";
import type { MethodApi } from "../types";
 
export default ({ client }: MethodApi) => (folderid: number = 0, optionalParams?: object): Promise<Object> => {
  invariant(typeof folderid === "number", "`folderid` must be a number.");
 
  return client
    .api("listfolder", {
      params: {
        folderid: folderid,
        ...optionalParams
      }
    })
    .then(response => {
      return response.metadata;
    });
};