New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

adjust-sourcemap-loader

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adjust-sourcemap-loader - npm Package Compare versions

Comparing version
3.0.0
to
4.0.0
+37
codec/output-root-relative.js
'use strict';
var relative = require('./output-relative');
/**
* Codec for relative paths with respect to the output directory.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'outputRootRelative',
decode: decode,
encode: encode,
root : relative.root
};
/**
* Decode the given uri.
* Any path with leading slash is tested against output directory.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
return uri.startsWith('/') && relative.decode.call(this, uri.slice(1));
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri with leading slash
*/
function encode(absolute) {
/* jshint validthis:true */
return '/' + relative.encode.call(this, absolute);
}
'use strict';
var relative = require('./project-relative');
/**
* Codec for relative paths with respect to the project directory.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'projectRootRelative',
decode: decode,
encode: encode,
root : relative.root
};
/**
* Decode the given uri.
* Any path with leading slash is tested against project directory.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
return uri.startsWith('/') && relative.decode.call(this, uri.slice(1));
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri with leading slash
*/
function encode(absolute) {
/* jshint validthis:true */
return '/' + relative.encode.call(this, absolute);
}
'use strict';
var relative = require('./source-relative');
/**
* Codec for relative paths with respect to the source directory.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'sourceRootRelative',
decode: decode,
encode: encode,
root : relative.root
};
/**
* Decode the given uri.
* Any path with leading slash is tested against source directory.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
return uri.startsWith('/') && relative.decode.call(this, uri.slice(1));
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri with leading slash
*/
function encode(absolute) {
/* jshint validthis:true */
return '/' + relative.encode.call(this, absolute);
}
+4
-1

@@ -8,5 +8,8 @@ module.exports = [

require('./output-relative'),
require('./output-root-relative'),
require('./project-relative'),
require('./project-root-relative'),
require('./source-relative'),
require('./source-root-relative'),
require('./absolute')
];
];
+3
-3

@@ -21,3 +21,3 @@ 'use strict';

* Decode the given uri.
* Any path with or without leading slash is tested against context directory.
* Any path with without leading slash is tested against output directory.
* @this {{options: object}} A loader or compilation

@@ -29,3 +29,3 @@ * @param {string} uri A source uri to decode

/* jshint validthis:true */
var base = getOutputDirectory.call(this),
var base = !uri.startsWith('/') && getOutputDirectory.call(this),
absFile = !!base && path.normalize(path.join(base, uri)),

@@ -40,3 +40,3 @@ isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();

* @param {string} absolute An absolute file path to encode
* @returns {string} A uri
* @returns {string} A uri without leading slash
*/

@@ -43,0 +43,0 @@ function encode(absolute) {

@@ -10,3 +10,3 @@ 'use strict';

/**
* Codec for relative paths with respect to the context directory.
* Codec for relative paths with respect to the project directory.
* @type {{name:string, decode: function, encode: function, root: function}}

@@ -23,3 +23,3 @@ */

* Decode the given uri.
* Any path with or without leading slash is tested against context directory.
* Any path with without leading slash is tested against project directory.
* @this {{options: object}} A loader or compilation

@@ -31,4 +31,4 @@ * @param {string} uri A source uri to decode

/* jshint validthis:true */
var base = getContextDirectory.call(this),
absFile = path.normalize(path.join(base, uri)),
var base = !uri.startsWith('/') && getContextDirectory.call(this),
absFile = !!base && path.normalize(path.join(base, uri)),
isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();

@@ -42,3 +42,3 @@ return isValid && absFile;

* @param {string} absolute An absolute file path to encode
* @returns {string} A uri
* @returns {string} A uri without leading slash
*/

@@ -52,4 +52,4 @@ function encode(absolute) {

else {
return '/' + enhancedRelative(base, absolute);
return enhancedRelative(base, absolute);
}
}

@@ -7,3 +7,3 @@ 'use strict';

/**
* Codec for relative paths with respect to the context of the file being compiled.
* Codec for relative paths with respect to the source directory.
* @type {{name:string, decode: function, encode: function, root: function}}

@@ -20,4 +20,3 @@ */

* Decode the given uri.
* Any path with or without leading slash is tested against context directory.
* Exclude module paths containing `~`.
* Any path without leading slash is tested against source directory.
* @this {{options: object}} A loader or compilation

@@ -29,3 +28,3 @@ * @param {string} uri A source uri to decode

/* jshint validthis:true */
var base = this.context,
var base = !uri.startsWith('/') && this.context,
absFile = !!base && path.normalize(path.join(base, uri)),

@@ -40,3 +39,3 @@ isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();

* @param {string} absolute An absolute file path to encode
* @returns {string} A uri
* @returns {string} A uri without leading slash
*/

@@ -43,0 +42,0 @@ function encode(absolute) {

{
"name": "adjust-sourcemap-loader",
"version": "3.0.0",
"version": "4.0.0",
"description": "Webpack loader that adjusts source maps",

@@ -5,0 +5,0 @@ "main": "index.js",