• Immediately resolving promise to retrieve command. Rejected with Error when command is not found. Rejecting with CommandNotFoundError on error.

    Parameters

    • editor: default

      editor instance

    • commandName: string

      command name to search for

    Returns Promise<default>

    Example

    ifCommand(editor, commandName)
    .then(handler)
    .catch(optionalCommandNotFound);