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 2.0.10 to 2.0.11

29

get-source.js

@@ -153,13 +153,24 @@ "use strict";

module.exports.async = impl (function fetchFileAsync (path) {
if (isBrowser) {
return fetch (path).then (x => x.text ())
} else {
return new Promise ((resolve, reject) => {
nodeRequire ('fs').readFile (path, { encoding: 'utf8' }, (e, x) => {
e ? reject (e) : resolve (x)
})
})
return new Promise ((resolve, reject) => {
if (isBrowser) {
let xhr = new XMLHttpRequest ()
xhr.open ('GET', path)
xhr.onreadystatechange = event => {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
resolve (xhr.responseText)
} else {
reject (new Error (xhr.statusText))
}
}
}
})
xhr.send (null)
} else {
nodeRequire ('fs').readFile (path, { encoding: 'utf8' }, (e, x) => {
e ? reject (e) : resolve (x)
})
}
})
})
/* ------------------------------------------------------------------------ */
{
"name": "get-source",
"version": "2.0.10",
"version": "2.0.11",
"description": "Fetch source-mapped sources. Peek by file, line, column. Node & browsers. Sync & async.",

@@ -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