Skip to content

Commit

Permalink
fix: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcherist committed Jul 18, 2018
1 parent 42952f5 commit b5cbc97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
13 changes: 6 additions & 7 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export default class Commands implements ICommands {
[TYPE_STRING, TYPE_ARRAY].includes(command.type),
)
}

getStringCommands() {
return this.commands.filter((command) =>
[TYPE_STRING, TYPE_ARRAY].includes(command.type),
)
}
get _figures() {
return this.commands.filter((command) => command.type === TYPE_FIGURE)
}
Expand All @@ -63,13 +69,6 @@ export default class Commands implements ICommands {
}
}

public getByName(name) {
if (!name) { throw new Error('Name is not specified') }
return this._strings.find((command) => {
return typeof command.name === 'string' && command.name.toLowerCase() === name.toLowerCase()
})
}

get length() {
return this.commands.length
}
Expand Down
5 changes: 0 additions & 5 deletions src/tests/commands.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,4 @@ test('adding a command', () => {

commands.add('Привет, алиса!', cb)
expect(commands.length).toBe(1)
expect(commands.getByName('Привет, алиса!')).toEqual({
name: 'Привет, алиса!',
callback: cb,
type: 'string',
})
})

0 comments on commit b5cbc97

Please sign in to comment.