UNPKG

@ayonli/jsext

Version:

A JavaScript extension package for building strong and modern applications.

44 lines (39 loc) 2.01 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var fastly_env = require('fastly:env'); var runtime = require('../runtime.js'); // @ts-ignore function env(name = undefined, value = undefined) { var _a, _b, _c, _d, _e, _f, _g, _h; if (typeof name === "object") { throw new Error("Not implemented"); } else if (value !== undefined) { throw new Error("Cannot modify environment variables in the worker"); } else if (name === undefined) { return { "FASTLY_CACHE_GENERATION": (_a = fastly_env.env("FASTLY_CACHE_GENERATION")) !== null && _a !== void 0 ? _a : "", "FASTLY_CUSTOMER_ID": (_b = fastly_env.env("FASTLY_CUSTOMER_ID")) !== null && _b !== void 0 ? _b : "", "FASTLY_HOSTNAME": (_c = fastly_env.env("FASTLY_HOSTNAME")) !== null && _c !== void 0 ? _c : "", "FASTLY_POP": (_d = fastly_env.env("FASTLY_POP")) !== null && _d !== void 0 ? _d : "", "FASTLY_REGION": (_e = fastly_env.env("FASTLY_REGION")) !== null && _e !== void 0 ? _e : "", "FASTLY_SERVICE_ID": (_f = fastly_env.env("FASTLY_SERVICE_ID")) !== null && _f !== void 0 ? _f : "", "FASTLY_SERVICE_VERSION": (_g = fastly_env.env("FASTLY_SERVICE_VERSION")) !== null && _g !== void 0 ? _g : "", "FASTLY_TRACE_ID": (_h = fastly_env.env("FASTLY_TRACE_ID")) !== null && _h !== void 0 ? _h : "", }; } return fastly_env.env(name); } exports.WellknownPlatforms = runtime.WellknownPlatforms; exports.WellknownRuntimes = runtime.WellknownRuntimes; exports.addShutdownListener = runtime.addShutdownListener; exports.addUnhandledRejectionListener = runtime.addUnhandledRejectionListener; exports.customInspect = runtime.customInspect; exports.default = runtime.default; exports.isREPL = runtime.isREPL; exports.platform = runtime.platform; exports.refTimer = runtime.refTimer; exports.unrefTimer = runtime.unrefTimer; exports.env = env; //# sourceMappingURL=runtime.js.map