How to use the pickSchema function from underscore
Find comprehensive JavaScript underscore.pickSchema code examples handpicked from public code repositorys.
GitHub: Cloud-V/Backend
386 387 388 389 390 391 392 393 394 395
if (!entry) { return reject({ error: "Cannot find targeted entry.", }); } const validPaths = _.pickSchema( require("../models/repo_file").model, Utils.nonCloneable ); updates = _.pick(updates, validPaths);
0
2
3
+ 7 other calls in file
GitHub: Cloud-V/Backend
376 377 378 379 380 381 382 383 384 385
} query.deleted = false; query.authComplete = true; query.type = UserType.Regular; return new Promise(async (resolve, reject) => { const userPaths = _.pickSchema(userModel); const projection = _.reduce( userPaths, (accum, val) => { if (!/\./.test(val)) {
0
2
0
+ 3 other calls in file
GitHub: Cloud-V/Backend
214 215 216 217 218 219 220 221 222 223
favorites: 0, watches: 0, ownerName: "", }; newRepo = new repoModel(); const cloneablePaths = _.pickSchema(repoModel, Utils.nonCloneable); const sourceExtension = _.pick(clone(sourceRepo), cloneablePaths); newRepo = _.extend(newRepo, sourceExtension); newRepo = _.extend(newRepo, newExtension); _.each(
0
2
0
+ 15 other calls in file
GitHub: Cloud-V/Backend
8 9 10 11 12 13 14 15 16 17
newToken = _.extend( newToken, _.pick( _.omit(tokenData, Utils.nonCloneable), _.pickSchema(callbackTokenModel) ) ); return newToken.save(function (err, createdToken) {
0
2
0
+ 3 other calls in file
GitHub: Cloud-V/Backend
22 23 24 25 26 27 28 29 30 31
newOrganization = _.extend( newOrganization, _.pick( _.omit(organization, Utils.nonCloneable), _.pickSchema(organizationModel) ) ); if (
0
2
0
underscore.keys is the most popular function in underscore (11266 examples)