I think it'd be better to use underscore here: `if (_.isString(end)) {`