Socket
Socket
Sign inDemoInstall

@yao-pkg/pkg

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yao-pkg/pkg - npm Package Compare versions

Comparing version 5.12.1 to 5.13.0

20

lib-es5/producer.js

@@ -19,8 +19,24 @@ "use strict";

const compress_type_1 = require("./compress_type");
function discoverPlaceholder(binaryBuffer, searchString, padder) {
function discoverPlaceholder(binaryBuffer, searchString, padder, searchOffset = 0) {
const placeholder = Buffer.from(searchString);
const position = binaryBuffer.indexOf(placeholder);
const position = binaryBuffer.indexOf(placeholder, searchOffset);
if (position === -1) {
return { notFound: true };
}
/**
* the PAYLOAD/PRELUDE placeholders can occur twice in the binaries:
* - in source text as a string literal
* - in bytecode as a raw string
* the ordering depends on the platform - we need to make sure that
* the bytecode string is replaced, not the source literal.
*
* this rejects the source code literal if it occurs first in the binary
* also see: https://github.com/yao-pkg/pkg/pull/86
*/
if (binaryBuffer[position - 1] === 39 /* ascii for ' APOSTROPHE */) {
const nextPlaceholder = discoverPlaceholder(binaryBuffer, searchString, padder, position + placeholder.length);
if (!('notFound' in nextPlaceholder)) {
return nextPlaceholder;
}
}
return { position, size: placeholder.length, padder };

@@ -27,0 +43,0 @@ }

4

package.json
{
"name": "@yao-pkg/pkg",
"version": "5.12.1",
"version": "5.13.0",
"description": "Package your Node.js project into an executable",

@@ -28,3 +28,3 @@ "main": "lib-es5/index.js",

"@babel/types": "7.23.0",
"@yao-pkg/pkg-fetch": "3.5.9",
"@yao-pkg/pkg-fetch": "3.5.10",
"chalk": "^4.1.2",

@@ -31,0 +31,0 @@ "fs-extra": "^9.1.0",

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