How to use the core-util-is.isString function in core-util-is

To help you get started, we’ve selected a few core-util-is examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github caviarjs / caviar / src / base / caviar.js View on Github external
async run (phase = PHASE_DEFAULT) {
    if (!isString(phase)) {
      throw error('INVALID_PHASE', phase)
    }

    this[INIT_ENV](phase)

    const ret = await this._run(phase)

    // If caviar is in a child process
    if (this[IS_CHILD_PROCESS]) {
      process.send({
        type: CAVIAR_MESSAGE_COMPLETE
      })

      return
    }
github Andyliwr / FE-learning-load / task08 / lidikang / styles / node_modules / readable-stream / lib / _stream_writable.js View on Github external
function validChunk(stream, state, chunk, cb) {
  var valid = true;
  if (!util.isBuffer(chunk) &&
      !util.isString(chunk) &&
      !util.isNullOrUndefined(chunk) &&
      !state.objectMode) {
    var er = new TypeError('Invalid non-string/buffer chunk');
    stream.emit('error', er);
    process.nextTick(function() {
      cb(er);
    });
    valid = false;
  }
  return valid;
}
github geneontology / noctua / node_modules.hiding / express-persona / node_modules / connect / node_modules / multiparty / node_modules / readable-stream / lib / _stream_writable.js View on Github external
function validChunk(stream, state, chunk, cb) {
  var valid = true;
  if (!util.isBuffer(chunk) &&
      !util.isString(chunk) &&
      !util.isNullOrUndefined(chunk) &&
      !state.objectMode) {
    var er = new TypeError('Invalid non-string/buffer chunk');
    stream.emit('error', er);
    process.nextTick(function() {
      cb(er);
    });
    valid = false;
  }
  return valid;
}
github kaelzhang / ctrip-apollo / src / util.js View on Github external
_child (name, ...args) {
    if (!isString(name)) {
      throw error(this._errorCode, name)
    }

    if (name in this._children) {
      return this._children[name]
    }

    return this._children[name] = this._create(name, ...args)
  }
github onmyway133 / IconGenerator / node_modules / readable-stream / lib / _stream_readable.js View on Github external
function chunkInvalid(state, chunk) {
  var er = null;
  if (!util.isBuffer(chunk) &&
      !util.isString(chunk) &&
      !util.isNullOrUndefined(chunk) &&
      !state.objectMode) {
    er = new TypeError('Invalid non-string/buffer chunk');
  }
  return er;
}
github cytle / wechat_web_devtools / package.nw / node_modules / decompress-zip / node_modules / readable-stream / lib / _stream_readable.js View on Github external
function chunkInvalid(state, chunk) {
  var er = null;
  if (!util.isBuffer(chunk) &&
      !util.isString(chunk) &&
      !util.isNullOrUndefined(chunk) &&
      !state.objectMode) {
    er = new TypeError('Invalid non-string/buffer chunk');
  }
  return er;
}
github krakenjs / swaggerize-routes / lib / buildroutes.js View on Github external
security[defName].scopes.forEach(function (scope) {
                assert.ok(thing.isString(scope) && Object.keys(securityDefinitions[defName].scopes).indexOf(scope) > -1, 'Unrecognized scope (' + scope + ').');
            });
github victorporof / Sublime-JSHint / scripts / node_modules / jshint / node_modules / htmlparser2 / node_modules / readable-stream / lib / _stream_writable.js View on Github external
function decodeChunk(state, chunk, encoding) {
  if (!state.objectMode &&
      state.decodeStrings !== false &&
      util.isString(chunk)) {
    chunk = new Buffer(chunk, encoding);
  }
  return chunk;
}
github apinf / openapi-designer / node_modules / readable-stream / lib / _stream_writable.js View on Github external
function decodeChunk(state, chunk, encoding) {
  if (!state.objectMode &&
      state.decodeStrings !== false &&
      util.isString(chunk)) {
    chunk = new Buffer(chunk, encoding);
  }
  return chunk;
}
github strongloop / angular-live-set / modules / change-stream / stream.js View on Github external
Readable.prototype.push = function(chunk, encoding) {
  var state = this._readableState;

  if (util.isString(chunk) && !state.objectMode) {
    encoding = encoding || state.defaultEncoding;
    if (encoding !== state.encoding) {
      chunk = new Buffer(chunk, encoding);
      encoding = '';
    }
  }

  return readableAddChunk(this, state, chunk, encoding, false);
};