Skip to content

Commit

Permalink
src/telegram: Add shim for Array#findIndex()
Browse files Browse the repository at this point in the history
Bug:

  Array#findIndex() is unavailable in Node.js v0.x.
  Since we are deprecating Node.js v0.x already, we
  can use a shim in the mean time.

  Once we stop supporting that version range, we can
  drop the shim entirely.

tags: deprecate/node-v0.x
  • Loading branch information
passion-27 committed Feb 9, 2017
1 parent 1006aa8 commit 4572b5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"author": "Yago Pérez <[email protected]>",
"license": "MIT",
"engines": {
"node" : ">=0.12"
"node": ">=0.12"
},
"dependencies": {
"array.prototype.findindex": "^2.0.0",
"bl": "^1.1.2",
"bluebird": "^3.3.4",
"debug": "^2.2.0",
Expand Down
3 changes: 3 additions & 0 deletions src/telegram.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// shims
require('array.prototype.findindex').shim(); // for Node.js v0.x

const TelegramBotWebHook = require('./telegramWebHook');
const TelegramBotPolling = require('./telegramPolling');
const debug = require('debug')('node-telegram-bot-api');
Expand Down

0 comments on commit 4572b5d

Please sign in to comment.