Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseASTComments(astNode) {
var comments = [];
if(astNode && astNode.leadingComments) {
_.forEach(astNode.leadingComments, function(comment) {
if(comment.type === 'Block') {
comments = comments.concat(comment.value.split('\n').map(function(commentLine) {
// Remove asterisks at the start of the line
return commentLine.replace(/^\s*\*\s*/g, '').trim();
}));
} else {
comments.push(comment.value);
}
});
}
return comments;
}
_.forEach(row, (cell, colKey) => {
style[rowKey][colKey] = cell;
let tempCellStyle = cell.s;
cell.s = {};
/* xfs[cell.s]
* {
font: 0,
color: 2,
bgColor: 0
}
* */
_.forEach(xfs[tempCellStyle], (val, xfsKey) => {
//处理 styles 是数组的情况 font: [['b', 'i', 's', 'u']], border: [['left', 'right']],
//xfsKey 为 font border color等
if (Array.isArray(styles[xfsKey][val])) {
styles[xfsKey][val].forEach(v => {
cell.s[v] = true;
});
} else {
cell.s[xfsKey] = styles[xfsKey][val];
}
});
});
});
describe(param, () => {
_.forEach(tests, (test) => {
const newOpts: any = {};
if (param !== 'uri') {
newOpts.uri = '/user';
}
newOpts[param] = test.value;
if (test.message) {
it(param + ' should not accept ' + test.value, (done) => {
expectValidationError(newOpts, test.message, done);
});
} else {
it(param + ' should accept ' + test.value, () => {
return api.request(newOpts).then(() => {
if (test.uriContains) {
expect(_.includes(reqOpts.uri, test.uriContains)).toBe(true);
}
return null;
(function _cleanCircular(obj, namespace) {
_.forEach(obj, function (v, k) {
if (!obj.hasOwnProperty(k)) return
var i = cached.indexOf(v)
if (v === obj) {
obj[k] = "{circular reference of root object}"
} else if (i !== -1) {
obj[k] = "{circular reference of " + cachedNamespace[i] + "}"
} else {
if (_.isArray(v) || _.isObject(v)) {
cached.push(v)
namespace.push(k)
cachedNamespace.push(namespace.join('.'))
_cleanCircular(v, namespace)
}
}
})
formatBalances(ccxtData)
{
let result = {};
_.forEach(ccxtData.total, (balance, currency) => {
if (0 == balance)
{
return;
}
result[currency] = this.formatBalance(currency, ccxtData[currency]);
});
return result;
}
handleAuthEnabled(value: boolean) {
let authItems = ["rackhdPassword", "rackhdUsername", "rackhdAuthToken"];
_.forEach(authItems, (item) => {
let formItem = this.settingFormGroup.get('rackhdAuth.' + item);
value ? formItem.enable() : formItem.disable();
})
}
_.forEach(template.sections, (section) => {
_.forEach(section.subSections, (subSection) => {
if (subSection.type === 'questions') {
_.forEach(subSection.questions, (question) => {
if(question.type === 'estimation') {
estimationQuestion = question
estimationQuestion.title = 'Project Scope'
return false
}
})
}
})
})
}
function getIdMatch(options) {
if (options.id) {
return { _id: options.id }
}
const match = {}
_.forEach(options, (val, key) => {
if (key.indexOf('id')) {
match[key] = val
}
})
return match
}
function wrapProperties(object, namespace, properties) {
_.forEach(properties, property => {
appendProperty(object, namespace, property);
});
}
[GLOSSARY_TERMS_SUCCESS]: (state, action) => {
let terms = {}
forEach(action.payload.entities.glossaryTerms, (entry) => {
terms[entry.id] = GlossaryHelper.generateEntry(entry, state.locale)
})
return {
...state,
termsLoading: false,
termsLastUpdated: action.meta.receivedAt,
terms,
termIds: action.payload.result.results,
termCount: action.payload.result.totalCount
}
},
[GLOSSARY_TERMS_FAILURE]: (state, action) => ({