@dillonkearns/elm-graphql
Version:
<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">
14 lines (10 loc) • 357 B
Flow
// @flow
import isKey from "./isKey";
/**
* Returns true if an Array can be created from the given Object, or in other
* words, if it has or not a length property, and the rest of its keys are Array
* ones.
*/
const isPossibleFromObject = ({length, ...rest}: Object): boolean =>
Object.keys(rest).every(isKey);
export default isPossibleFromObject;