Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return aux;
});
}
const metadataUi = this.getNodeParameter('metadataUi') as IDataObject;
if (!_.isEmpty(metadataUi)) {
// @ts-ignore
body.message.metadata = _.map(metadataUi.metadataValues, (o) => {
const aux: IDataObject = {};
aux[o.name] = o.value;
return aux;
});
}
const mergeVarsUi = this.getNodeParameter('mergeVarsUi') as IDataObject;
if (!_.isEmpty(mergeVarsUi)) {
// @ts-ignore
body.message.global_merge_vars = _.map(mergeVarsUi.mergeVarsValues, (o) => {
const aux: IDataObject = {};
aux.name = o.name;
aux.content = o.content;
return aux;
});
}
const attachmentsUi = this.getNodeParameter('attachmentsUi') as IDataObject;
let attachmentsBinary = [], attachmentsValues = [];
if (!_.isEmpty(attachmentsUi)) {
if (attachmentsUi.hasOwnProperty('attachmentsValues')
&& !_.isEmpty(attachmentsUi.attachmentsValues)) {
// @ts-ignore
const vNode = xmlq.findChild(node, 'v');
this._value = vNode && Number(vNode.children[0]);
}
// Delete known attributes.
delete node.attributes.r;
delete node.attributes.s;
delete node.attributes.t;
// If any unknown attributes are still present, store them for later output.
if (!_.isEmpty(node.attributes))
this._remainingAttributes = node.attributes;
// Delete known children.
xmlq.removeChild(node, 'f');
xmlq.removeChild(node, 'v');
xmlq.removeChild(node, 'is');
// If any unknown children are still present, store them for later output.
if (!_.isEmpty(node.children))
this._remainingChildren = node.children;
}
}
function init(cb){
filters.fields = parseArgs( flags.fields );
filters.module = flags.module
if(_.isEmpty(filters.module)){
_this.prompts.push( prompts.module )
}
if(_.isEmpty(filters.fields)){
_this.prompts.push( prompts.fields )
}
if(_.size( _this.prompts )){
if(_this.prompts[0].name === 'module'){
_this.prompts[0].choices = findModules();
}
startPrompt( next );
} else {
next({});
savePreferenceToNativeStore (params = {}) {
const { user, system, others } = separateConfig(params)
if (!isEmpty(system)) {
console.info('[Motrix] save system config: ', system)
application.configManager.setSystemConfig(system)
this.changeGlobalOption(system)
}
if (!isEmpty(user)) {
console.info('[Motrix] save user config: ', user)
application.configManager.setUserConfig(user)
}
if (!isEmpty(others)) {
console.info('[Motrix] save config found iillegal key: ', others)
}
}
public async upload () {
const ctx = this.ctx;
if (_.isEmpty(ctx.request.files)) {
throw new Error('上传文件为空');
}
const file = ctx.request.files[0];
try {
const extend = file.filename.split('.');
const name = moment().format('YYYYMMDD') + '/' + uuid() + '.' + extend[extend.length - 1];
const result = await ctx.oss.put(name, file.filepath);
if (result.url && result.url.indexOf('http://') !== -1) {
result.url = result.url.replace('http', 'https');
}
return result;
} catch (err) {
throw new Error('上传文件失败:' + err);
}
}
domainForQueryConfigured(domain) {
const isEmpty = !isDefined(domain) || (_.isEmpty(domain.fields) &&
_.isEmpty(domain.aliases) &&
_.isEmpty(domain.indexes));
return !isEmpty;
},
domainForStoreConfigured,
const isTokenEmptyProperty = (key, value) => {
return key === 'token' || value === undefined || value === null
|| (Array.isArray(value) && _.isEmpty(value)) || (typeof value === 'object' && _.isEmpty(value));
};
.map((x, i) => {
let key = this.options.transformKeys.call(this, x)
let type = CrystalUtil.crystalType(this.properties[x])
if (type === 'class') {
if (_.isEmpty(this.properties[x])) {
type = 'Hash(JSON::Any, JSON::Any)'
} else {
const klass = new CrystalClass(this.properties[x], key, _.defaultsDeep({ baseIndent: indentLevel - 1 }, this.options))
this.subclasses.push(klass)
type = klass.name
}
} else if (type === 'array') {
const ary = new CrystalArray(this.properties[x], _.defaultsDeep({ baseIndent: indentLevel - 1 }, this.options))
type = ary.toString()
this.subclasses = this.subclasses.concat(ary.classes)
}
let str = `${key}: `
if (this.options.explicit || key !== x) {
str += `{ `
graphs => {
if (_.isEmpty(graphs)) {
return Kefir.constant([]);
} else {
return Kefir.combine(_.map(graphs, deserializeArgument));
}
}
).toProperty();
static fromProtocol(dockerInfoProtocol, secrets) {
let secretRef = get(dockerInfoProtocol, 'auth.password', '');
let auth;
if (!isNil(secretRef)) {
let secretKey = SECRET_PATTERN.exec(secretRef);
secretKey = isEmpty(secretKey) ? '' : secretKey[1];
if (!isEmpty(secretKey) && !isNil(secrets[secretKey])) {
auth = { ...dockerInfoProtocol.auth, password: secrets[secretKey] };
} else {
auth = {};
secretRef = '';
}
}
const isUseCustomizedDocker = DockerInfo.isUseCustomizedDocker(
dockerInfoProtocol.uri,
);
return new DockerInfo({
...dockerInfoProtocol,
auth: auth,
secretRef: secretRef,
isUseCustomizedDocker: isUseCustomizedDocker,
});