How to use the core-util-is.isFunction 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 ueboot / ueboot / ueboot-view / src / components / form-grid / UFormGrid.vue View on Github external
c.render = (h, params) => {
                            // 使用当前作用域
                            let _this = this;
                            let originKey = c.key;
                            // 获取原始值
                            if (c.key.endsWith('_format')) {
                                originKey = c.key.substr(0, c.key.length - 7);
                            }
                            let value = this.tableFieldFormat(c, h, params);
                            let originValue = params['row'][originKey] || '';
                            let tmp = [...originValue];
                            if (c.renderType === 'tooltip') {
                                // 如果存在内容格式化回调,则允许自定义格式内容
                                if (util.isFunction(c.contentFormat)) {
                                    let a = c.contentFormat(originValue, params['row']);
                                    tmp = [...a];
                                }
                                let i = 0;
                                let str = [];
                                let tmpStr = [];
                                for (let t of tmp) {
                                    tmpStr.push(t);
                                    if (i > 15) {
                                        i = 0;
                                        str.push(h('p', tmpStr.join('')));
                                        tmpStr = [];
                                    }
                                    i++;
                                }
                                str.push(h('p', tmpStr.join('')));
github atg / choc-support / building / javascript / node [default] / node_modules / jshint / node_modules / htmlparser2 / node_modules / readable-stream / lib / _stream_readable.js View on Github external
if (state.decoder)
      chunk = state.decoder.write(chunk);
    if (!chunk || !state.objectMode && !chunk.length)
      return;

    var ret = self.push(chunk);
    if (!ret) {
      paused = true;
      stream.pause();
    }
  });

  // proxy all the other methods.
  // important when wrapping filters and duplexes.
  for (var i in stream) {
    if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
      this[i] = function(method) { return function() {
        return stream[method].apply(stream, arguments);
      }}(i);
    }
  }

  // proxy certain important events.
  var events = ['error', 'close', 'destroy', 'pause', 'resume'];
  forEach(events, function(ev) {
    stream.on(ev, self.emit.bind(self, ev));
  });

  // when we try to consume some more bytes, simply unpause the
  // underlying stream.
  self._read = function(n) {
    debug('wrapped _read', n);
github kaelzhang / node-comment-json / src / stringify.js View on Github external
function stringify (key, holder, gap) {
  let value = holder[key]

  // If the value has a toJSON method, call it to obtain a replacement value.
  if (isObject(value) && isFunction(value.toJSON)) {
    value = value.toJSON(key)
  }

  // If we were called with a replacer function, then call the replacer to
  // obtain a replacement value.
  if (isFunction(replacer)) {
    value = replacer.call(holder, key, value)
  }

  switch (typeof value) {
  case 'string':
    return quote(value)

  case 'number':
    // JSON numbers must be finite. Encode non-finite numbers as null.
    return Number.isFinite(value) ? String(value) : STR_NULL

  case 'boolean':
  case 'null':

    // If the value is a boolean or null, convert it to a string. Note:
    // typeof null does not produce 'null'. The case is included here in
github biosustain / ancestry / jspm_packages / npm / readable-stream@1.1.14 / lib / _stream_transform.js View on Github external
this.once('prefinish', function() {
      if (util.isFunction(this._flush))
        this._flush(function(er) {
          done(stream, er);
        });
      else
        done(stream);
    });
  }
github krakenjs / swaggerize-routes / lib / buildroutes.js View on Github external
function resolve(basedir, pathname, method) {
    var handler;
    try {
        //If the pathname is already a resolved function, return it.
        //In the case of x-handler and x-authorize, users can define
        //external handler/authorize modules and functions OR override
        //existing x-authorize functions.
        if (thing.isFunction(pathname)) {
            return pathname;
        }

        pathname = path.resolve(basedir, pathname);
        handler = require(pathname);

        if (thing.isFunction(handler)) {
            return handler;
        }

        return method && handler[method];
    }
    catch (error) {
        utils.debuglog('Could not find %s.', pathname);
        return;
    }
github TheBroox / TextAdventure.js / node_modules / express / node_modules / connect / node_modules / multiparty / node_modules / readable-stream / lib / _stream_writable.js View on Github external
Writable.prototype.write = function(chunk, encoding, cb) {
  var state = this._writableState;
  var ret = false;

  if (util.isFunction(encoding)) {
    cb = encoding;
    encoding = null;
  }

  if (util.isBuffer(chunk))
    encoding = 'buffer';
  else if (!encoding)
    encoding = state.defaultEncoding;

  if (!util.isFunction(cb))
    cb = function() {};

  if (state.ended)
    writeAfterEnd(this, state, cb);
  else if (validChunk(this, state, chunk, cb)) {
    state.pendingcb++;
    ret = writeOrBuffer(this, state, chunk, encoding, cb);
  }

  return ret;
};
github TheBroox / TextAdventure.js / node_modules / express / node_modules / connect / node_modules / multiparty / node_modules / readable-stream / lib / _stream_writable.js View on Github external
Writable.prototype.write = function(chunk, encoding, cb) {
  var state = this._writableState;
  var ret = false;

  if (util.isFunction(encoding)) {
    cb = encoding;
    encoding = null;
  }

  if (util.isBuffer(chunk))
    encoding = 'buffer';
  else if (!encoding)
    encoding = state.defaultEncoding;

  if (!util.isFunction(cb))
    cb = function() {};

  if (state.ended)
    writeAfterEnd(this, state, cb);
  else if (validChunk(this, state, chunk, cb)) {
    state.pendingcb++;