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

t-configurator

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

t-configurator - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

14

Configurator.js

@@ -12,4 +12,7 @@ var ConfiguratorUtils_1 = require("./ConfiguratorUtils");

// -------------------------------------------------------------------------
Configurator.prototype.setConfiguration = function (configuration) {
this.configuration = configuration;
Configurator.prototype.addConfiguration = function (configuration) {
var _this = this;
Object.keys(configuration).forEach(function (c) {
_this.configuration[c] = configuration[c];
});
};

@@ -19,3 +22,6 @@ Configurator.prototype.get = function (key, searchFlattened) {

var config = searchFlattened ? ConfiguratorUtils_1.ConfiguratorUtils.flatten(this.configuration) : this.configuration;
return Object.keys(config).reduce(function (found, configKey) { return key === configKey ? config[key] : found; }, null);
var value = Object.keys(config).reduce(function (found, configKey) { return key === configKey ? config[key] : found; }, undefined);
if (value && value instanceof Object)
return ConfiguratorUtils_1.ConfiguratorUtils.deepClone(value);
return value;
};

@@ -34,3 +40,3 @@ /**

Object.keys(flattenParams).forEach(function (paramKey) {
var conf = '%%' + paramKey + '%%';
var conf = '%' + paramKey + '%';
if (typeof flattenConfig[key] === 'string' && flattenConfig[key].indexOf(conf) !== -1) {

@@ -37,0 +43,0 @@ flattenConfig[key] = flattenConfig[key].replace(conf, flattenParams[paramKey]);

{
"name": "t-configurator",
"version": "0.0.2",
"version": "0.0.3",
"description": "Allows to manage configuration files in your project",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -12,3 +12,3 @@ declare module 't-configurator/ConfiguratorUtils' {

private configuration;
setConfiguration(configuration: Object): void;
addConfiguration(configuration: any): void;
get(key: string, searchFlattened?: boolean): any;

@@ -15,0 +15,0 @@ /**

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