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

@spinajs/configuration

Package Overview
Dependencies
Maintainers
1
Versions
285
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/configuration - npm Package Compare versions

Comparing version 1.2.16 to 1.2.17

28

lib/configuration.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -20,15 +8,5 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -44,4 +22,4 @@ exports.FrameworkConfiguration = void 0;

const util_1 = require("./util");
const _ = __importStar(require("lodash"));
const ajv_1 = __importDefault(require("ajv"));
const _ = require("lodash");
const ajv_1 = require("ajv");
const exception_1 = require("./exception");

@@ -153,3 +131,3 @@ const internal_logger_1 = require("@spinajs/internal-logger");

validator.addKeyword('$configurationModule');
const schemas = this.Container.get('__configurationSchema__', true);
const schemas = this.Container.get(Array.ofType('__configurationSchema__'), true);
if (schemas) {

@@ -156,0 +134,0 @@ Object.keys(this.Config).forEach((k) => {

@@ -9,14 +9,2 @@ "use strict";

}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {

@@ -35,3 +23,3 @@ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);

*/
exports.configuration = __importStar(require("./config/configuration"));
exports.configuration = require("./config/configuration");
__exportStar(require("./types"), exports);

@@ -38,0 +26,0 @@ __exportStar(require("./sources"), exports);

43

lib/sources.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -20,9 +8,2 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -38,7 +19,7 @@ exports.JsonFileSource = exports.JsFileSource = exports.BaseFileSource = exports.ConfigurationSource = void 0;

const glob_1 = require("glob");
const _ = __importStar(require("lodash"));
const _ = require("lodash");
const path_1 = require("path");
const util_1 = require("./util");
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const fs = require("fs");
const path = require("path");
const internal_logger_1 = require("@spinajs/internal-logger");

@@ -106,8 +87,11 @@ function mergeArrays(target, source) {

async Load() {
var _a;
const common = this.load('!(*.dev|*.prod).js', _load);
if (process.env.NODE_ENV) {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const dEnv = (_a = di_1.DI.get('process.env')) !== null && _a !== void 0 ? _a : process.env;
if (dEnv.NODE_ENV) {
if (dEnv.NODE_ENV === 'development') {
return _.mergeWith(common, this.load('*.dev.js', _load), mergeArrays);
}
else if (process.env.NODE_ENV === 'production') {
else {
return _.mergeWith(common, this.load('*.prod.js', _load), mergeArrays);

@@ -132,8 +116,11 @@ }

async Load() {
var _a;
const common = this.load('!(*.dev|*.prod).json', _load);
if (process.env.NODE_ENV) {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const dEnv = (_a = di_1.DI.get('process.env')) !== null && _a !== void 0 ? _a : process.env;
if (dEnv.NODE_ENV) {
if (dEnv.NODE_ENV === 'development') {
return _.mergeWith(common, this.load('*.dev.json', _load), mergeArrays);
}
else if (process.env.NODE_ENV === 'production') {
else {
return _.mergeWith(common, this.load('*.prod.json', _load), mergeArrays);

@@ -140,0 +127,0 @@ }

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,3 +6,3 @@ exports.filterDirs = exports.uncache = exports.merge = exports.findBasePath = exports.parseArgv = void 0;

/* eslint-disable @typescript-eslint/unbound-method */
const fs = __importStar(require("fs"));
const fs = require("fs");
const _ = require("lodash");

@@ -28,0 +9,0 @@ const path_1 = require("path");

{
"name": "@spinajs/configuration",
"version": "1.2.16",
"version": "1.2.17",
"description": "framework configuration module",

@@ -8,10 +8,11 @@ "main": "lib/index.js",

"scripts": {
"build": "npm run clean && npm run compile",
"compile": "tsc -p tsconfig.build.json",
"clean": "",
"test": "ts-mocha -p tsconfig.json test/**/*.test.ts",
"coverage": "nyc npm run test",
"build-docs": "rimraf docs && typedoc --options typedoc.json src/",
"build": "tsc",
"build-watch": "tsc -w",
"prepare": "npm run build",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "eslint -c .eslintrc.js --ext .ts src",
"lint": "eslint -c .eslintrc.js --ext .ts src --fix",
"prepublishOnly": "npm test && npm run lint",

@@ -53,3 +54,3 @@ "preversion": "npm run lint",

},
"gitHead": "19b67098c01b6608d2d6e18d9b5800c4d272f2b6"
"gitHead": "b50242d79027fe681bce1fb065716dda2894b03d"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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