Socket
Socket
Sign inDemoInstall

code-red

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-red - npm Package Compare versions

Comparing version 0.0.27 to 0.0.28

4

CHANGELOG.md
# code-red changelog
## 0.0.28
* Add `toString` and `toUrl` methods on sourcemap objects ([#22](https://github.com/Rich-Harris/code-red/pull/22))
## 0.0.27

@@ -4,0 +8,0 @@

@@ -1325,2 +1325,18 @@ (function (global, factory) {

let btoa = () => {
throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
};
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
btoa = (str) => window.btoa(unescape(encodeURIComponent(str)));
} else if (typeof Buffer === 'function') {
btoa = (str) => Buffer.from(str, 'utf-8').toString('base64');
}
function print(node, opts = {}) {

@@ -1393,11 +1409,28 @@ if (Array.isArray(node)) {

const map = {
version: 3,
names: [] ,
sources: [opts.sourceMapSource || null],
sourcesContent: [opts.sourceMapContent || null],
mappings: sourcemapCodec.encode(mappings)
};
Object.defineProperties(map, {
toString: {
enumerable: false,
value: function toString() {
return JSON.stringify(this);
}
},
toUrl: {
enumerable: false,
value: function toUrl() {
return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());
}
}
});
return {
code,
map: {
version: 3,
names: [],
sources: [opts.sourceMapSource || null],
sourcesContent: [opts.sourceMapContent || null],
mappings: sourcemapCodec.encode(mappings)
}
map
};

@@ -1404,0 +1437,0 @@ }

2

package.json
{
"name": "code-red",
"description": "code-red",
"version": "0.0.27",
"version": "0.0.28",
"repository": "Rich-Harris/code-red",

@@ -6,0 +6,0 @@ "main": "dist/code-red.js",

Sorry, the diff of this file is not supported yet

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