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

read-config-file

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-config-file - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

out/ajvErrorNormalizer.d.ts

2

out/main.d.ts
import { Lazy } from "lazy-val";
import { ErrorObject } from "ajv";
export declare function readConfig<T>(configFile: string, projectDir?: string, log?: (message: string) => void): Promise<T>;

@@ -18,1 +19,2 @@ export declare function findAndReadConfig<T>(request: ReadConfigRequest): Promise<T | null>;

export declare function loadParentConfig<T>(request: ReadConfigRequest, spec: string): Promise<T>;
export declare function validateConfig(config: any, scheme: Lazy<any>, errorMessage: (error: string, errors: Array<ErrorObject>) => string): Promise<void>;

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

});
exports.loadParentConfig = exports.getConfig = exports.loadConfig = exports.findAndReadConfig = exports.readConfig = undefined;
exports.validateConfig = exports.loadParentConfig = exports.getConfig = exports.loadConfig = exports.findAndReadConfig = exports.readConfig = undefined;

@@ -115,2 +115,24 @@ var _bluebirdLst;

})();
let validateConfig = exports.validateConfig = (() => {
var _ref6 = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (config, scheme, errorMessage) {
const ajv = new (_ajv || _load_ajv()).default({
allErrors: true,
coerceTypes: true,
verbose: true,
errorDataPath: "configuration"
});
ajv.addMetaSchema(require("ajv/lib/refs/json-schema-draft-04.json"));
require("ajv-keywords")(ajv, ["typeof"]);
const schema = yield scheme.value;
const validator = ajv.compile(schema);
if (!validator(config)) {
throw new Error(errorMessage((0, (_ajvErrorNormalizer || _load_ajvErrorNormalizer()).normaliseErrorMessages)(validator.errors, schema), validator.errors));
}
});
return function validateConfig(_x11, _x12, _x13) {
return _ref6.apply(this, arguments);
};
})();
//# sourceMappingURL=main.js.map

@@ -142,2 +164,16 @@

var _ajv;
function _load_ajv() {
return _ajv = _interopRequireDefault(require("ajv"));
}
var _ajvErrorNormalizer;
function _load_ajvErrorNormalizer() {
return _ajvErrorNormalizer = require("./ajvErrorNormalizer");
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -144,0 +180,0 @@

10

package.json
{
"name": "read-config-file",
"version": "1.0.5",
"version": "1.1.0",
"main": "out/main.js",

@@ -18,2 +18,4 @@ "author": "Vladimir Krivosheev",

"dependencies": {
"ajv": "^5.2.2",
"ajv-keywords": "^2.1.0",
"bluebird-lst": "^1.0.3",

@@ -26,6 +28,6 @@ "fs-extra-p": "^4.4.0",

"devDependencies": {
"@types/js-yaml": "^3.9.0",
"@types/node": "^8.0.20",
"@types/js-yaml": "^3.9.1",
"@types/node": "^8.0.25",
"babel-preset-ts-node4-bluebird": "^0.1.0",
"ts-babel": "^3.2.1",
"ts-babel": "^4.1.3",
"typescript": "^2.4.2"

@@ -32,0 +34,0 @@ },

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