@autofleet/sheilta 1.3.10-beta.0 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,7 @@ const formatPerPage = perPage => perPage || utils_1.PER_PAGE_DEFAULT;
79
79
  const formatInclude = (include, associationsMap = {}) => {
80
80
  let formattedInclude = include.map((i) => {
81
81
  var _a;
82
- const includedAssociation = associationsMap[i.association || i.model];
82
+ const includedAssociation = associationsMap[typeof i === 'string' ? i : (i.association || i.model)];
83
83
  return Object.assign(Object.assign(Object.assign({}, i), { association: includedAssociation, required: i.required !== false }), (i.include && {
84
84
  include: formatInclude(i.include, (_a = includedAssociation === null || includedAssociation === void 0 ? void 0 : includedAssociation.target) === null || _a === void 0 ? void 0 : _a.associations),
85
85
  }));
@@ -131,7 +131,6 @@ const formatPayload = ({ order = [], page = utils_1.PAGE_DEFAULT, perPage = util
131
131
  order: [...order, DEFAULT_ORDER],
132
132
  associationModels,
133
133
  });
134
- console.log('formattedOrders: ', formattedOrders);
135
134
  const [filteredFormattedOrder, filteredLiteralAttributes] = getAttributeFromOrder(formattedOrders, options);
136
135
  const allAttributes = [...filteredLiteralAttributes, ...(attributes || [])];
137
136
  const formattedAttribute = (attributes === null || attributes === void 0 ? void 0 : attributes.length) ? allAttributes : { include: allAttributes };
@@ -44,7 +44,7 @@ const validateQueryPayload = (query, rawAttributes, associationModels = []) => {
44
44
  // eslint-disable-next-line array-callback-return
45
45
  Object.keys(query).map((key) => {
46
46
  const value = query[key];
47
- if (lodash_1.default.isArray(value)) {
47
+ if (Array.isArray(value)) {
48
48
  if (lodash_1.default.isObject(value[0])) {
49
49
  value.map(v => validateQueryPayload(v, rawAttributes, associationModels));
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/sheilta",
3
- "version": "1.3.10-beta.0",
3
+ "version": "1.3.10",
4
4
  "description": "manage cache",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",