How to use the string function from is

Find comprehensive JavaScript is.string code examples handpicked from public code repositorys.

221
222
223
224
225
226
227
228
229
230
 * });
 */
TransactionRequest.prototype.createReadStream = function(table, query) {
  var self = this;

  if (is.array(query) || is.string(query)) {
    query = {
      keys: query
    };
  }
fork icon559
star icon0
watch icon2

21
22
23
24
25
26
27
28
29
var maxBy = require('lodash.maxby');
var random = require('lodash.random');
var is = require('is');
var isNumber = is.number;
var isObject = is.object;
var isString = is.string;
var isArray = is.array;
var isNull = is.null;
var isFunction = is.function;
fork icon557
star icon0
watch icon3

103
104
105
106
107
108
109
110
111
112

set(key, config, force = false) {
  if (toType(config) !== toType(this.__webpackConfig[key])) {
    force = true;
  }
  if (force || is.string(config)) {
    this.__webpackConfig[key] = config;
  } else if (is.object(config)) {
    this.__webpackConfig[key] = extend(
      true,
fork icon275
star icon0
watch icon97

+ 39 other calls in file

132
133
134
135
136
137
138
139
140
141

        var iterator = arguments.length > 1 ? arguments[1] : arguments[0];
        var name = arguments.length > 1 ? arguments[0] : void 0;

        return reduce(form.fields, function (html, field, k) {
            var kname = is.string(name) ? name + '[' + k + ']' : k;
            return html + field.toHTML(kname, iterator);
        }, '');
    }
};
fork icon170
star icon0
watch icon29

+ 15 other calls in file

39
40
41
42
43
44
45
46
47
48
  notifications: []
};
window.clevertap.enablePersonalization = true;
window.clevertap.account.push({ id: this.options.clevertap_account_id });
var region = this.options.region;
if (region && is.string(region)) {
  // the hardcoded value actually returns 'in.' intentionally w the period because it is used for the direct integration
  // and since dealing with mongo is much more painful, we will strip here
  window.clevertap.region = region.replace('.', '');
}
fork icon144
star icon0
watch icon0

+ 3 other calls in file

80
81
82
83
84
85
86
87
88
89
  throw new Error(
    `validator must be of type function or string, received ${typeof options.validator}`
  );
}

const validatorName = is.string(options.validator) ? options.validator : '';
const validatorFn = getValidatorFn(options.validator);

if (is.undef(validatorFn)) {
  throw new Error(
fork icon47
star icon382
watch icon4

+ 4 other calls in file

57
58
59
60
61
62
63
64
65
66

let page

if (!this.query) {
  page = this.defaults
} else if (is.number(this.query) || is.string(this.query)) {
  page = this.parseNumber()
} else {
  page = this.parseObject()
}
fork icon11
star icon103
watch icon4

+ 3 other calls in file

12
13
14
15
16
17
18
19
20
21

const OPCODE = constant.opcode;
const STATUS = constant.status;

function valKey(k) {
  assert(k && is.string(k) || Buffer.isBuffer(k) && k.length, 'key must be a non-empty string or buffer');
}
function valValue(v) {
  assert(v !== null && v !== undefined && !is.function(v), 'value cannot be null or undefined or function');
}
fork icon0
star icon10
watch icon12

+ 3 other calls in file

104
105
106
107
108
109
110
111
112
113
  throw new Error(
    `validator must be of type function or string, received ${typeof options.validator}`
  )
}

const validatorName = is.string(options.validator) ? options.validator : ''
const validatorFn = getValidatorFn(options.validator)

if (is.undef(validatorFn)) {
  throw new Error(
fork icon47
star icon1
watch icon7