@php-wasm/web-5-2 3.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs ADDED
@@ -0,0 +1,47 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // packages/php-wasm/web-builds/5-2/src/index.ts
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ getIntlExtensionPath: () => getIntlExtensionPath,
33
+ getPHPLoaderModule: () => getPHPLoaderModule,
34
+ jspi: () => import_wasm_feature_detect.jspi
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+ var import_wasm_feature_detect = require("wasm-feature-detect");
38
+ async function getPHPLoaderModule() {
39
+ if (await (0, import_wasm_feature_detect.jspi)()) {
40
+ return await import("./jspi/php_5_2.js");
41
+ } else {
42
+ return await import("./asyncify/php_5_2.js");
43
+ }
44
+ }
45
+ async function getIntlExtensionPath() {
46
+ throw new Error("The intl extension is not available for PHP 5.2.");
47
+ }
package/index.js ADDED
@@ -0,0 +1,17 @@
1
+ // packages/php-wasm/web-builds/5-2/src/index.ts
2
+ import { jspi } from "wasm-feature-detect";
3
+ async function getPHPLoaderModule() {
4
+ if (await jspi()) {
5
+ return await import("./jspi/php_5_2.js");
6
+ } else {
7
+ return await import("./asyncify/php_5_2.js");
8
+ }
9
+ }
10
+ async function getIntlExtensionPath() {
11
+ throw new Error("The intl extension is not available for PHP 5.2.");
12
+ }
13
+ export {
14
+ getIntlExtensionPath,
15
+ getPHPLoaderModule,
16
+ jspi
17
+ };
Binary file