Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
679 B
Plaintext
1 line
679 B
Plaintext
{"version":3,"file":"with-token.js","names":[],"sources":["../../../src/rest/helpers/with-token.ts"],"sourcesContent":["import type { RestCommand } from '../types.js';\n\nexport function withToken<Schema, Output>(\n\ttoken: string,\n\tgetOptions: RestCommand<Output, Schema>,\n): RestCommand<Output, Schema> {\n\treturn () => {\n\t\tconst options = getOptions();\n\n\t\tif (token) {\n\t\t\tif (!options.headers) options.headers = {};\n\t\t\toptions.headers['Authorization'] = `Bearer ${token}`;\n\t\t}\n\n\t\treturn options;\n\t};\n}\n"],"mappings":"AAEA,SAAgB,EACf,EACA,EAC8B,CAC9B,UAAa,CACZ,IAAM,EAAU,GAAY,CAO5B,OALI,IACH,AAAsB,EAAQ,UAAU,EAAE,CAC1C,EAAQ,QAAQ,cAAmB,UAAU,KAGvC"} |