sdfsdfs
This commit is contained in:
15
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.d.ts
generated
vendored
Normal file
15
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { ALPHA_MODES } from '../../rendering/renderers/shared/texture/const';
|
||||
/**
|
||||
* Helper for detecting the correct alpha mode for video textures.
|
||||
* For some reason, some browsers/devices/WebGL implementations premultiply the alpha
|
||||
* of a video before and then a second time if `UNPACK_PREMULTIPLY_ALPHA_WEBGL`
|
||||
* is true. So the video is premultiplied twice if the alpha mode is `UNPACK`.
|
||||
* In this case we need the alpha mode to be `PMA`. This function detects
|
||||
* the upload behavior by uploading a white 2x2 webm with 50% alpha
|
||||
* without `UNPACK_PREMULTIPLY_ALPHA_WEBGL` and then checking whether
|
||||
* the uploaded pixels are premultiplied.
|
||||
* @memberof utils
|
||||
* @function detectVideoAlphaMode
|
||||
* @returns {Promise<ALPHA_MODES>} The correct alpha mode for video textures.
|
||||
*/
|
||||
export declare function detectVideoAlphaMode(): Promise<ALPHA_MODES>;
|
50
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.js
generated
vendored
Normal file
50
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
let promise;
|
||||
async function detectVideoAlphaMode() {
|
||||
promise ?? (promise = (async () => {
|
||||
const canvas = document.createElement("canvas");
|
||||
const gl = canvas.getContext("webgl");
|
||||
if (!gl) {
|
||||
return "premultiply-alpha-on-upload";
|
||||
}
|
||||
const video = await new Promise((resolve) => {
|
||||
const video2 = document.createElement("video");
|
||||
video2.onloadeddata = () => resolve(video2);
|
||||
video2.onerror = () => resolve(null);
|
||||
video2.autoplay = false;
|
||||
video2.crossOrigin = "anonymous";
|
||||
video2.preload = "auto";
|
||||
video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=";
|
||||
video2.load();
|
||||
});
|
||||
if (!video) {
|
||||
return "premultiply-alpha-on-upload";
|
||||
}
|
||||
const texture = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, texture);
|
||||
const framebuffer = gl.createFramebuffer();
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
||||
gl.framebufferTexture2D(
|
||||
gl.FRAMEBUFFER,
|
||||
gl.COLOR_ATTACHMENT0,
|
||||
gl.TEXTURE_2D,
|
||||
texture,
|
||||
0
|
||||
);
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
|
||||
const pixel = new Uint8Array(4);
|
||||
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
|
||||
gl.deleteFramebuffer(framebuffer);
|
||||
gl.deleteTexture(texture);
|
||||
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
||||
return pixel[0] <= pixel[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload";
|
||||
})());
|
||||
return promise;
|
||||
}
|
||||
|
||||
exports.detectVideoAlphaMode = detectVideoAlphaMode;
|
||||
//# sourceMappingURL=detectVideoAlphaMode.js.map
|
1
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
48
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs
generated
vendored
Normal file
48
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
let promise;
|
||||
async function detectVideoAlphaMode() {
|
||||
promise ?? (promise = (async () => {
|
||||
const canvas = document.createElement("canvas");
|
||||
const gl = canvas.getContext("webgl");
|
||||
if (!gl) {
|
||||
return "premultiply-alpha-on-upload";
|
||||
}
|
||||
const video = await new Promise((resolve) => {
|
||||
const video2 = document.createElement("video");
|
||||
video2.onloadeddata = () => resolve(video2);
|
||||
video2.onerror = () => resolve(null);
|
||||
video2.autoplay = false;
|
||||
video2.crossOrigin = "anonymous";
|
||||
video2.preload = "auto";
|
||||
video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=";
|
||||
video2.load();
|
||||
});
|
||||
if (!video) {
|
||||
return "premultiply-alpha-on-upload";
|
||||
}
|
||||
const texture = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, texture);
|
||||
const framebuffer = gl.createFramebuffer();
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
||||
gl.framebufferTexture2D(
|
||||
gl.FRAMEBUFFER,
|
||||
gl.COLOR_ATTACHMENT0,
|
||||
gl.TEXTURE_2D,
|
||||
texture,
|
||||
0
|
||||
);
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
|
||||
const pixel = new Uint8Array(4);
|
||||
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
|
||||
gl.deleteFramebuffer(framebuffer);
|
||||
gl.deleteTexture(texture);
|
||||
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
||||
return pixel[0] <= pixel[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload";
|
||||
})());
|
||||
return promise;
|
||||
}
|
||||
|
||||
export { detectVideoAlphaMode };
|
||||
//# sourceMappingURL=detectVideoAlphaMode.mjs.map
|
1
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
84
node_modules/pixi.js/lib/utils/browser/isMobile.d.ts
generated
vendored
Normal file
84
node_modules/pixi.js/lib/utils/browser/isMobile.d.ts
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* The result of the {@link utils.isMobile} function.
|
||||
* @ignore
|
||||
* @memberof utils
|
||||
*/
|
||||
export type isMobileResult = {
|
||||
/**
|
||||
* Whether the device is an Apple device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
apple: {
|
||||
phone: boolean;
|
||||
ipod: boolean;
|
||||
tablet: boolean;
|
||||
universal: boolean;
|
||||
device: boolean;
|
||||
};
|
||||
/**
|
||||
* Whether the device is an Amazon device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
amazon: {
|
||||
phone: boolean;
|
||||
tablet: boolean;
|
||||
device: boolean;
|
||||
};
|
||||
/**
|
||||
* Whether the device is an Android device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
android: {
|
||||
phone: boolean;
|
||||
tablet: boolean;
|
||||
device: boolean;
|
||||
};
|
||||
/**
|
||||
* Whether the device is a Windows device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
windows: {
|
||||
phone: boolean;
|
||||
tablet: boolean;
|
||||
device: boolean;
|
||||
};
|
||||
/**
|
||||
* Whether the device is a specific device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
other: {
|
||||
blackberry: boolean;
|
||||
blackberry10: boolean;
|
||||
opera: boolean;
|
||||
firefox: boolean;
|
||||
chrome: boolean;
|
||||
device: boolean;
|
||||
};
|
||||
/**
|
||||
* Whether the device is a phone device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
phone: boolean;
|
||||
/**
|
||||
* Whether the device is a tablet device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
tablet: boolean;
|
||||
/**
|
||||
* Whether the device is any kind of device.
|
||||
* @memberof utils.isMobile
|
||||
*/
|
||||
any: boolean;
|
||||
};
|
||||
/**
|
||||
* Detects whether the device is mobile and what type of mobile device it is.
|
||||
* ```js
|
||||
* import { isMobile } from 'pixi.js';
|
||||
*
|
||||
* if (isMobile.apple.tablet) {
|
||||
* // The device is an Apple tablet device.
|
||||
* }
|
||||
* ```
|
||||
* @memberof utils
|
||||
*/
|
||||
export declare const isMobile: isMobileResult;
|
10
node_modules/pixi.js/lib/utils/browser/isMobile.js
generated
vendored
Normal file
10
node_modules/pixi.js/lib/utils/browser/isMobile.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var isMobileJs = require('ismobilejs');
|
||||
|
||||
"use strict";
|
||||
const isMobileCall = isMobileJs.default ?? isMobileJs;
|
||||
const isMobile = isMobileCall(globalThis.navigator);
|
||||
|
||||
exports.isMobile = isMobile;
|
||||
//# sourceMappingURL=isMobile.js.map
|
1
node_modules/pixi.js/lib/utils/browser/isMobile.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isMobile.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isMobile.js","sources":["../../../src/utils/browser/isMobile.ts"],"sourcesContent":["import isMobileJs from 'ismobilejs';\n\n// ismobilejs have different import behavior for CJS and ESM, so here is the hack\ntype isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };\nconst isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;\n\n/**\n * The result of the {@link utils.isMobile} function.\n * @ignore\n * @memberof utils\n */\nexport type isMobileResult = {\n /**\n * Whether the device is an Apple device.\n * @memberof utils.isMobile\n */\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Amazon device.\n * @memberof utils.isMobile\n */\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Android device.\n * @memberof utils.isMobile\n */\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a Windows device.\n * @memberof utils.isMobile\n */\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a specific device.\n * @memberof utils.isMobile\n */\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a phone device.\n * @memberof utils.isMobile\n */\n phone: boolean;\n /**\n * Whether the device is a tablet device.\n * @memberof utils.isMobile\n */\n tablet: boolean;\n /**\n * Whether the device is any kind of device.\n * @memberof utils.isMobile\n */\n any: boolean;\n};\n\n/**\n * Detects whether the device is mobile and what type of mobile device it is.\n * ```js\n * import { isMobile } from 'pixi.js';\n *\n * if (isMobile.apple.tablet) {\n * // The device is an Apple tablet device.\n * }\n * ```\n * @memberof utils\n */\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n"],"names":[],"mappings":";;;;;AAIA,MAAM,YAAA,GAAgB,WAA8B,OAAW,IAAA,UAAA,CAAA;AAsFlD,MAAA,QAAA,GAA2B,YAAa,CAAA,UAAA,CAAW,SAAS;;;;"}
|
8
node_modules/pixi.js/lib/utils/browser/isMobile.mjs
generated
vendored
Normal file
8
node_modules/pixi.js/lib/utils/browser/isMobile.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import isMobileJs from 'ismobilejs';
|
||||
|
||||
"use strict";
|
||||
const isMobileCall = isMobileJs.default ?? isMobileJs;
|
||||
const isMobile = isMobileCall(globalThis.navigator);
|
||||
|
||||
export { isMobile };
|
||||
//# sourceMappingURL=isMobile.mjs.map
|
1
node_modules/pixi.js/lib/utils/browser/isMobile.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isMobile.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isMobile.mjs","sources":["../../../src/utils/browser/isMobile.ts"],"sourcesContent":["import isMobileJs from 'ismobilejs';\n\n// ismobilejs have different import behavior for CJS and ESM, so here is the hack\ntype isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };\nconst isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;\n\n/**\n * The result of the {@link utils.isMobile} function.\n * @ignore\n * @memberof utils\n */\nexport type isMobileResult = {\n /**\n * Whether the device is an Apple device.\n * @memberof utils.isMobile\n */\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Amazon device.\n * @memberof utils.isMobile\n */\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Android device.\n * @memberof utils.isMobile\n */\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a Windows device.\n * @memberof utils.isMobile\n */\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a specific device.\n * @memberof utils.isMobile\n */\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a phone device.\n * @memberof utils.isMobile\n */\n phone: boolean;\n /**\n * Whether the device is a tablet device.\n * @memberof utils.isMobile\n */\n tablet: boolean;\n /**\n * Whether the device is any kind of device.\n * @memberof utils.isMobile\n */\n any: boolean;\n};\n\n/**\n * Detects whether the device is mobile and what type of mobile device it is.\n * ```js\n * import { isMobile } from 'pixi.js';\n *\n * if (isMobile.apple.tablet) {\n * // The device is an Apple tablet device.\n * }\n * ```\n * @memberof utils\n */\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n"],"names":[],"mappings":";;;AAIA,MAAM,YAAA,GAAgB,WAA8B,OAAW,IAAA,UAAA,CAAA;AAsFlD,MAAA,QAAA,GAA2B,YAAa,CAAA,UAAA,CAAW,SAAS;;;;"}
|
1
node_modules/pixi.js/lib/utils/browser/isSafari.d.ts
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isSafari.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function isSafari(): boolean;
|
12
node_modules/pixi.js/lib/utils/browser/isSafari.js
generated
vendored
Normal file
12
node_modules/pixi.js/lib/utils/browser/isSafari.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var adapter = require('../../environment/adapter.js');
|
||||
|
||||
"use strict";
|
||||
function isSafari() {
|
||||
const { userAgent } = adapter.DOMAdapter.get().getNavigator();
|
||||
return /^((?!chrome|android).)*safari/i.test(userAgent);
|
||||
}
|
||||
|
||||
exports.isSafari = isSafari;
|
||||
//# sourceMappingURL=isSafari.js.map
|
1
node_modules/pixi.js/lib/utils/browser/isSafari.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isSafari.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isSafari.js","sources":["../../../src/utils/browser/isSafari.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nexport function isSafari(): boolean\n{\n const { userAgent } = DOMAdapter.get().getNavigator();\n\n return (/^((?!chrome|android).)*safari/i).test(userAgent);\n}\n"],"names":["DOMAdapter"],"mappings":";;;;;AAEO,SAAS,QAChB,GAAA;AACI,EAAA,MAAM,EAAE,SAAU,EAAA,GAAIA,kBAAW,CAAA,GAAA,GAAM,YAAa,EAAA,CAAA;AAEpD,EAAQ,OAAA,gCAAA,CAAkC,KAAK,SAAS,CAAA,CAAA;AAC5D;;;;"}
|
10
node_modules/pixi.js/lib/utils/browser/isSafari.mjs
generated
vendored
Normal file
10
node_modules/pixi.js/lib/utils/browser/isSafari.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { DOMAdapter } from '../../environment/adapter.mjs';
|
||||
|
||||
"use strict";
|
||||
function isSafari() {
|
||||
const { userAgent } = DOMAdapter.get().getNavigator();
|
||||
return /^((?!chrome|android).)*safari/i.test(userAgent);
|
||||
}
|
||||
|
||||
export { isSafari };
|
||||
//# sourceMappingURL=isSafari.mjs.map
|
1
node_modules/pixi.js/lib/utils/browser/isSafari.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isSafari.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isSafari.mjs","sources":["../../../src/utils/browser/isSafari.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nexport function isSafari(): boolean\n{\n const { userAgent } = DOMAdapter.get().getNavigator();\n\n return (/^((?!chrome|android).)*safari/i).test(userAgent);\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,QAChB,GAAA;AACI,EAAA,MAAM,EAAE,SAAU,EAAA,GAAI,UAAW,CAAA,GAAA,GAAM,YAAa,EAAA,CAAA;AAEpD,EAAQ,OAAA,gCAAA,CAAkC,KAAK,SAAS,CAAA,CAAA;AAC5D;;;;"}
|
8
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.d.ts
generated
vendored
Normal file
8
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Helper for checking for WebGL support.
|
||||
* @param failIfMajorPerformanceCaveat - whether to fail if there is a major performance caveat, defaults to false
|
||||
* @memberof utils
|
||||
* @function isWebGLSupported
|
||||
* @returns {boolean} Is WebGL supported.
|
||||
*/
|
||||
export declare function isWebGLSupported(failIfMajorPerformanceCaveat?: boolean): boolean;
|
39
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.js
generated
vendored
Normal file
39
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
var adapter = require('../../environment/adapter.js');
|
||||
var AbstractRenderer = require('../../rendering/renderers/shared/system/AbstractRenderer.js');
|
||||
|
||||
"use strict";
|
||||
let _isWebGLSupported;
|
||||
function isWebGLSupported(failIfMajorPerformanceCaveat) {
|
||||
if (_isWebGLSupported !== void 0)
|
||||
return _isWebGLSupported;
|
||||
_isWebGLSupported = (() => {
|
||||
const contextOptions = {
|
||||
stencil: true,
|
||||
failIfMajorPerformanceCaveat: failIfMajorPerformanceCaveat ?? AbstractRenderer.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
||||
};
|
||||
try {
|
||||
if (!adapter.DOMAdapter.get().getWebGLRenderingContext()) {
|
||||
return false;
|
||||
}
|
||||
const canvas = adapter.DOMAdapter.get().createCanvas();
|
||||
let gl = canvas.getContext("webgl", contextOptions);
|
||||
const success = !!gl?.getContextAttributes()?.stencil;
|
||||
if (gl) {
|
||||
const loseContext = gl.getExtension("WEBGL_lose_context");
|
||||
if (loseContext) {
|
||||
loseContext.loseContext();
|
||||
}
|
||||
}
|
||||
gl = null;
|
||||
return success;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
return _isWebGLSupported;
|
||||
}
|
||||
|
||||
exports.isWebGLSupported = isWebGLSupported;
|
||||
//# sourceMappingURL=isWebGLSupported.js.map
|
1
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isWebGLSupported.js","sources":["../../../src/utils/browser/isWebGLSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\nimport { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer';\n\nlet _isWebGLSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @param failIfMajorPerformanceCaveat - whether to fail if there is a major performance caveat, defaults to false\n * @memberof utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(\n failIfMajorPerformanceCaveat?: boolean\n): boolean\n{\n if (_isWebGLSupported !== undefined) return _isWebGLSupported;\n\n _isWebGLSupported = ((): boolean =>\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat:\n failIfMajorPerformanceCaveat\n ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat,\n };\n\n try\n {\n if (!DOMAdapter.get().getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = DOMAdapter.get().createCanvas();\n let gl = canvas.getContext('webgl', contextOptions);\n\n const success = !!gl?.getContextAttributes()?.stencil;\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGLSupported;\n}\n"],"names":["AbstractRenderer","DOMAdapter"],"mappings":";;;;;;AAGA,IAAI,iBAAA,CAAA;AASG,SAAS,iBACZ,4BAEJ,EAAA;AACI,EAAA,IAAI,iBAAsB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,iBAAA,CAAA;AAE5C,EAAA,iBAAA,GAAA,CAAqB,MACrB;AACI,IAAA,MAAM,cAAiB,GAAA;AAAA,MACnB,OAAS,EAAA,IAAA;AAAA,MACT,4BAAA,EACI,4BACG,IAAAA,iCAAA,CAAiB,cAAe,CAAA,4BAAA;AAAA,KAC3C,CAAA;AAEA,IACA,IAAA;AACI,MAAA,IAAI,CAACC,kBAAA,CAAW,GAAI,EAAA,CAAE,0BACtB,EAAA;AACI,QAAO,OAAA,KAAA,CAAA;AAAA,OACX;AAEA,MAAA,MAAM,MAAS,GAAAA,kBAAA,CAAW,GAAI,EAAA,CAAE,YAAa,EAAA,CAAA;AAC7C,MAAA,IAAI,EAAK,GAAA,MAAA,CAAO,UAAW,CAAA,OAAA,EAAS,cAAc,CAAA,CAAA;AAElD,MAAA,MAAM,OAAU,GAAA,CAAC,CAAC,EAAA,EAAI,sBAAwB,EAAA,OAAA,CAAA;AAE9C,MAAA,IAAI,EACJ,EAAA;AACI,QAAM,MAAA,WAAA,GAAc,EAAG,CAAA,YAAA,CAAa,oBAAoB,CAAA,CAAA;AAExD,QAAA,IAAI,WACJ,EAAA;AACI,UAAA,WAAA,CAAY,WAAY,EAAA,CAAA;AAAA,SAC5B;AAAA,OACJ;AAEA,MAAK,EAAA,GAAA,IAAA,CAAA;AAEL,MAAO,OAAA,OAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,iBAAA,CAAA;AACX;;;;"}
|
37
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.mjs
generated
vendored
Normal file
37
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.mjs
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { DOMAdapter } from '../../environment/adapter.mjs';
|
||||
import { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer.mjs';
|
||||
|
||||
"use strict";
|
||||
let _isWebGLSupported;
|
||||
function isWebGLSupported(failIfMajorPerformanceCaveat) {
|
||||
if (_isWebGLSupported !== void 0)
|
||||
return _isWebGLSupported;
|
||||
_isWebGLSupported = (() => {
|
||||
const contextOptions = {
|
||||
stencil: true,
|
||||
failIfMajorPerformanceCaveat: failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
||||
};
|
||||
try {
|
||||
if (!DOMAdapter.get().getWebGLRenderingContext()) {
|
||||
return false;
|
||||
}
|
||||
const canvas = DOMAdapter.get().createCanvas();
|
||||
let gl = canvas.getContext("webgl", contextOptions);
|
||||
const success = !!gl?.getContextAttributes()?.stencil;
|
||||
if (gl) {
|
||||
const loseContext = gl.getExtension("WEBGL_lose_context");
|
||||
if (loseContext) {
|
||||
loseContext.loseContext();
|
||||
}
|
||||
}
|
||||
gl = null;
|
||||
return success;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
return _isWebGLSupported;
|
||||
}
|
||||
|
||||
export { isWebGLSupported };
|
||||
//# sourceMappingURL=isWebGLSupported.mjs.map
|
1
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isWebGLSupported.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isWebGLSupported.mjs","sources":["../../../src/utils/browser/isWebGLSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\nimport { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer';\n\nlet _isWebGLSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @param failIfMajorPerformanceCaveat - whether to fail if there is a major performance caveat, defaults to false\n * @memberof utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(\n failIfMajorPerformanceCaveat?: boolean\n): boolean\n{\n if (_isWebGLSupported !== undefined) return _isWebGLSupported;\n\n _isWebGLSupported = ((): boolean =>\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat:\n failIfMajorPerformanceCaveat\n ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat,\n };\n\n try\n {\n if (!DOMAdapter.get().getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = DOMAdapter.get().createCanvas();\n let gl = canvas.getContext('webgl', contextOptions);\n\n const success = !!gl?.getContextAttributes()?.stencil;\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGLSupported;\n}\n"],"names":[],"mappings":";;;;AAGA,IAAI,iBAAA,CAAA;AASG,SAAS,iBACZ,4BAEJ,EAAA;AACI,EAAA,IAAI,iBAAsB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,iBAAA,CAAA;AAE5C,EAAA,iBAAA,GAAA,CAAqB,MACrB;AACI,IAAA,MAAM,cAAiB,GAAA;AAAA,MACnB,OAAS,EAAA,IAAA;AAAA,MACT,4BAAA,EACI,4BACG,IAAA,gBAAA,CAAiB,cAAe,CAAA,4BAAA;AAAA,KAC3C,CAAA;AAEA,IACA,IAAA;AACI,MAAA,IAAI,CAAC,UAAA,CAAW,GAAI,EAAA,CAAE,0BACtB,EAAA;AACI,QAAO,OAAA,KAAA,CAAA;AAAA,OACX;AAEA,MAAA,MAAM,MAAS,GAAA,UAAA,CAAW,GAAI,EAAA,CAAE,YAAa,EAAA,CAAA;AAC7C,MAAA,IAAI,EAAK,GAAA,MAAA,CAAO,UAAW,CAAA,OAAA,EAAS,cAAc,CAAA,CAAA;AAElD,MAAA,MAAM,OAAU,GAAA,CAAC,CAAC,EAAA,EAAI,sBAAwB,EAAA,OAAA,CAAA;AAE9C,MAAA,IAAI,EACJ,EAAA;AACI,QAAM,MAAA,WAAA,GAAc,EAAG,CAAA,YAAA,CAAa,oBAAoB,CAAA,CAAA;AAExD,QAAA,IAAI,WACJ,EAAA;AACI,UAAA,WAAA,CAAY,WAAY,EAAA,CAAA;AAAA,SAC5B;AAAA,OACJ;AAEA,MAAK,EAAA,GAAA,IAAA,CAAA;AAEL,MAAO,OAAA,OAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,iBAAA,CAAA;AACX;;;;"}
|
9
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.d.ts
generated
vendored
Normal file
9
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="@webgpu/types" />
|
||||
/**
|
||||
* Helper for checking for WebGPU support.
|
||||
* @param options - The options for requesting a GPU adapter.
|
||||
* @memberof utils
|
||||
* @function isWebGPUSupported
|
||||
* @returns Is WebGPU supported.
|
||||
*/
|
||||
export declare function isWebGPUSupported(options?: GPURequestAdapterOptions): Promise<boolean>;
|
27
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.js
generated
vendored
Normal file
27
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
var adapter = require('../../environment/adapter.js');
|
||||
|
||||
"use strict";
|
||||
let _isWebGPUSupported;
|
||||
async function isWebGPUSupported(options = {}) {
|
||||
if (_isWebGPUSupported !== void 0)
|
||||
return _isWebGPUSupported;
|
||||
_isWebGPUSupported = await (async () => {
|
||||
const gpu = adapter.DOMAdapter.get().getNavigator().gpu;
|
||||
if (!gpu) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
const adapter = await gpu.requestAdapter(options);
|
||||
await adapter.requestDevice();
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
return _isWebGPUSupported;
|
||||
}
|
||||
|
||||
exports.isWebGPUSupported = isWebGPUSupported;
|
||||
//# sourceMappingURL=isWebGPUSupported.js.map
|
1
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isWebGPUSupported.js","sources":["../../../src/utils/browser/isWebGPUSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nlet _isWebGPUSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGPU support.\n * @param options - The options for requesting a GPU adapter.\n * @memberof utils\n * @function isWebGPUSupported\n * @returns Is WebGPU supported.\n */\nexport async function isWebGPUSupported(options: GPURequestAdapterOptions = {}): Promise<boolean>\n{\n if (_isWebGPUSupported !== undefined) return _isWebGPUSupported;\n\n _isWebGPUSupported = await (async (): Promise<boolean> =>\n {\n const gpu = DOMAdapter.get().getNavigator().gpu;\n\n if (!gpu)\n {\n return false;\n }\n\n try\n {\n const adapter = await gpu.requestAdapter(options) as GPUAdapter;\n\n // TODO and one of these!\n await adapter.requestDevice();\n\n return true;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGPUSupported;\n}\n"],"names":["DOMAdapter"],"mappings":";;;;;AAEA,IAAI,kBAAA,CAAA;AASkB,eAAA,iBAAA,CAAkB,OAAoC,GAAA,EAC5E,EAAA;AACI,EAAA,IAAI,kBAAuB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,kBAAA,CAAA;AAE7C,EAAA,kBAAA,GAAqB,OAAO,YAC5B;AACI,IAAA,MAAM,GAAM,GAAAA,kBAAA,CAAW,GAAI,EAAA,CAAE,cAAe,CAAA,GAAA,CAAA;AAE5C,IAAA,IAAI,CAAC,GACL,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAEA,IACA,IAAA;AACI,MAAA,MAAM,OAAU,GAAA,MAAM,GAAI,CAAA,cAAA,CAAe,OAAO,CAAA,CAAA;AAGhD,MAAA,MAAM,QAAQ,aAAc,EAAA,CAAA;AAE5B,MAAO,OAAA,IAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,kBAAA,CAAA;AACX;;;;"}
|
25
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.mjs
generated
vendored
Normal file
25
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.mjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { DOMAdapter } from '../../environment/adapter.mjs';
|
||||
|
||||
"use strict";
|
||||
let _isWebGPUSupported;
|
||||
async function isWebGPUSupported(options = {}) {
|
||||
if (_isWebGPUSupported !== void 0)
|
||||
return _isWebGPUSupported;
|
||||
_isWebGPUSupported = await (async () => {
|
||||
const gpu = DOMAdapter.get().getNavigator().gpu;
|
||||
if (!gpu) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
const adapter = await gpu.requestAdapter(options);
|
||||
await adapter.requestDevice();
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
return _isWebGPUSupported;
|
||||
}
|
||||
|
||||
export { isWebGPUSupported };
|
||||
//# sourceMappingURL=isWebGPUSupported.mjs.map
|
1
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isWebGPUSupported.mjs","sources":["../../../src/utils/browser/isWebGPUSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nlet _isWebGPUSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGPU support.\n * @param options - The options for requesting a GPU adapter.\n * @memberof utils\n * @function isWebGPUSupported\n * @returns Is WebGPU supported.\n */\nexport async function isWebGPUSupported(options: GPURequestAdapterOptions = {}): Promise<boolean>\n{\n if (_isWebGPUSupported !== undefined) return _isWebGPUSupported;\n\n _isWebGPUSupported = await (async (): Promise<boolean> =>\n {\n const gpu = DOMAdapter.get().getNavigator().gpu;\n\n if (!gpu)\n {\n return false;\n }\n\n try\n {\n const adapter = await gpu.requestAdapter(options) as GPUAdapter;\n\n // TODO and one of these!\n await adapter.requestDevice();\n\n return true;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGPUSupported;\n}\n"],"names":[],"mappings":";;;AAEA,IAAI,kBAAA,CAAA;AASkB,eAAA,iBAAA,CAAkB,OAAoC,GAAA,EAC5E,EAAA;AACI,EAAA,IAAI,kBAAuB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,kBAAA,CAAA;AAE7C,EAAA,kBAAA,GAAqB,OAAO,YAC5B;AACI,IAAA,MAAM,GAAM,GAAA,UAAA,CAAW,GAAI,EAAA,CAAE,cAAe,CAAA,GAAA,CAAA;AAE5C,IAAA,IAAI,CAAC,GACL,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAEA,IACA,IAAA;AACI,MAAA,MAAM,OAAU,GAAA,MAAM,GAAI,CAAA,cAAA,CAAe,OAAO,CAAA,CAAA;AAGhD,MAAA,MAAM,QAAQ,aAAc,EAAA,CAAA;AAE5B,MAAO,OAAA,IAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,kBAAA,CAAA;AACX;;;;"}
|
7
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.d.ts
generated
vendored
Normal file
7
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Not all platforms allow to generate function code (e.g., `new Function`).
|
||||
* this provides the platform-level detection.
|
||||
* @private
|
||||
* @returns {boolean} `true` if `new Function` is supported.
|
||||
*/
|
||||
export declare function unsafeEvalSupported(): boolean;
|
19
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.js
generated
vendored
Normal file
19
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
let unsafeEval;
|
||||
function unsafeEvalSupported() {
|
||||
if (typeof unsafeEval === "boolean") {
|
||||
return unsafeEval;
|
||||
}
|
||||
try {
|
||||
const func = new Function("param1", "param2", "param3", "return param1[param2] === param3;");
|
||||
unsafeEval = func({ a: "b" }, "a", "b") === true;
|
||||
} catch (e) {
|
||||
unsafeEval = false;
|
||||
}
|
||||
return unsafeEval;
|
||||
}
|
||||
|
||||
exports.unsafeEvalSupported = unsafeEvalSupported;
|
||||
//# sourceMappingURL=unsafeEvalSupported.js.map
|
1
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"unsafeEvalSupported.js","sources":["../../../src/utils/browser/unsafeEvalSupported.ts"],"sourcesContent":["// Cache the result to prevent running this over and over\nlet unsafeEval: boolean;\n\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nexport function unsafeEvalSupported(): boolean\n{\n if (typeof unsafeEval === 'boolean')\n {\n return unsafeEval;\n }\n\n try\n {\n /* eslint-disable no-new-func */\n const func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e)\n {\n unsafeEval = false;\n }\n\n return unsafeEval;\n}\n"],"names":[],"mappings":";;;AACA,IAAI,UAAA,CAAA;AAQG,SAAS,mBAChB,GAAA;AACI,EAAI,IAAA,OAAO,eAAe,SAC1B,EAAA;AACI,IAAO,OAAA,UAAA,CAAA;AAAA,GACX;AAEA,EACA,IAAA;AAEI,IAAA,MAAM,OAAO,IAAI,QAAA,CAAS,QAAU,EAAA,QAAA,EAAU,UAAU,mCAAmC,CAAA,CAAA;AAG3F,IAAA,UAAA,GAAa,KAAK,EAAE,CAAA,EAAG,KAAO,EAAA,GAAA,EAAK,GAAG,CAAM,KAAA,IAAA,CAAA;AAAA,WAEzC,CACP,EAAA;AACI,IAAa,UAAA,GAAA,KAAA,CAAA;AAAA,GACjB;AAEA,EAAO,OAAA,UAAA,CAAA;AACX;;;;"}
|
17
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.mjs
generated
vendored
Normal file
17
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.mjs
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
let unsafeEval;
|
||||
function unsafeEvalSupported() {
|
||||
if (typeof unsafeEval === "boolean") {
|
||||
return unsafeEval;
|
||||
}
|
||||
try {
|
||||
const func = new Function("param1", "param2", "param3", "return param1[param2] === param3;");
|
||||
unsafeEval = func({ a: "b" }, "a", "b") === true;
|
||||
} catch (e) {
|
||||
unsafeEval = false;
|
||||
}
|
||||
return unsafeEval;
|
||||
}
|
||||
|
||||
export { unsafeEvalSupported };
|
||||
//# sourceMappingURL=unsafeEvalSupported.mjs.map
|
1
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"unsafeEvalSupported.mjs","sources":["../../../src/utils/browser/unsafeEvalSupported.ts"],"sourcesContent":["// Cache the result to prevent running this over and over\nlet unsafeEval: boolean;\n\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nexport function unsafeEvalSupported(): boolean\n{\n if (typeof unsafeEval === 'boolean')\n {\n return unsafeEval;\n }\n\n try\n {\n /* eslint-disable no-new-func */\n const func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e)\n {\n unsafeEval = false;\n }\n\n return unsafeEval;\n}\n"],"names":[],"mappings":";AACA,IAAI,UAAA,CAAA;AAQG,SAAS,mBAChB,GAAA;AACI,EAAI,IAAA,OAAO,eAAe,SAC1B,EAAA;AACI,IAAO,OAAA,UAAA,CAAA;AAAA,GACX;AAEA,EACA,IAAA;AAEI,IAAA,MAAM,OAAO,IAAI,QAAA,CAAS,QAAU,EAAA,QAAA,EAAU,UAAU,mCAAmC,CAAA,CAAA;AAG3F,IAAA,UAAA,GAAa,KAAK,EAAE,CAAA,EAAG,KAAO,EAAA,GAAA,EAAK,GAAG,CAAM,KAAA,IAAA,CAAA;AAAA,WAEzC,CACP,EAAA;AACI,IAAa,UAAA,GAAA,KAAA,CAAA;AAAA,GACjB;AAEA,EAAO,OAAA,UAAA,CAAA;AACX;;;;"}
|
Reference in New Issue
Block a user