Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates dependencies and removes unneeded Lodash libs & version bump 2.0.6 #64

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
}
}
99 changes: 0 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spur-config",
"description": "Configuration framework to help manage complex application configurations in Node.js.",
"version": "2.0.5",
"version": "2.0.6",
"main": "./src/SpurConfig",
"author": {
"name": "Agustin Colchado",
@@ -32,15 +32,11 @@
"url": "git://github.com/opentable/spur-config.git"
},
"dependencies": {
"lodash.foreach": "4.5.0",
"lodash.isfunction": "3.0.9",
"lodash.merge": "4.6.2",
"require-all": "3.0.0"
},
"devDependencies": {
"@types/jest": "29.5.12",
"eslint": "8.57.0",
"eslint-plugin-node": "11.1.0",
"jest": "29.7.0"
}
}
11 changes: 6 additions & 5 deletions src/SpurConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const fs = require('fs');
const path = require('path');
const _forEach = require('lodash.foreach');
const _isFunction = require('lodash.isfunction');
const _merge = require('lodash.merge');
const requireAll = require('require-all');

@@ -60,9 +58,12 @@ class SpurConfig {
}
}

loadPluginsByObject(pluginsObject) {
_forEach(pluginsObject, (plugin, pluginName) => {
if (_isFunction(plugin)) {
loadPluginsByObject(pluginsObject = {}) {
const pluginNames = Object.keys(pluginsObject);

pluginNames.forEach((pluginName) => {
const plugin = pluginsObject[pluginName];
if (typeof plugin === 'function') {
this.plugins[pluginName] = plugin.bind(this);
} else {
this.loadPluginsByObject(plugin);
24 changes: 0 additions & 24 deletions test/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../.eslintrc.json",
"env": {
"jest": true
},
"rules": {
"no-unused-vars": 0
}
}