2017-01-09 15:46:27 +03:00
|
|
|
/**
|
2017-03-09 17:17:03 +03:00
|
|
|
* If running on Nodejs 5.x and below, we load the transpiled code.
|
2017-01-09 15:46:27 +03:00
|
|
|
* Otherwise, we use the ES6 code.
|
2017-03-09 17:17:03 +03:00
|
|
|
* We are deprecating support for Node.js v5.x and below.
|
2017-01-09 15:46:27 +03:00
|
|
|
*/
|
2017-02-08 12:16:51 +03:00
|
|
|
const majorVersion = parseInt(process.versions.node.split('.')[0], 10);
|
2017-03-09 17:17:03 +03:00
|
|
|
if (majorVersion <= 5) {
|
2022-07-18 08:41:31 +02:00
|
|
|
const deprecate = require('./src/utils').deprecate;
|
2017-03-09 17:17:03 +03:00
|
|
|
deprecate('Node.js v5.x and below will no longer be supported in the future');
|
2017-01-09 15:46:27 +03:00
|
|
|
module.exports = require('./lib/telegram');
|
|
|
|
} else {
|
|
|
|
module.exports = require('./src/telegram');
|
|
|
|
}
|