mirror of
https://github.com/desktop/desktop
synced 2024-09-12 21:01:16 +00:00
Import source-map-support package
Changed also some wrong return undefined statements based on the TypeScript definitions of the package.
This commit is contained in:
parent
aa0d3252fb
commit
c185db17b2
|
@ -1,7 +1,7 @@
|
|||
import * as Path from 'path'
|
||||
import * as Fs from 'fs'
|
||||
import fileUriToPath from 'file-uri-to-path'
|
||||
const sourceMapSupport = require('source-map-support')
|
||||
import sourceMapSupport from 'source-map-support'
|
||||
|
||||
/**
|
||||
* This array tells the source map logic which files that we can expect to
|
||||
|
@ -38,9 +38,9 @@ function retrieveSourceMap(source: string) {
|
|||
return { url: Path.basename(path), map: xhr.responseText }
|
||||
}
|
||||
} catch (error) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
// We don't have an option here, see
|
||||
|
@ -49,7 +49,7 @@ function retrieveSourceMap(source: string) {
|
|||
// property on an error object and has to be synchronous :/
|
||||
// eslint-disable-next-line no-sync
|
||||
if (!Fs.existsSync(path)) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -57,7 +57,7 @@ function retrieveSourceMap(source: string) {
|
|||
const map = Fs.readFileSync(path, 'utf8')
|
||||
return { url: Path.basename(path), map }
|
||||
} catch (error) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -152,6 +152,7 @@
|
|||
"@types/react-virtualized": "^9.7.12",
|
||||
"@types/request": "^2.0.9",
|
||||
"@types/semver": "^5.5.0",
|
||||
"@types/source-map-support": "^0.5.2",
|
||||
"@types/strip-ansi": "^3.0.0",
|
||||
"@types/temp": "^0.8.29",
|
||||
"@types/textarea-caret": "^3.0.0",
|
||||
|
|
|
@ -584,6 +584,14 @@
|
|||
"@types/express-serve-static-core" "*"
|
||||
"@types/mime" "*"
|
||||
|
||||
"@types/source-map-support@^0.5.2":
|
||||
version "0.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.5.2.tgz#35e7446d470e63ec3fff4d7eceee0bc40efad239"
|
||||
integrity sha512-krvWmwQ2Pzr+Yp8tKjhKC9UguRNg1ev9mNdlVVpVJvU9iynulYZsx3ydf1SPzNNxzhmbWAOAIw5hMWhAMDc2NA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
source-map "^0.6.0"
|
||||
|
||||
"@types/source-map@*":
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/source-map/-/source-map-0.5.1.tgz#7e74db5d06ab373a712356eebfaea2fad0ea2367"
|
||||
|
|
Loading…
Reference in a new issue