src/cli/commands/helpers/isCommand.js

Summary

Maintainability
A
0 mins
Test Coverage
import { isPlainObject, isString, isFunction } from 'lodash';

// The property "command" is special and can not be used as a command
export default function isCommand(commandsObject) {
    return (potentialCommmand) =>
        potentialCommmand !== '__meta' && (
        (
            isString(commandsObject[potentialCommmand]) ||
            isFunction(commandsObject[potentialCommmand])
        ) || (
            isPlainObject(commandsObject[potentialCommmand]) &&
            commandsObject[potentialCommmand].command !== undefined
        ));
}