PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@expo/cli/build/src/start/server/middleware
Просмотр файла: resolvePlatform.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parsePlatformHeader = parsePlatformHeader;
exports.assertMissingRuntimePlatform = assertMissingRuntimePlatform;
exports.assertRuntimePlatform = assertRuntimePlatform;
var _url = require("url");
var _errors = require("../../../utils/errors");
function parsePlatformHeader(req) {
var ref;
const url = (0, _url).parse(req.url, /* parseQueryString */ true);
const platform = ((ref = url.query) == null ? void 0 : ref.platform) || req.headers["expo-platform"] || req.headers["exponent-platform"];
var ref1;
return (ref1 = Array.isArray(platform) ? platform[0] : platform) != null ? ref1 : null;
}
function assertMissingRuntimePlatform(platform) {
if (!platform) {
throw new _errors.CommandError("PLATFORM_HEADER", `Must specify "expo-platform" header or "platform" query parameter`);
}
}
function assertRuntimePlatform(platform) {
const stringifiedPlatform = String(platform);
if (![
"android",
"ios"
].includes(stringifiedPlatform)) {
throw new _errors.CommandError("PLATFORM_HEADER", `platform must be "android" or "ios". Received: "${platform}"`);
}
}
//# sourceMappingURL=resolvePlatform.js.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!