Skip to content

Commit

Permalink
remove the dependency on lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
floydpink committed Feb 13, 2020
1 parent d1e8af5 commit d7f1fa8
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 79 deletions.
148 changes: 76 additions & 72 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,138 +1,142 @@
{
"extends" : "eslint:recommended",
"env" : {
"node" : true,
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"node": true,
"mocha": true,
"es6" : true
"es6": true
},
"rules" : {
"array-bracket-spacing" : [
"rules": {
"array-bracket-spacing": [
2,
"never"
],
"brace-style" : [
"brace-style": [
2,
"1tbs"
],
"comma-style" : 2,
"consistent-return" : 0,
"indent" : [
"comma-style": 2,
"consistent-return": 0,
"indent": [
2,
2
],
"no-multiple-empty-lines" : [
"no-multiple-empty-lines": [
2,
{
"max": 2
}
],
"no-use-before-define" : [
"no-use-before-define": [
2,
"nofunc"
],
"one-var" : [
"one-var": [
2,
"never"
],
"quote-props" : [
"quote-props": [
2,
"as-needed"
],
"quotes" : [
"quotes": [
2,
"single"
],
"keyword-spacing" : 2,
"keyword-spacing": 2,
"space-before-function-paren": [
2,
{
"anonymous": "always",
"named" : "never"
"named": "never"
}
],
"strict" : [
"strict": [
2,
"global"
],
"curly" : [
"curly": [
2,
"all"
],
"eol-last" : 2,
"key-spacing" : [
"eol-last": 2,
"key-spacing": [
2,
{
"align" : "colon",
"align": "colon",
"beforeColon": true,
"afterColon" : true
"afterColon": true
}
],
"no-eval" : 2,
"no-with" : 2,
"space-infix-ops" : 2,
"dot-notation" : [
"no-eval": 2,
"no-with": 2,
"space-infix-ops": 2,
"dot-notation": [
2,
{
"allowKeywords": true
}
],
"eqeqeq" : [
"eqeqeq": [
2,
"allow-null"
],
"guard-for-in" : 2,
"no-alert" : 2,
"no-bitwise" : 2,
"no-caller" : 2,
"no-extend-native" : 2,
"no-extra-bind" : 2,
"no-extra-parens" : 2,
"no-implied-eval" : 2,
"no-iterator" : 2,
"no-label-var" : 2,
"no-labels" : 2,
"no-lone-blocks" : 2,
"no-loop-func" : 2,
"no-multi-spaces" : 2,
"no-multi-str" : 2,
"no-native-reassign" : 2,
"no-new" : 2,
"no-new-func" : 2,
"no-new-wrappers" : 2,
"no-octal-escape" : 2,
"no-proto" : 2,
"no-return-assign" : 2,
"no-script-url" : 2,
"no-sequences" : 2,
"no-unused-expressions" : 2,
"yoda" : 2,
"no-shadow" : 2,
"no-shadow-restricted-names" : 2,
"no-undef-init" : 2,
"camelcase" : 2,
"comma-spacing" : 2,
"new-cap" : 2,
"new-parens" : 2,
"no-array-constructor" : 2,
"no-new-object" : 2,
"no-spaced-func" : 2,
"no-trailing-spaces" : 2,
"no-underscore-dangle" : 2,
"semi" : 2,
"semi-spacing" : [
"guard-for-in": 2,
"no-alert": 2,
"no-bitwise": 2,
"no-caller": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-parens": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-sequences": 2,
"no-unused-expressions": 2,
"yoda": 2,
"no-shadow": 2,
"no-shadow-restricted-names": 2,
"no-undef-init": 2,
"camelcase": 2,
"comma-spacing": 2,
"new-cap": 2,
"new-parens": 2,
"no-array-constructor": 2,
"no-new-object": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-underscore-dangle": 2,
"semi": 2,
"semi-spacing": [
2,
{
"before": false,
"after" : true
"after": true
}
],
"wrap-iife" : [
"wrap-iife": [
2,
"inside"
]
},
"parserOptions": {
"sourceType" : "module",
"ecmaVersion": 6
"sourceType": "module",
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
6 changes: 6 additions & 0 deletions .idea/jsLinters/eslint.xml

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

5 changes: 2 additions & 3 deletions lib/celestial/planetarySystem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* @module planetarySystem
*/
import _ from 'lodash';

import planets from './planets/index.js';
import Yuga from './yuga.js';

Expand Down Expand Up @@ -60,7 +58,8 @@ class PlanetarySystem {

PlanetarySystem.initializePlanetaryConstants();

planetsList = _.keyBy([star, sun, moon, mercury, venus, mars, jupiter, saturn, candrocca, rahu], 'name');
planetsList = [star, sun, moon, mercury, venus, mars, jupiter, saturn, candrocca, rahu]
.reduce((list, planet) => ({...list, [planet.name] : planet}), {});

}

Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

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

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,5 @@
"test": "nyc --require @babel/register _mocha --recursive test"
},
"license": "MIT",
"dependencies": {
"lodash": "^4.17.15"
}
"dependencies": {}
}

0 comments on commit d7f1fa8

Please sign in to comment.