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

get-source

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-source - npm Package Compare versions

Comparing version 1.0.32 to 1.0.33

46

impl/path.js

@@ -15,3 +15,3 @@ "use strict";

const a_endsWithSlash = (a[a.length - 1] === '/'),
b_startsWithSlash = (b[0] === '/')
b_startsWithSlash = (b[0] === '/')

@@ -23,37 +23,37 @@ return a + ((a_endsWithSlash || b_startsWithSlash) ? '' : '/') +

if (path.isAbsolute (x)) {
return path.normalize (x) }
if (path.isAbsolute (x)) {
return path.normalize (x) }
return path.normalize (path.concat (cwd, x))
return path.normalize (path.concat (cwd, x))
},
normalize (x) {
normalize (x) {
let output = [],
skip = 0
let output = [],
skip = 0
x.split ('/').reverse ().filter (x => x !== '.').forEach (x => {
x.split ('/').reverse ().filter (x => x !== '.').forEach (x => {
if (x === '..') { skip++ }
else if (skip === 0) { output.push (x) }
else { skip-- }
})
if (x === '..') { skip++ }
else if (skip === 0) { output.push (x) }
else { skip-- }
})
const result = output.reverse ().join ('/')
const result = output.reverse ().join ('/')
return ((isBrowser && (result[0] === '/')) ? window.location.origin : '') + result
},
return ((isBrowser && (result[0] === '/')) ? window.location.origin : '') + result
},
isData: x => x.indexOf ('data:') === 0,
isData: x => x.indexOf ('data:') === 0,
isAbsolute: x => (x[0] === '/') || /^[^\/]*:/.test (x),
isAbsolute: x => (x[0] === '/') || /^[^\/]*:/.test (x),
relativeToFile (a, b) {
return (path.isData (a) || path.isAbsolute (b)) ?
path.normalize (b) :
path.normalize (path.concat (a.split ('/').slice (0, -1).join ('/'), b))
}
relativeToFile (a, b) {
return (path.isData (a) || path.isAbsolute (b)) ?
path.normalize (b) :
path.normalize (path.concat (a.split ('/').slice (0, -1).join ('/'), b))
}
}
/* ------------------------------------------------------------------------ */
{
"name": "get-source",
"version": "1.0.32",
"version": "1.0.33",
"description": "Platform-agnostic source code inspection, with sourcemaps support",

@@ -5,0 +5,0 @@ "main": "get-source",

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