New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ptc-org/nestjs-query-core

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ptc-org/nestjs-query-core - npm Package Compare versions

Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4

2

package.json
{
"name": "@ptc-org/nestjs-query-core",
"version": "1.0.0-alpha.3",
"version": "1.0.0-alpha.4",
"description": "Base query package",

@@ -5,0 +5,0 @@ "author": "doug-martin <doug@dougamartin.com>",

@@ -74,3 +74,7 @@ "use strict";

const getFilterComparisons = (filter, key) => {
let results = [];
const results = [];
if (filter.and || filter.or) {
const filters = [...(filter.and ?? []), ...(filter.or ?? [])];
filters.forEach((f) => (0, exports.getFilterComparisons)(f, key).forEach((comparison) => results.push(comparison)));
}
const comparison = (0, exports.getFilterFieldComparison)(filter, key);

@@ -80,23 +84,41 @@ if ((0, exports.isComparison)(comparison)) {

}
else if (Array.isArray(filter)) {
filter.forEach((f) => {
results = results.concat((0, exports.getFilterComparisons)(f, key));
});
}
if (typeof filter === 'object') {
Object.keys(filter).forEach((subFilterKey) => {
const subFilter = filter[subFilterKey];
if (subFilterKey === key) {
results.push(subFilter);
}
else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
results = results.concat((0, exports.getFilterComparisons)(subFilter, key));
}
});
}
return [...results];
};
exports.getFilterComparisons = getFilterComparisons;
/*
getFilterComparisons only returns the first layer, this one will return everything, it only returns the same
item multiple times, that needs to be fixed first
*/
// export const getDeepFilterComparisons = <DTO, K extends keyof FilterComparisons<DTO>>(
// filter: Filter<DTO>,
// key: K
// ): FilterFieldComparison<DTO[K]>[] => {
// let results: FilterFieldComparison<DTO[K]>[] = [];
//
// const comparison = getFilterFieldComparison(filter as FilterComparisons<DTO>, key);
// if (isComparison(comparison)) {
// results.push(comparison);
//
// } else if (Array.isArray(filter)) {
// filter.forEach((f: Filter<DTO>) => {
// results = results.concat(getFilterComparisons(f, key));
// });
// }
//
// if (typeof filter === 'object') {
// Object.keys(filter).forEach((subFilterKey) => {
// const subFilter = filter[subFilterKey] as FilterFieldComparison<DTO[K]>;
//
// if (subFilterKey === key) {
// results.push(subFilter);
// } else {
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-ignore
// results = results.concat(getFilterComparisons(subFilter, key));
// }
// });
// }
//
// return [...results];
// };
const getFilterOmitting = (filter, ...keys) => Object.keys(filter).reduce((f, next) => {

@@ -103,0 +125,0 @@ const omitted = { ...f };

Sorry, the diff of this file is not supported yet

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