This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
"use strict";
function checkDataUrl(url, mimes) {
if (Array.isArray(mimes)) {
for (const mime of mimes)
if (url.startsWith(`data:${mime}`))
return !0;
return !1;
}
return url.startsWith(`data:${mimes}`);
}
exports.checkDataUrl = checkDataUrl;
//# sourceMappingURL=checkDataUrl.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"checkDataUrl.js","sources":["../../src/utils/checkDataUrl.ts"],"sourcesContent":["export function checkDataUrl(url: string, mimes: string | string[]): boolean\n{\n if (Array.isArray(mimes))\n {\n for (const mime of mimes)\n {\n if (url.startsWith(`data:${mime}`)) return true;\n }\n\n return false;\n }\n\n return url.startsWith(`data:${mimes}`);\n}\n"],"names":[],"mappings":";AAAgB,SAAA,aAAa,KAAa,OAC1C;AACQ,MAAA,MAAM,QAAQ,KAAK,GACvB;AACI,eAAW,QAAQ;AAEf,UAAI,IAAI,WAAW,QAAQ,IAAI,EAAE;AAAU,eAAA;AAGxC,WAAA;AAAA,EACX;AAEA,SAAO,IAAI,WAAW,QAAQ,KAAK,EAAE;AACzC;;"}

View File

@@ -0,0 +1,13 @@
function checkDataUrl(url, mimes) {
if (Array.isArray(mimes)) {
for (const mime of mimes)
if (url.startsWith(`data:${mime}`))
return !0;
return !1;
}
return url.startsWith(`data:${mimes}`);
}
export {
checkDataUrl
};
//# sourceMappingURL=checkDataUrl.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"checkDataUrl.mjs","sources":["../../src/utils/checkDataUrl.ts"],"sourcesContent":["export function checkDataUrl(url: string, mimes: string | string[]): boolean\n{\n if (Array.isArray(mimes))\n {\n for (const mime of mimes)\n {\n if (url.startsWith(`data:${mime}`)) return true;\n }\n\n return false;\n }\n\n return url.startsWith(`data:${mimes}`);\n}\n"],"names":[],"mappings":"AAAgB,SAAA,aAAa,KAAa,OAC1C;AACQ,MAAA,MAAM,QAAQ,KAAK,GACvB;AACI,eAAW,QAAQ;AAEf,UAAI,IAAI,WAAW,QAAQ,IAAI,EAAE;AAAU,eAAA;AAGxC,WAAA;AAAA,EACX;AAEA,SAAO,IAAI,WAAW,QAAQ,KAAK,EAAE;AACzC;"}

View File

@@ -0,0 +1,8 @@
"use strict";
var core = require("@pixi/core");
function checkExtension(url, extension) {
const tempURL = url.split("?")[0], ext = core.utils.path.extname(tempURL).toLowerCase();
return Array.isArray(extension) ? extension.includes(ext) : ext === extension;
}
exports.checkExtension = checkExtension;
//# sourceMappingURL=checkExtension.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"checkExtension.js","sources":["../../src/utils/checkExtension.ts"],"sourcesContent":["import { utils } from '@pixi/core';\n\nexport function checkExtension(url: string, extension: string | string[]): boolean\n{\n const tempURL = url.split('?')[0];\n const ext = utils.path.extname(tempURL).toLowerCase();\n\n if (Array.isArray(extension))\n {\n return extension.includes(ext);\n }\n\n return ext === extension;\n}\n"],"names":["utils"],"mappings":";;AAEgB,SAAA,eAAe,KAAa,WAC5C;AACI,QAAM,UAAU,IAAI,MAAM,GAAG,EAAE,CAAC,GAC1B,MAAMA,KAAAA,MAAM,KAAK,QAAQ,OAAO,EAAE,YAAY;AAEhD,SAAA,MAAM,QAAQ,SAAS,IAEhB,UAAU,SAAS,GAAG,IAG1B,QAAQ;AACnB;;"}

View File

@@ -0,0 +1,9 @@
import { utils } from "@pixi/core";
function checkExtension(url, extension) {
const tempURL = url.split("?")[0], ext = utils.path.extname(tempURL).toLowerCase();
return Array.isArray(extension) ? extension.includes(ext) : ext === extension;
}
export {
checkExtension
};
//# sourceMappingURL=checkExtension.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"checkExtension.mjs","sources":["../../src/utils/checkExtension.ts"],"sourcesContent":["import { utils } from '@pixi/core';\n\nexport function checkExtension(url: string, extension: string | string[]): boolean\n{\n const tempURL = url.split('?')[0];\n const ext = utils.path.extname(tempURL).toLowerCase();\n\n if (Array.isArray(extension))\n {\n return extension.includes(ext);\n }\n\n return ext === extension;\n}\n"],"names":[],"mappings":";AAEgB,SAAA,eAAe,KAAa,WAC5C;AACI,QAAM,UAAU,IAAI,MAAM,GAAG,EAAE,CAAC,GAC1B,MAAM,MAAM,KAAK,QAAQ,OAAO,EAAE,YAAY;AAEhD,SAAA,MAAM,QAAQ,SAAS,IAEhB,UAAU,SAAS,GAAG,IAG1B,QAAQ;AACnB;"}

View File

@@ -0,0 +1,4 @@
"use strict";
const convertToList = (input, transform, forceTransform = !1) => (Array.isArray(input) || (input = [input]), transform ? input.map((item) => typeof item == "string" || forceTransform ? transform(item) : item) : input);
exports.convertToList = convertToList;
//# sourceMappingURL=convertToList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"convertToList.js","sources":["../../src/utils/convertToList.ts"],"sourcesContent":["export const convertToList = <T>(\n input: string | T | (string | T)[],\n transform?: (input: string) => T,\n forceTransform = false\n): T[] =>\n{\n if (!Array.isArray(input))\n {\n input = [input as T];\n }\n\n if (!transform)\n {\n return input as T[];\n }\n\n return (input as (string | T)[]).map((item): T =>\n {\n if (typeof item === 'string' || forceTransform)\n {\n return transform(item as string);\n }\n\n return item as T;\n });\n};\n"],"names":[],"mappings":";AAAa,MAAA,gBAAgB,CACzB,OACA,WACA,iBAAiB,QAGZ,MAAM,QAAQ,KAAK,MAEpB,QAAQ,CAAC,KAAU,IAGlB,YAKG,MAAyB,IAAI,CAAC,SAE9B,OAAO,QAAS,YAAY,iBAErB,UAAU,IAAc,IAG5B,IACV,IAXU;;"}

View File

@@ -0,0 +1,5 @@
const convertToList = (input, transform, forceTransform = !1) => (Array.isArray(input) || (input = [input]), transform ? input.map((item) => typeof item == "string" || forceTransform ? transform(item) : item) : input);
export {
convertToList
};
//# sourceMappingURL=convertToList.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"convertToList.mjs","sources":["../../src/utils/convertToList.ts"],"sourcesContent":["export const convertToList = <T>(\n input: string | T | (string | T)[],\n transform?: (input: string) => T,\n forceTransform = false\n): T[] =>\n{\n if (!Array.isArray(input))\n {\n input = [input as T];\n }\n\n if (!transform)\n {\n return input as T[];\n }\n\n return (input as (string | T)[]).map((item): T =>\n {\n if (typeof item === 'string' || forceTransform)\n {\n return transform(item as string);\n }\n\n return item as T;\n });\n};\n"],"names":[],"mappings":"AAAa,MAAA,gBAAgB,CACzB,OACA,WACA,iBAAiB,QAGZ,MAAM,QAAQ,KAAK,MAEpB,QAAQ,CAAC,KAAU,IAGlB,YAKG,MAAyB,IAAI,CAAC,SAE9B,OAAO,QAAS,YAAY,iBAErB,UAAU,IAAc,IAG5B,IACV,IAXU;"}

View File

@@ -0,0 +1,7 @@
"use strict";
const copySearchParams = (targetUrl, sourceUrl) => {
const searchParams = sourceUrl.split("?")[1];
return searchParams && (targetUrl += `?${searchParams}`), targetUrl;
};
exports.copySearchParams = copySearchParams;
//# sourceMappingURL=copySearchParams.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"copySearchParams.js","sources":["../../src/utils/copySearchParams.ts"],"sourcesContent":["/**\n * Copies the search params from one url to another\n * @param targetUrl - the url to copy the search params to\n * @param sourceUrl - the url container the search params we want to copy\n * @returns the url with the search params copied\n */\nexport const copySearchParams = (targetUrl: string, sourceUrl: string) =>\n{\n const searchParams = sourceUrl.split('?')[1];\n\n if (searchParams)\n {\n targetUrl += `?${searchParams}`;\n }\n\n return targetUrl;\n};\n"],"names":[],"mappings":";AAMa,MAAA,mBAAmB,CAAC,WAAmB,cACpD;AACI,QAAM,eAAe,UAAU,MAAM,GAAG,EAAE,CAAC;AAE3C,SAAI,iBAEA,aAAa,IAAI,YAAY,KAG1B;AACX;;"}

View File

@@ -0,0 +1,8 @@
const copySearchParams = (targetUrl, sourceUrl) => {
const searchParams = sourceUrl.split("?")[1];
return searchParams && (targetUrl += `?${searchParams}`), targetUrl;
};
export {
copySearchParams
};
//# sourceMappingURL=copySearchParams.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"copySearchParams.mjs","sources":["../../src/utils/copySearchParams.ts"],"sourcesContent":["/**\n * Copies the search params from one url to another\n * @param targetUrl - the url to copy the search params to\n * @param sourceUrl - the url container the search params we want to copy\n * @returns the url with the search params copied\n */\nexport const copySearchParams = (targetUrl: string, sourceUrl: string) =>\n{\n const searchParams = sourceUrl.split('?')[1];\n\n if (searchParams)\n {\n targetUrl += `?${searchParams}`;\n }\n\n return targetUrl;\n};\n"],"names":[],"mappings":"AAMa,MAAA,mBAAmB,CAAC,WAAmB,cACpD;AACI,QAAM,eAAe,UAAU,MAAM,GAAG,EAAE,CAAC;AAE3C,SAAI,iBAEA,aAAa,IAAI,YAAY,KAG1B;AACX;"}

View File

@@ -0,0 +1,22 @@
"use strict";
function processX(base, ids, depth, result, tags) {
const id = ids[depth];
for (let i = 0; i < id.length; i++) {
const value = id[i];
depth < ids.length - 1 ? processX(base.replace(result[depth], value), ids, depth + 1, result, tags) : tags.push(base.replace(result[depth], value));
}
}
function createStringVariations(string) {
const regex = /\{(.*?)\}/g, result = string.match(regex), tags = [];
if (result) {
const ids = [];
result.forEach((vars) => {
const split = vars.substring(1, vars.length - 1).split(",");
ids.push(split);
}), processX(string, ids, 0, result, tags);
} else
tags.push(string);
return tags;
}
exports.createStringVariations = createStringVariations;
//# sourceMappingURL=createStringVariations.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createStringVariations.js","sources":["../../src/utils/createStringVariations.ts"],"sourcesContent":["function processX(base: string, ids: string[][], depth: number, result: string[], tags: string[])\n{\n const id = ids[depth];\n\n for (let i = 0; i < id.length; i++)\n {\n const value = id[i];\n\n if (depth < ids.length - 1)\n {\n processX(base.replace(result[depth], value), ids, depth + 1, result, tags);\n }\n else\n {\n tags.push(base.replace(result[depth], value));\n }\n }\n}\n\n/**\n * Creates a list of all possible combinations of the given strings.\n * @example\n * const out2 = createStringVariations('name is {chicken,wolf,sheep}');\n * console.log(out2); // [ 'name is chicken', 'name is wolf', 'name is sheep' ]\n * @param string - The string to process\n */\nexport function createStringVariations(string: string): string[]\n{\n const regex = /\\{(.*?)\\}/g;\n\n const result = string.match(regex);\n\n const tags: string[] = [];\n\n if (result)\n {\n const ids: string[][] = [];\n\n result.forEach((vars) =>\n {\n // first remove the brackets...\n const split = vars.substring(1, vars.length - 1).split(',');\n\n ids.push(split);\n });\n\n processX(string, ids, 0, result, tags);\n }\n else\n {\n tags.push(string);\n }\n\n return tags;\n}\n"],"names":[],"mappings":";AAAA,SAAS,SAAS,MAAc,KAAiB,OAAe,QAAkB,MAClF;AACU,QAAA,KAAK,IAAI,KAAK;AAEpB,WAAS,IAAI,GAAG,IAAI,GAAG,QAAQ,KAC/B;AACU,UAAA,QAAQ,GAAG,CAAC;AAEd,YAAQ,IAAI,SAAS,IAErB,SAAS,KAAK,QAAQ,OAAO,KAAK,GAAG,KAAK,GAAG,KAAK,QAAQ,GAAG,QAAQ,IAAI,IAIzE,KAAK,KAAK,KAAK,QAAQ,OAAO,KAAK,GAAG,KAAK,CAAC;AAAA,EAEpD;AACJ;AASO,SAAS,uBAAuB,QACvC;AACU,QAAA,QAAQ,cAER,SAAS,OAAO,MAAM,KAAK,GAE3B,OAAiB;AAEvB,MAAI,QACJ;AACI,UAAM,MAAkB,CAAA;AAEjB,WAAA,QAAQ,CAAC,SAChB;AAEU,YAAA,QAAQ,KAAK,UAAU,GAAG,KAAK,SAAS,CAAC,EAAE,MAAM,GAAG;AAE1D,UAAI,KAAK,KAAK;AAAA,IAAA,CACjB,GAED,SAAS,QAAQ,KAAK,GAAG,QAAQ,IAAI;AAAA,EACzC;AAGI,SAAK,KAAK,MAAM;AAGb,SAAA;AACX;;"}

View File

@@ -0,0 +1,23 @@
function processX(base, ids, depth, result, tags) {
const id = ids[depth];
for (let i = 0; i < id.length; i++) {
const value = id[i];
depth < ids.length - 1 ? processX(base.replace(result[depth], value), ids, depth + 1, result, tags) : tags.push(base.replace(result[depth], value));
}
}
function createStringVariations(string) {
const regex = /\{(.*?)\}/g, result = string.match(regex), tags = [];
if (result) {
const ids = [];
result.forEach((vars) => {
const split = vars.substring(1, vars.length - 1).split(",");
ids.push(split);
}), processX(string, ids, 0, result, tags);
} else
tags.push(string);
return tags;
}
export {
createStringVariations
};
//# sourceMappingURL=createStringVariations.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createStringVariations.mjs","sources":["../../src/utils/createStringVariations.ts"],"sourcesContent":["function processX(base: string, ids: string[][], depth: number, result: string[], tags: string[])\n{\n const id = ids[depth];\n\n for (let i = 0; i < id.length; i++)\n {\n const value = id[i];\n\n if (depth < ids.length - 1)\n {\n processX(base.replace(result[depth], value), ids, depth + 1, result, tags);\n }\n else\n {\n tags.push(base.replace(result[depth], value));\n }\n }\n}\n\n/**\n * Creates a list of all possible combinations of the given strings.\n * @example\n * const out2 = createStringVariations('name is {chicken,wolf,sheep}');\n * console.log(out2); // [ 'name is chicken', 'name is wolf', 'name is sheep' ]\n * @param string - The string to process\n */\nexport function createStringVariations(string: string): string[]\n{\n const regex = /\\{(.*?)\\}/g;\n\n const result = string.match(regex);\n\n const tags: string[] = [];\n\n if (result)\n {\n const ids: string[][] = [];\n\n result.forEach((vars) =>\n {\n // first remove the brackets...\n const split = vars.substring(1, vars.length - 1).split(',');\n\n ids.push(split);\n });\n\n processX(string, ids, 0, result, tags);\n }\n else\n {\n tags.push(string);\n }\n\n return tags;\n}\n"],"names":[],"mappings":"AAAA,SAAS,SAAS,MAAc,KAAiB,OAAe,QAAkB,MAClF;AACU,QAAA,KAAK,IAAI,KAAK;AAEpB,WAAS,IAAI,GAAG,IAAI,GAAG,QAAQ,KAC/B;AACU,UAAA,QAAQ,GAAG,CAAC;AAEd,YAAQ,IAAI,SAAS,IAErB,SAAS,KAAK,QAAQ,OAAO,KAAK,GAAG,KAAK,GAAG,KAAK,QAAQ,GAAG,QAAQ,IAAI,IAIzE,KAAK,KAAK,KAAK,QAAQ,OAAO,KAAK,GAAG,KAAK,CAAC;AAAA,EAEpD;AACJ;AASO,SAAS,uBAAuB,QACvC;AACU,QAAA,QAAQ,cAER,SAAS,OAAO,MAAM,KAAK,GAE3B,OAAiB;AAEvB,MAAI,QACJ;AACI,UAAM,MAAkB,CAAA;AAEjB,WAAA,QAAQ,CAAC,SAChB;AAEU,YAAA,QAAQ,KAAK,UAAU,GAAG,KAAK,SAAS,CAAC,EAAE,MAAM,GAAG;AAE1D,UAAI,KAAK,KAAK;AAAA,IAAA,CACjB,GAED,SAAS,QAAQ,KAAK,GAAG,QAAQ,IAAI;AAAA,EACzC;AAGI,SAAK,KAAK,MAAM;AAGb,SAAA;AACX;"}

View File

@@ -0,0 +1,9 @@
"use strict";
var checkDataUrl = require("./checkDataUrl.js"), checkExtension = require("./checkExtension.js"), convertToList = require("./convertToList.js"), copySearchParams = require("./copySearchParams.js"), createStringVariations = require("./createStringVariations.js"), isSingleItem = require("./isSingleItem.js");
exports.checkDataUrl = checkDataUrl.checkDataUrl;
exports.checkExtension = checkExtension.checkExtension;
exports.convertToList = convertToList.convertToList;
exports.copySearchParams = copySearchParams.copySearchParams;
exports.createStringVariations = createStringVariations.createStringVariations;
exports.isSingleItem = isSingleItem.isSingleItem;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}

View File

@@ -0,0 +1,15 @@
import { checkDataUrl } from "./checkDataUrl.mjs";
import { checkExtension } from "./checkExtension.mjs";
import { convertToList } from "./convertToList.mjs";
import { copySearchParams } from "./copySearchParams.mjs";
import { createStringVariations } from "./createStringVariations.mjs";
import { isSingleItem } from "./isSingleItem.mjs";
export {
checkDataUrl,
checkExtension,
convertToList,
copySearchParams,
createStringVariations,
isSingleItem
};
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}

View File

@@ -0,0 +1,4 @@
"use strict";
const isSingleItem = (item) => !Array.isArray(item);
exports.isSingleItem = isSingleItem;
//# sourceMappingURL=isSingleItem.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isSingleItem.js","sources":["../../src/utils/isSingleItem.ts"],"sourcesContent":["/**\n * Checks if the given value is an array.\n * @param item - The item to test\n */\nexport const isSingleItem = (item: unknown): boolean => (!Array.isArray(item));\n"],"names":[],"mappings":";AAIO,MAAM,eAAe,CAAC,SAA4B,CAAC,MAAM,QAAQ,IAAI;;"}

View File

@@ -0,0 +1,5 @@
const isSingleItem = (item) => !Array.isArray(item);
export {
isSingleItem
};
//# sourceMappingURL=isSingleItem.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isSingleItem.mjs","sources":["../../src/utils/isSingleItem.ts"],"sourcesContent":["/**\n * Checks if the given value is an array.\n * @param item - The item to test\n */\nexport const isSingleItem = (item: unknown): boolean => (!Array.isArray(item));\n"],"names":[],"mappings":"AAIO,MAAM,eAAe,CAAC,SAA4B,CAAC,MAAM,QAAQ,IAAI;"}