Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

klark-js-plugins

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

klark-js-plugins - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23

0

.vscode/launch.json

@@ -0,0 +0,0 @@ {

{
"vsicons.presets.angular": false
}

2

package.json
{
"name": "klark-js-plugins",
"version": "1.0.22",
"version": "1.0.23",
"description": "Plugin modules for KlarkJS",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,0 +0,0 @@ 'use strict';

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

count: count,
remove: remove
remove: remove,
appliers: {
applyPagination,
applyFilters
}
};

@@ -33,13 +37,3 @@

var q;
if (filters) {
q = _.transform(filters, function(result, value, key) {
if (key === '__custom__' && _.isFunction(value)) {
value(result);
} else if (!(_.isNil(value) || (_.isString(value) && !value))) {
result[key] = valueToFilter(value);
}
}, {});
}
const q = applyFilters(cursor, filters);
var cursor = model.find(q);

@@ -52,10 +46,3 @@

if (pagination) {
if (pagination.page) {
krkLogger.assert(pagination.count > 0);
cursor.skip((pagination.page - 1) * pagination.count)
.limit(pagination.count);
}
if (pagination.sortBy) {
cursor.sort(_.fromPairs([[pagination.sortBy, pagination.asc ? 1 : -1]]));
}
applyPagination(cursor, pagination);
}

@@ -88,2 +75,27 @@

}
function applyPagination(cursor, pagination) {
if (pagination) {
if (pagination.page) {
krkLogger.assert(pagination.count > 0);
cursor.skip((pagination.page - 1) * pagination.count)
.limit(pagination.count);
}
if (pagination.sortBy) {
cursor.sort(_.fromPairs([[pagination.sortBy, pagination.asc ? 1 : -1]]));
}
}
}
function applyFilters(cursor, filters) {
if (filters) {
return _.transform(filters, function(result, value, key) {
if (key === '__custom__' && _.isFunction(value)) {
value(result);
} else if (!(_.isNil(value) || (_.isString(value) && !value))) {
result[key] = valueToFilter(value);
}
}, {});
}
}
});

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ # klark plugins

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