How to use the underscore.isFunction function in underscore

To help you get started, we’ve selected a few underscore 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 mulesoft / api-notebook / src / scripts / lib / codemirror / sandbox-arguments.js View on Github external
return tokenHelpers.getProperty(cm, token, options, function (err, data) {
    if (err || !_.isFunction(data.context)) {
      return done(err);
    }

    // When the context is a function, retrieve the relevant documentation.
    middleware.trigger('completion:describe', data, function (err, describe) {
      return done(err, _.extend(data, {
        description: describe,
        to:          cur,
        token:       bracket,
        from:        bracket.pos
      }));
    }, true);
  });
};
github node-opcua / node-opcua / packages / node-opcua-secure-channel / source / server / server_secure_channel_layer.ts View on Github external
public close(callback?: ErrorCallback) {
        if (!this.transport) {
            if (_.isFunction(callback)) {
                callback();
            }
            return;
        }
        debugLog("ServerSecureChannelLayer#close");
        // close socket
        this.transport.disconnect(() => {
            this._abort();
            if (_.isFunction(callback)) {
                callback();
            }
        });
    }
github silentbalanceyh / vertx-ui / src / ux / engine / expression / I.datum.js View on Github external
const getDatum = (reference, config = {}, filter = () => true) => {
    let options = [];
    // 如果存在datum节点,则从Assist/Tabular数据源中读取
    const $config = parseDatum(config);
    const {source} = $config;
    if (source && "string" === typeof source) {
        let data = [];
        const processed = parseFilter(reference, filter);
        E.fxTerminal(!U.isArray(data), 10043, source);
        if (U.isFunction(processed)) {
            data = Datum.elementFindDatum(reference, source, {});
            data = data.filter(processed);
        } else {
            let filterData = {};
            if (processed && 0 < Object.keys(processed).length) {
                // 包含了Filter信息
                Object.assign(filterData, processed);
            }
            data = Datum.elementFindDatum(reference, source,
                0 < Object.keys(filterData).length ? filterData : {});
        }
        // 将data赋值给options
        options = data;
    } else {
        E.fxTerminal(true, 10044, source);
    }
github lrsjng / modulejs / test / tests-internal.js View on Github external
it('#has is function', function () {

		assert.ok(_.isFunction(MODJS.has));
	});
github keyteki / keyteki / test / server / cards / cancreatecards.spec.js View on Github external
                        target.mode && target.mode === 'select' && Object.values(target.choices).every(choice => !_.isFunction(choice))
                    ));
github silentbalanceyh / vertx-ui / src / extension / library / functions / action.js View on Github external
const _parseClick = (action, reference) => {
    const dataKey = action.onClick;
    if (!U.isFunction(dataKey)) {
        /*
         * 从 reference 中提取
         */
        const {$actions = {}} = reference.props;
        const actions = Ux.clone(O.DEFAULT_ACTION);
        Object.assign(actions, $actions);
        /*
         * ACTIONS 处理
         */
        const generator = actions[dataKey];
        if (U.isFunction(generator)) {
            const onClick = generator(reference);
            if (U.isFunction(onClick)) {
                action.onClick = onClick;
            }
        }
        /*
         * 未注入成功
         */
        if (!U.isFunction(action.onClick)) {
            action.onClick = () => {
                console.error("检查配置项:", action, dataKey);
            }
        }
    }
    return action;
};
github TheBrainFamily / chimpy / dist / lib / mocha / mocha-fiberized-ui.js View on Github external
context[method] = _.wrap(original, function (fn) {
        var args = Array.prototype.slice.call(arguments, 1);
        if (_.isFunction(_.last(args))) {
          args.push((0, _fiberize.fiberize)(args.pop()));
        }
        return fn.apply(this, args);
      });
      _.extend(context[method], _(original).pick('only', 'skip'));
github pwagener / backbone.conduit / src / haul.js View on Github external
mixin: function(Collection) {
        if (!_.isFunction(Collection.prototype.refill)) {
            refill.mixin(Collection);
        }

        if (!_.isFunction(Collection.prototype.fill)) {
            fill.mixin(Collection);
        }

        _.extend(Collection.prototype, mixinObj);
        return Collection;
    }
};
github silentbalanceyh / vertx-ui / src / ux / Ux.Debug.js View on Github external
const dgExecute = (consumer) => {
    if (consumer && U.isFunction(consumer)) {
        if (Boolean("development" === process.env.NODE_ENV && Constant.DEBUG)) {
            consumer();
        }
    }
};
/**