Socket
Socket
Sign inDemoInstall

@strapi/utils

Package Overview
Dependencies
Maintainers
10
Versions
1271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strapi/utils - npm Package Compare versions

Comparing version 4.0.0-next.13 to 4.0.0-next.14

lib/pagination.js

29

lib/convert-query-params.js

@@ -9,2 +9,3 @@ 'use strict';

const _ = require('lodash');
const parseType = require('./parse-type');

@@ -33,2 +34,6 @@ const QUERY_OPERATORS = ['_where', '_or', '_and'];

const convertCountQueryParams = countQuery => {
return parseType({ type: 'boolean', value: countQuery });
};
/**

@@ -166,3 +171,3 @@ * Sort query parser

// TODO: We will need to consider a way to add limitation / pagination
const { sort, filters, fields, populate } = subPopulate;
const { sort, filters, fields, populate, count } = subPopulate;

@@ -187,2 +192,6 @@ const query = {};

if (count) {
query.count = convertCountQueryParams(count);
}
return query;

@@ -213,19 +222,2 @@ };

// TODO: migrate
const VALID_REST_OPERATORS = [
'eq',
'ne',
'in',
'nin',
'contains',
'ncontains',
'containss',
'ncontainss',
'lt',
'lte',
'gt',
'gte',
'null',
];
module.exports = {

@@ -238,4 +230,3 @@ convertSortQueryParams,

convertFieldsQueryParams,
VALID_REST_OPERATORS,
QUERY_OPERATORS,
};

@@ -7,3 +7,3 @@ 'use strict';

const { buildQuery, hasDeepFilters } = require('./build-query');
const { VALID_REST_OPERATORS, QUERY_OPERATORS } = require('./convert-query-params');
const { QUERY_OPERATORS } = require('./convert-query-params');
const parseMultipartData = require('./parse-multipart');

@@ -35,2 +35,3 @@ const sanitizeEntity = require('./sanitize-entity');

const providerFactory = require('./provider-factory');
const pagination = require('./pagination');

@@ -42,3 +43,2 @@ module.exports = {

templateConfiguration,
VALID_REST_OPERATORS,
QUERY_OPERATORS,

@@ -70,2 +70,3 @@ buildQuery,

providerFactory,
pagination,
};

@@ -51,5 +51,5 @@ 'use strict';

// Relations
const isRelation = attribute && attribute.type === 'relation';
const isRelation = attribute && ['relation', 'component'].includes(attribute.type);
if (isRelation) {
const relation = attribute && attribute.target;
const relation = attribute && (attribute.target || attribute.component);

@@ -132,14 +132,16 @@ if (_.isNil(value)) {

return _.concat(
includeFields || [],
...(isOutput
? [
STATIC_FIELDS,
CREATED_AT_ATTRIBUTE,
UPDATED_AT_ATTRIBUTE,
COMPONENT_FIELDS,
...nonWritableAttributes,
...nonVisibleAttributes,
]
: [STATIC_FIELDS, COMPONENT_FIELDS, ...nonVisibleWritableAttributes])
return _.uniq(
_.concat(
includeFields || [],
...(isOutput
? [
STATIC_FIELDS,
CREATED_AT_ATTRIBUTE,
UPDATED_AT_ATTRIBUTE,
COMPONENT_FIELDS,
...nonWritableAttributes,
...nonVisibleAttributes,
]
: [STATIC_FIELDS, COMPONENT_FIELDS, ...nonVisibleWritableAttributes])
)
);

@@ -146,0 +148,0 @@ };

{
"name": "@strapi/utils",
"version": "4.0.0-next.13",
"version": "4.0.0-next.14",
"description": "Shared utilities for the Strapi packages",

@@ -8,5 +8,3 @@ "homepage": "https://strapi.io",

"strapi",
"utilities",
"utils",
"winston"
"utils"
],

@@ -19,7 +17,5 @@ "directories": {

"@sindresorhus/slugify": "1.1.0",
"date-fns": "^2.19.0",
"date-fns": "2.24.0",
"lodash": "4.17.21",
"pino": "^4.7.1",
"pluralize": "^8.0.0",
"yup": "^0.32.9"
"yup": "0.32.9"
},

@@ -50,3 +46,3 @@ "author": {

"license": "SEE LICENSE IN LICENSE",
"gitHead": "c1369c796034fb1b57471498eb1e0c75ce2d7715"
"gitHead": "9b2bc8ed5d39e6b7c3a1b0767b73028b5292467b"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc