Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@acot/config

Package Overview
Dependencies
231
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4-canary.0

4

CHANGELOG.md

@@ -6,2 +6,6 @@ # Change Log

## [0.0.4-canary.0](https://github.com/acot-a11y/acot/compare/@acot/config@0.0.3...@acot/config@0.0.4-canary.0) (2020-12-29)
**Note:** Version bump only for package @acot/config
## [0.0.3](https://github.com/acot-a11y/acot/compare/@acot/config@0.0.3-canary.2...@acot/config@0.0.3) (2020-12-22)

@@ -8,0 +12,0 @@

@@ -104,2 +104,3 @@ "use strict";

delete cfg.runner;
delete cfg.reporter;
delete cfg.overrides;

@@ -106,0 +107,0 @@ return config;

30

lib/router.js

@@ -7,7 +7,4 @@ "use strict";

exports.ConfigRouter = void 0;
const glob_to_regexp_1 = __importDefault(require("glob-to-regexp"));
const globOptions = {
globstar: true,
extended: true,
};
const micromatch_1 = __importDefault(require("micromatch"));
const merger_1 = require("./merger");
class ConfigRouter {

@@ -19,18 +16,21 @@ constructor(config) {

var _a;
const test = (pattern, path) => glob_to_regexp_1.default(pattern, globOptions).test(path);
const entry = (_a = this._config.overrides) === null || _a === void 0 ? void 0 : _a.find((config) => {
var _a;
let found = ((_a = config.paths) !== null && _a !== void 0 ? _a : []).includes(path);
const test = (pattern, path) => micromatch_1.default.isMatch(path, pattern);
const entries = (_a = this._config.overrides) === null || _a === void 0 ? void 0 : _a.filter((entry) => {
let found = false;
// include
if (!found && config.include != null) {
found = config.include.some((pattern) => test(pattern, path));
if (entry.include != null) {
found = entry.include.some((pattern) => test(pattern, path));
}
// exclude
if (found && config.exclude != null) {
found = config.exclude.every((pattern) => !test(pattern, path));
if (found && entry.exclude != null) {
found = entry.exclude.every((pattern) => !test(pattern, path));
}
return found;
});
if (entry != null) {
return entry;
if (entries != null && entries.length > 0) {
return entries.reduce((acc, cur) => merger_1.mergeConfig(acc, cur), {
rules: this._config.rules,
presets: this._config.presets,
headers: this._config.headers,
});
}

@@ -37,0 +37,0 @@ return this._config;

@@ -18,8 +18,2 @@ import Ajv = require('ajv');

};
paths: {
items: {
type: string;
};
type: string;
};
presets: {

@@ -39,2 +33,3 @@ items: {

overrides?: undefined;
paths?: undefined;
reporter?: undefined;

@@ -73,8 +68,2 @@ runner?: undefined;

};
paths: {
items: {
type: string;
};
type: string;
};
presets: {

@@ -109,3 +98,2 @@ items: {

headers?: undefined;
paths?: undefined;
presets?: undefined;

@@ -119,2 +107,8 @@ rules?: undefined;

};
paths: {
items: {
type: string;
};
type: string;
};
reporter: {

@@ -180,3 +174,2 @@ anyOf: ({

headers?: undefined;
paths?: undefined;
presets?: undefined;

@@ -183,0 +176,0 @@ rules?: undefined;

@@ -32,8 +32,2 @@ "use strict";

},
paths: {
items: {
type: 'string',
},
type: 'array',
},
presets: {

@@ -79,8 +73,2 @@ items: {

},
paths: {
items: {
type: 'string',
},
type: 'array',
},
presets: {

@@ -119,2 +107,8 @@ items: {

},
paths: {
items: {
type: 'string',
},
type: 'array',
},
reporter: {

@@ -121,0 +115,0 @@ anyOf: [

{
"name": "@acot/config",
"version": "0.0.3",
"version": "0.0.4-canary.0",
"description": "A module to manipulate configs of acot.",
"homepage": "https://github.com/acot-a11y/acot/tree/master/packages/config",
"homepage": "https://github.com/acot-a11y/acot/tree/main/packages/config",
"bugs": {

@@ -32,2 +32,3 @@ "url": "https://github.com/acot-a11y/acot/issues"

"rootDir": "src",
"testEnvironment": "node",
"testMatch": [

@@ -38,8 +39,8 @@ "**/__tests__/**/*.test.ts?(x)"

"dependencies": {
"@acot/core": "0.0.3",
"@acot/module-loader": "0.0.3",
"@acot/reporter": "0.0.3",
"@acot/runner": "0.0.3",
"@acot/types": "0.0.3",
"@acot/utils": "0.0.3",
"@acot/core": "0.0.4-canary.0",
"@acot/module-loader": "0.0.4-canary.0",
"@acot/reporter": "0.0.4-canary.0",
"@acot/runner": "0.0.4-canary.0",
"@acot/types": "0.0.4-canary.0",
"@acot/utils": "0.0.4-canary.0",
"ajv": "^6.12.3",

@@ -49,4 +50,4 @@ "cosmiconfig": "^7.0.0",

"deepmerge": "^4.2.2",
"glob-to-regexp": "^0.4.1",
"is-plain-object": "^5.0.0",
"micromatch": "^4.0.2",
"path-type": "^4.0.0",

@@ -56,3 +57,3 @@ "resolve-from": "^5.0.0"

"devDependencies": {
"@types/glob-to-regexp": "^0.4.0",
"@types/micromatch": "^4.0.1",
"param-case": "^3.0.3",

@@ -64,3 +65,3 @@ "typescript-json-validator": "^2.4.2"

},
"gitHead": "bfc184385ad43fa7ff3fd3e52709fcb25e66587d"
"gitHead": "d04b64541cb3226356998ee7cba234ffc48fa874"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc