Socket
Socket
Sign inDemoInstall

@contrast/rewriter

Package Overview
Dependencies
Maintainers
9
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrast/rewriter - npm Package Compare versions

Comparing version 1.7.1 to 1.7.2

20

lib/index.js

@@ -21,11 +21,3 @@ /*

const { Cache } = require('./cache');
const INJECTION_FIXES = [
// assigning to global breaks things like `"string".constructor === global.String`
{ search: 'global.Function = global.ContrastMethods.Function', replace: 'var Function = global.ContrastMethods?.Function' },
{ search: 'global.Number = global.ContrastMethods.Number', replace: 'var Number = global.ContrastMethods?.Number' },
{ search: 'global.Object = global.ContrastMethods.Object', replace: 'var Object = global.ContrastMethods?.Object' },
{ search: 'global.String = global.ContrastMethods.String', replace: 'var String = global.ContrastMethods?.String' },
];
/**

@@ -177,8 +169,2 @@ * @typedef {Object} Core

for (const { search, replace } of INJECTION_FIXES) {
if (result.code.indexOf(search) >= 0) {
result.code = result.code.replace(search, replace);
}
}
return result;

@@ -207,8 +193,2 @@ }

for (const { search, replace } of INJECTION_FIXES) {
if (result.code.indexOf(search) >= 0) {
result.code = result.code.replace(search, replace);
}
}
return result;

@@ -215,0 +195,0 @@ }

6

package.json
{
"name": "@contrast/rewriter",
"version": "1.7.1",
"version": "1.7.2",
"description": "A transpilation tool mainly used for instrumentation",

@@ -17,4 +17,4 @@ "license": "SEE LICENSE IN LICENSE",

"dependencies": {
"@contrast/agent-swc-plugin": "1.3.0",
"@contrast/agent-swc-plugin-unwrite": "1.3.0",
"@contrast/agent-swc-plugin": "1.5.0",
"@contrast/agent-swc-plugin-unwrite": "1.5.0",
"@contrast/common": "1.20.1",

@@ -21,0 +21,0 @@ "@contrast/synchronous-source-maps": "^1.1.3",

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