UNPKG

rubico

Version:

[a]synchronous functional programming

26 lines (24 loc) 496 B
/** * @name isString * * @synopsis * ```coffeescript [specscript] * isString(value any) -> boolean * ``` * * @description * Determine whether a value is a string. * * ```javascript [playground] * import isString from 'https://unpkg.com/rubico/dist/x/isString.es.js' * * console.log( * isString('hey'), * ) // true * ``` */ const isString = function (value) { return typeof value == 'string' || (value != null && value.constructor == String) } module.exports = isString