magic-string
Advanced tools
Comparing version 0.4.3 to 0.4.4
# 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 |
@@ -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( '/' ); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63990
1860