How to use the pickSchema function from underscore

Find comprehensive JavaScript underscore.pickSchema code examples handpicked from public code repositorys.

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);
fork icon0
star icon2
watch icon3

+ 7 other calls in file

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)) {
fork icon0
star icon2
watch icon0

+ 3 other calls in file

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(
fork icon0
star icon2
watch icon0

+ 15 other calls in file

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) {
fork icon0
star icon2
watch icon0

+ 3 other calls in file

22
23
24
25
26
27
28
29
30
31

newOrganization = _.extend(
    newOrganization,
    _.pick(
        _.omit(organization, Utils.nonCloneable),
        _.pickSchema(organizationModel)
    )
);

if (
fork icon0
star icon2
watch icon0