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

aul

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aul - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/fixtures/test2.js

2

package.json
{
"name": "aul",
"version": "1.0.1",
"version": "1.0.2",
"description": "Elegant database queries executor",

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

@@ -22,3 +22,3 @@ "use strict";

this._source = source;
this._filters = {};
this._filters = Object.create(null);
this._mappers = [];

@@ -30,4 +30,13 @@ }

* @param {{}} opts
* @param {boolean} append
*/
addFilter(name, opts) {
addFilter(name, opts, append = false) {
if (name in this._filters && append) {
this._filters[name] = [].concat.call(
[],
this._filters[name],
[opts]
);
return;
}
this._filters[name] = opts;

@@ -34,0 +43,0 @@ }

@@ -61,3 +61,3 @@ "use strict";

resolveFilters(filtersMap) {
return Object.keys(filtersMap)
const results = Object.keys(filtersMap)
.map(name => {

@@ -67,5 +67,9 @@ if (typeof name === "function") {

}
let filterPath = this.resolveFilterPath(name);
return require(filterPath)(filtersMap[name]);
const filterPath = this.resolveFilterPath(name);
const filterModule = require(filterPath);
const filterOpts = filtersMap[name];
return Array.isArray(filterOpts) ? filterOpts.map(opts => filterModule(opts)) : filterModule(filtersMap[name]);
});
return [].concat.apply([], results);
}

@@ -72,0 +76,0 @@

@@ -67,3 +67,3 @@ "use strict";

t.throws(function () {
ex.resolveFilterPath("test2");
ex.resolveFilterPath("unknownFilter");
});

@@ -85,2 +85,18 @@ });

test("resolveFilters return array of function even if filters were appended", t => {
t.plan(2);
const path = require("path");
const ex = new Executor({path: path.join(process.cwd(), "test/fixtures")});
const res = ex.resolveFilters({
test: {},
test2: [
{opt1: 1},
{opt1: 2}
]
});
t.true(Array.isArray(res));
t.is(res.length, 3);
});
test("mapValues", t => {

@@ -87,0 +103,0 @@ const path = require("path");

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