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

magic-string

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magic-string - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

6

CHANGELOG.md
# changelog
## 0.4.4
* Another Windows fix, this time for file paths when bundling
## 0.4.3
Handle Windows-style CRLF newlines when determining whether a line is empty
* Handle Windows-style CRLF newlines when determining whether a line is empty

@@ -7,0 +11,0 @@ ## 0.4.2

6

dist/magic-string.deps.js

@@ -44,4 +44,4 @@ (function (global, factory) {

fromParts = from.split( '/' );
toParts = to.split( '/' );
fromParts = from.split( /[\/\\]/ );
toParts = to.split( /[\/\\]/ );

@@ -119,3 +119,3 @@ fromParts.pop(); // get dirname

return new SourceMap({
file: options.file.split( '/' ).pop(),
file: options.file.split( /[\/\\]/ ).pop(),
sources: this.sources.map( function ( source ) {

@@ -122,0 +122,0 @@ return getRelativePath( options.file, source.filename );

@@ -44,4 +44,4 @@ (function (global, factory) {

fromParts = from.split( '/' );
toParts = to.split( '/' );
fromParts = from.split( /[\/\\]/ );
toParts = to.split( /[\/\\]/ );

@@ -119,3 +119,3 @@ fromParts.pop(); // get dirname

return new SourceMap({
file: options.file.split( '/' ).pop(),
file: options.file.split( /[\/\\]/ ).pop(),
sources: this.sources.map( function ( source ) {

@@ -122,0 +122,0 @@ return getRelativePath( options.file, source.filename );

@@ -5,3 +5,3 @@ {

"author": "Rich Harris",
"version": "0.4.3",
"version": "0.4.4",
"repository": "https://github.com/rich-harris/magic-string",

@@ -8,0 +8,0 @@ "main": "dist/magic-string.js",

@@ -60,3 +60,3 @@ import SourceMap from '../SourceMap';

return new SourceMap({
file: options.file.split( '/' ).pop(),
file: options.file.split( /[\/\\]/ ).pop(),
sources: this.sources.map( function ( source ) {

@@ -177,2 +177,2 @@ return getRelativePath( options.file, source.filename );

return new Array( str.split( '\n' ).length ).join( ';' );
}
}
export default function getRelativePath ( from, to ) {
var fromParts, toParts, i;
fromParts = from.split( '/' );
toParts = to.split( '/' );
fromParts = from.split( /[\/\\]/ );
toParts = to.split( /[\/\\]/ );

@@ -20,2 +20,2 @@ fromParts.pop(); // get dirname

return fromParts.concat( toParts ).join( '/' );
}
}
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