Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
});
};
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();
}
});
}
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);
}
it('#has is function', function () {
assert.ok(_.isFunction(MODJS.has));
});
target.mode && target.mode === 'select' && Object.values(target.choices).every(choice => !_.isFunction(choice))
));
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;
};
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'));
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;
}
};
const dgExecute = (consumer) => {
if (consumer && U.isFunction(consumer)) {
if (Boolean("development" === process.env.NODE_ENV && Constant.DEBUG)) {
consumer();
}
}
};
/**