UNPKG

telebot

Version:

The easy way to write Telegram bots.

25 lines (24 loc) 594 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const url_1 = require("url"); function convertToArray(data) { return (Array.isArray(data)) ? data : [data]; } exports.convertToArray = convertToArray; function parseUrl(url) { return url_1.parse(url); } exports.parseUrl = parseUrl; // eslint-disable-next-line @typescript-eslint/no-explicit-any function toString(data) { if (typeof data === "string") { return data; } try { return JSON.stringify(data); } catch (e) { return ""; } } exports.toString = toString;