Skip to content

Commit

Permalink
feat: remove redundant ramda
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcherist committed Jul 30, 2018
1 parent 508c57c commit cb2bb9d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"fuse.js": "^3.2.0",
"loglevel": "^1.6.1",
"loglevel-plugin-prefix": "^0.8.4",
"node-fetch": "^2.1.2",
"ramda": "^0.25.0"
"node-fetch": "^2.1.2"
},
"devDependencies": {
"@types/node-fetch": "^2.1.2",
Expand Down
7 changes: 4 additions & 3 deletions src/context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { compose } from 'ramda'
import { reversedInterpolation, selectCommand } from './utils'
import { reversedInterpolation, selectCommand, compose } from './utils'
import Session from './session'
import Scene from './scene'

Expand Down Expand Up @@ -91,7 +90,9 @@ export default class Context implements IContext {
}

public enterScene(scene: Scene): void {
if (!scene) throw new Error('Please provide scene you want to enter in')
if (!scene) {
throw new Error('Please provide scene you want to enter in')
}
const matchedScene = this.scenes.find(candidateScene => candidateScene.name === scene.name)
this.session.setData('currentScene', matchedScene.name)
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export const isFunction = (fn: (args: any) => any) => fn && typeof fn === 'funct
export const delay = (ms: number): Promise<void> => new Promise(resolve => setTimeout(resolve, ms))
export const rejectsIn = (ms: number) => new Promise((resolve, reject) => setTimeout(reject, ms))

export const compose = (...fns) =>
fns.reduceRight((prevFn, nextFn) => (...args) => nextFn(prevFn(...args)), value => value)

export default {
getFiguresRegexp,
selectCommand,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"paths": {
"*": ["node_modules/*"]
},
"types": ["node", "jest", "express"],
"types": ["node", "jest"],
"typeRoots": [
"node_modules/@types"
]
Expand Down

0 comments on commit cb2bb9d

Please sign in to comment.