Skip to content

Commit

Permalink
Merge pull request #16 from contentstack/fix/code_scan
Browse files Browse the repository at this point in the history
fix: fixed code scan issue
  • Loading branch information
netrajpatel authored Jan 10, 2023
2 parents 519ab1f + 09b882c commit 3b20394
Show file tree
Hide file tree
Showing 6 changed files with 3,844 additions and 14 deletions.
4 changes: 2 additions & 2 deletions dist/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ class Stack {
except(fields) {
if (fields && typeof fields === 'object' && fields instanceof Array && fields.length) {
this.q.except = [];
const keys = Object.keys(this.contentStore.projections);
const keys = Object.keys(this.contentStore.projections).filter(key => this.contentStore.projections[key] === 0);
this.q.except = keys.concat(fields);
return this;
}
Expand Down Expand Up @@ -1051,7 +1051,7 @@ class Stack {
this.q.desc = this.contentStore.defaultSortingField;
}
if (!this.q.hasOwnProperty('except') && !this.q.hasOwnProperty('only')) {
const keys = Object.keys(this.contentStore.projections);
const keys = Object.keys(this.contentStore.projections).filter(key => this.contentStore.projections[key] === 0);
this.q.except = keys;
}
this.q.referenceDepth = (typeof this.q.referenceDepth === 'number') ? this.q.referenceDepth : this.contentStore
Expand Down
2 changes: 1 addition & 1 deletion dist/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const mkdirp_1 = require("mkdirp");
const path_1 = require("path");
const fs_1 = require("./fs");
const index_1 = require("./index");
const localePaths = {};
const localePaths = Object.create(null);
const difference = (obj, baseObj) => {
const changes = (data, base) => {
return (0, lodash_1.transform)(data, (result, value, key) => {
Expand Down
Loading

0 comments on commit 3b20394

Please sign in to comment.