UNPKG

@hokuto/jam-node

Version:

JAM Node TS, guardians and utils

23 lines (22 loc) 930 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAtlasImageParams = exports.getMapImageParams = exports.getImageParams = void 0; const jam_core_1 = require("@hokuto/jam-core"); const types_js_1 = require("../types.js"); function getImageParams(args, body) { const headers = { ...jam_core_1.CoreApi.Options.getRequestOptions(args), "Content-Type": "application/json", }; const method = body ? types_js_1.ApiMethod.Post : types_js_1.ApiMethod.Get; return { headers, method, params: body }; } exports.getImageParams = getImageParams; function getMapImageParams(urlFn, args, body) { return { url: urlFn(args), ...getImageParams(args, body) }; } exports.getMapImageParams = getMapImageParams; function getAtlasImageParams(urlFn, args, body) { return { url: urlFn(args), ...getImageParams(args, body) }; } exports.getAtlasImageParams = getAtlasImageParams;