@wp-playground/common
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -1,2 +0,2 @@ | ||
function l(e){return`json_decode(base64_decode('${d(JSON.stringify(e))}'), true)`}function $(e){const t={};for(const r in e)t[r]=l(e[r]);return t}function d(e){return p(new TextEncoder().encode(e))}function p(e){const t=String.fromCodePoint(...e);return btoa(t)}function h(e=fetch){const t={};return async function(i,n){t[i]||(t[i]=e(i,n).then(o=>({body:o.body,responseInit:{status:o.status,statusText:o.statusText,headers:o.headers}})));const{body:a,responseInit:s}=await t[i],[f,u]=a.tee();return t[i]={body:f,responseInit:s},new Response(u,s)}}const w="8.0",c="/tmp/file.zip",x=async(e,t,r,i=!0)=>{if(t instanceof File){const a=t;t=c,await e.writeFile(t,new Uint8Array(await a.arrayBuffer()))}const n=$({zipPath:t,extractToPath:r,overwriteFiles:i});await e.run({code:`<?php | ||
function l(e){return`json_decode(base64_decode('${d(JSON.stringify(e))}'), true)`}function $(e){const t={};for(const r in e)t[r]=l(e[r]);return t}function d(e){return p(new TextEncoder().encode(e))}function p(e){const t=String.fromCodePoint(...e);return btoa(t)}function h(e=fetch){const t={};return async function(i,n){t[i]||(t[i]=e(i,n).then(o=>({body:o.body,responseInit:{status:o.status,statusText:o.statusText,headers:o.headers}})));const{body:a,responseInit:s}=await t[i],[f,u]=a.tee();return t[i]={body:f,responseInit:s},new Response(u,s)}}const w="8.0",c="/tmp/file.zip",z=async(e,t,r,i=!0)=>{if(t instanceof File){const a=t;t=c,await e.writeFile(t,new Uint8Array(await a.arrayBuffer()))}const n=$({zipPath:t,extractToPath:r,overwriteFiles:i});await e.run({code:`<?php | ||
function unzip($zipPath, $extractTo, $overwriteFiles = true) | ||
@@ -23,7 +23,7 @@ { | ||
} else { | ||
throw new Exception("Could not unzip file"); | ||
throw new Exception("Could not unzip file: " . $zip->getStatusString()); | ||
} | ||
} | ||
unzip(${n.zipPath}, ${n.extractToPath}, ${n.overwriteFiles}); | ||
`}),await e.fileExists(c)&&await e.unlink(c)},z=async(e,t)=>{const r=`/tmp/file${Math.random()}.zip`,i=$({directoryPath:t,outputPath:r});await e.run({code:`<?php | ||
`}),await e.fileExists(c)&&await e.unlink(c)},x=async(e,t)=>{const r=`/tmp/file${Math.random()}.zip`,i=$({directoryPath:t,outputPath:r});await e.run({code:`<?php | ||
function zipDirectory($directoryPath, $outputPath) { | ||
@@ -49,2 +49,2 @@ $zip = new ZipArchive; | ||
zipDirectory(${i.directoryPath}, ${i.outputPath}); | ||
`});const n=await e.readFileAsBuffer(r);return e.unlink(r),n};export{w as RecommendedPHPVersion,h as createMemoizedFetch,x as unzipFile,z as zipDirectory}; | ||
`});const n=await e.readFileAsBuffer(r);return e.unlink(r),n};export{w as RecommendedPHPVersion,h as createMemoizedFetch,z as unzipFile,x as zipDirectory}; |
{ | ||
"name": "@wp-playground/common", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "Common exports and utilities for WordPress Playground", | ||
@@ -30,9 +30,9 @@ "repository": { | ||
}, | ||
"gitHead": "916516040522ab257109dd617bfcc493bb4f2eb1", | ||
"gitHead": "bb91e62fb28611a9d447a182aff26dcfced2bb2e", | ||
"dependencies": { | ||
"comlink": "^4.4.1", | ||
"ini": "4.1.2", | ||
"@php-wasm/universal": "1.0.15", | ||
"@php-wasm/util": "1.0.15" | ||
"@php-wasm/universal": "1.0.16", | ||
"@php-wasm/util": "1.0.16" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5724
+ Added@php-wasm/logger@1.0.16(transitive)
+ Added@php-wasm/node-polyfills@1.0.16(transitive)
+ Added@php-wasm/progress@1.0.16(transitive)
+ Added@php-wasm/stream-compression@1.0.16(transitive)
+ Added@php-wasm/universal@1.0.16(transitive)
+ Added@php-wasm/util@1.0.16(transitive)
- Removed@php-wasm/logger@1.0.15(transitive)
- Removed@php-wasm/node-polyfills@1.0.15(transitive)
- Removed@php-wasm/progress@1.0.15(transitive)
- Removed@php-wasm/stream-compression@1.0.15(transitive)
- Removed@php-wasm/universal@1.0.15(transitive)
- Removed@php-wasm/util@1.0.15(transitive)
Updated@php-wasm/universal@1.0.16
Updated@php-wasm/util@1.0.16