How to use the object function from is

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

49
50
51
52
53
54
55
56
57
58

  return this.craftRequest('FortSearch', payload);
}

releasePokemon(pokemonOrId) {
  const id = is.object(pokemonOrId) ? pokemonOrId.id : pokemonOrId;
  console.log('Releasing pokemon', pokemonOrId)
  const payload = {
    pokemon_id: id,
  };
fork icon16
star icon43
watch icon13

+ 9 other calls in file

11
12
13
14
15
16
17
18
19
20
const importsLoader = require.resolve('imports-loader')

// Go through each file and construct the final output
for (const file of options.files) {
  let scopedWith = ''
  let modulePath = is.object(file) ? file.path : file

  // Apply the expose-loader if required to
  if (is.array(file.provideAs) && file.provideAs.length > 0) {
    const exposes = []
fork icon4
star icon77
watch icon4

273
274
275
276
277
278
279
280
281
282
 *
 * @return {Boolean}
 */

KISSmetrics.prototype.loaded = function(){
  return is.object(window.KM);
};

/**
 * Page.
fork icon770
star icon0
watch icon2

91
92
93
94
95
96
97
98
99
100
 * @private
 * @throws {ExpressConsumerInvalidArgument}
 */
__validateErrorHandler() {
  if( !(
          is.object(this.__errorHandler) &&
          objectHasMethod(this.__errorHandler, 'handle')
  ))
    throw new ExpressConsumerInvalidArgument(
      message.errorHandler().title,
fork icon0
star icon9
watch icon5

55
56
57
58
59
60
61
62
63
64
}

let output = new Set();
let add = (value) => {output.add(value)};

if (is.array(input) || is.object(input)) {
  _.each(input, add);
}
else if (input instanceof Map) {
  _.each(input.values(), add);
fork icon0
star icon2
watch icon5

+ 9 other calls in file

13
14
15
16
17
18
19
20
21
22
 * limitations under the License.
 */

'use strict';
var is = require('is');
var isObject = is.object;
var isFunction = is.fn;
var ErrorMessage = require('../classes/error-message.js');
var hapiRequestInformationExtractor = require('../request-extractors/hapi.js');
var errorHandlerRouter = require('../error-router.js');
fork icon558
star icon1
watch icon2

+ 3 other calls in file

20
21
22
23
24
25
26
27
28
29

var validatePastFirstError = !!opts.validatePastFirstError;

keys(fields).forEach(function (k) {
    // if it's not a field object, create an object field.
    if (!is.fn(fields[k].toHTML) && is.object(fields[k])) {
        // eslint-disable-next-line no-param-reassign
        fields[k] = exports.fields.object(fields[k], opts);
    }
    // eslint-disable-next-line no-param-reassign
fork icon170
star icon0
watch icon29

+ 15 other calls in file

10
11
12
13
14
15
16
17
18
if (this.files[f] !== undefined) {
  return
}

const optsObj = is.object(opts) && is.function(cb) ? opts : { ignoreInitial: true }
const _cb = is.object(opts) && is.function(cb) ? cb : opts

// Initiate a new watcher
this.files[f] = chokidar.watch(f, optsObj)
fork icon4
star icon77
watch icon4

+ 3 other calls in file

58
59
60
61
62
63
64
65
66
67
 * @api private
 * @return {boolean}
 */

Sentry.prototype.loaded = function() {
  return is.object(window.Raven);
};

/**
 * Identify.
fork icon8
star icon0
watch icon3

+ 3 other calls in file