feat: Added dedicated Stash producer

This commit is contained in:
Peng-YM
2022-06-20 21:51:13 +08:00
parent bea2c64e40
commit d602dbeb7c
8 changed files with 39 additions and 14 deletions

View File

@@ -2,7 +2,10 @@
const isQX = typeof $task !== 'undefined';
const isLoon = typeof $loon !== 'undefined';
const isSurge = typeof $httpClient !== 'undefined' && !isLoon;
const isNode = eval(`typeof process !== "undefined"`);
const isNode = eval(`typeof process !== "undefined"`); // eval is needed in order to avoid browserify processing
const isStash =
'undefined' !== typeof $environment && $environment['stash-version'];
const isShadowRocket = 'undefined' !== typeof $rocket;
export class OpenAPI {
constructor(name = 'untitled', debug = false) {
@@ -218,7 +221,7 @@ export class OpenAPI {
}
export function ENV() {
return { isQX, isLoon, isSurge, isNode };
return { isQX, isLoon, isSurge, isNode, isStash, isShadowRocket };
}
export function HTTP(defaultOptions = { baseURL: '' }) {