@kaspernj/api-maker 1.0.372 → 1.0.373

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaspernj/api-maker",
3
- "version": "1.0.372",
3
+ "version": "1.0.373",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -158,7 +158,8 @@ export default class ApiMakerCommandsPool {
158
158
  } else if (responseType == "error") {
159
159
  const error = new CustomError("Command error", {response: commandResponseData})
160
160
 
161
- error.stack += commandData.stack
161
+ error.stack += "\n"
162
+ error.stack += commandData.stack.split("\n").slice(1).join("\n")
162
163
 
163
164
  commandData.reject(error)
164
165
  } else if (responseType == "failed") {
@@ -13,21 +13,21 @@ if (SourceMapConsumer.initialize) {
13
13
  const logger = new Logger({name: "ApiMaker / SourceMapsLoader"})
14
14
 
15
15
  export default class SourceMapsLoader {
16
- constructor () {
16
+ constructor() {
17
17
  this.isLoadingSourceMaps = false
18
18
  this.sourceMaps = []
19
19
  this.srcLoaded = {}
20
20
  }
21
21
 
22
- loadSourceMapsForScriptTags (callback) {
22
+ loadSourceMapsForScriptTags(callback) {
23
23
  this.loadSourceMapsForScriptTagsCallback = callback
24
24
  }
25
25
 
26
- sourceMapForSource (callback) {
26
+ sourceMapForSource(callback) {
27
27
  this.sourceMapForSourceCallback = callback
28
28
  }
29
29
 
30
- async loadSourceMaps (error) {
30
+ async loadSourceMaps(error) {
31
31
  if (!error) throw new Error("No error was given to SourceMapsLoader#loadSourceMaps")
32
32
 
33
33
  this.isLoadingSourceMaps = true
@@ -111,11 +111,9 @@ export default class SourceMapsLoader {
111
111
  }
112
112
  }
113
113
 
114
- includeMapURL(src) {
115
- return src.includes("/packs/")
116
- }
114
+ includeMapURL = (src) => src.includes("/packs/")
117
115
 
118
- async loadSourceMapForSource ({originalUrl, sourceMapUrl}) {
116
+ async loadSourceMapForSource({originalUrl, sourceMapUrl}) {
119
117
  const xhr = new XMLHttpRequest()
120
118
 
121
119
  xhr.open("GET", sourceMapUrl, true)
@@ -127,26 +125,27 @@ export default class SourceMapsLoader {
127
125
  this.sourceMaps.push({consumer, originalUrl})
128
126
  }
129
127
 
130
- loadUrl (url) {
128
+ loadUrl(url) {
131
129
  const parser = document.createElement("a")
130
+
132
131
  parser.href = url
133
132
 
134
133
  return parser
135
134
  }
136
135
 
137
- loadXhr (xhr, postData) {
136
+ loadXhr(xhr, postData) {
138
137
  return new Promise((resolve) => {
139
138
  xhr.onload = () => resolve()
140
139
  xhr.send(postData)
141
140
  })
142
141
  }
143
142
 
144
- parseStackTrace (stackTrace) {
143
+ parseStackTrace(stackTrace) {
145
144
  return this.getStackTraceData(stackTrace)
146
145
  .map((traceData) => `at ${traceData.methodName} (${traceData.fileString})`)
147
146
  }
148
147
 
149
- getStackTraceData (stackTrace) {
148
+ getStackTraceData(stackTrace) {
150
149
  const stack = stackTraceParser.parse(stackTrace)
151
150
  const newSourceMap = []
152
151