@grammyjs/files
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -27,3 +27,3 @@ "use strict"; | ||
const environment = (_b = options === null || options === void 0 ? void 0 : options.environment) !== null && _b !== void 0 ? _b : "prod"; | ||
const buildFileUrl = (_c = options === null || options === void 0 ? void 0 : options.buildFileUrl) !== null && _c !== void 0 ? _c : ((root, token, path) => `${root}/file/bot${token}/${path}`); | ||
const buildFileUrl = (_c = options === null || options === void 0 ? void 0 : options.buildFileUrl) !== null && _c !== void 0 ? _c : defaultBuildFileUrl; | ||
const buildLink = (path) => buildFileUrl(root, token, path, environment); | ||
@@ -40,4 +40,8 @@ const t = async (prev, method, payload, signal) => { | ||
exports.hydrateFiles = hydrateFiles; | ||
const defaultBuildFileUrl = (root, token, method, env) => { | ||
const prefix = env === "test" ? "test/" : ""; | ||
return `${root}/file/bot${token}/${prefix}${method}`; | ||
}; | ||
function isFile(val) { | ||
return typeof val === "object" && val !== null && "file_id" in val; | ||
} |
{ | ||
"name": "@grammyjs/files", | ||
"description": "Files plugin for grammY", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "KnorpelSenf", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14642
266