Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wp-playground/common

Package Overview
Dependencies
Maintainers
0
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wp-playground/common - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

8

index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc