Skip to content

Use lodash utils instead of including them in the package #47

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
"combokeys": "^3.0.0",
"events": "^1.0.2",
"invariant": "^2.1.0",
"just-reduce-object": "^1.0.3",
"lodash.compact": "^3.0.1",
"lodash.findkey": "^4.6.0",
"lodash.flatten": "^4.4.0",
"lodash.isarray": "^4.0.0",
"lodash.isplainobject": "^4.0.6",
"lodash.map": "^4.6.0",
"lodash.reduce": "^4.6.0",
"platform": "^1.3.0",
"prop-types": "^15.5.8"
},
Expand Down
14 changes: 10 additions & 4 deletions src/shortcut-manager.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import reduce from 'just-reduce-object'
import reduce from 'lodash.reduce'
import invariant from 'invariant'
import isPlainObject from 'lodash.isplainobject'
import findKey from 'lodash.findkey'
import isArray from 'lodash.isarray'
import map from 'lodash.map'
import compact from 'lodash.compact'
import flatten from 'lodash.flatten'

import { EventEmitter } from 'events'
import helpers from './helpers'
import { isPlainObject, findKey, isArray, map, compact, flatten } from './utils'

import helpers from './helpers'

const warning = (text) => {
if (process && process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -58,7 +64,7 @@ class ShortcutManager extends EventEmitter {

getAllShortcutsForPlatform(platformName) {
const _transformShortcuts = (shortcuts) => {
return reduce(shortcuts, (result, keyName, keyValue) => {
return reduce(shortcuts, (result, keyValue, keyName) => {
if (isPlainObject(keyValue)) {
if (keyValue[platformName]) {
keyValue = keyValue[platformName]
Expand Down
49 changes: 0 additions & 49 deletions src/utils.js

This file was deleted.

132 changes: 0 additions & 132 deletions test/utils.js

This file was deleted.