Area restrita - Questionario

This commit is contained in:
2026-06-08 23:50:59 -03:00
parent f2e2400637
commit ef968f10ae
6972 changed files with 23454 additions and 2267883 deletions
+5 -22
View File
@@ -16,7 +16,6 @@ function fromBase64(str) {
class PreviousMap {
constructor(css, opts) {
if (opts.map === false) return
if (opts.unsafeMap) this.unsafeMap = true
this.loadAnnotation(css)
this.inline = this.startWith(this.annotation, 'data:')
@@ -31,7 +30,7 @@ class PreviousMap {
consumer() {
if (!this.consumerCache) {
this.consumerCache = new SourceMapConsumer(this.json || this.text)
this.consumerCache = new SourceMapConsumer(this.text)
}
return this.consumerCache
}
@@ -52,8 +51,7 @@ class PreviousMap {
return fromBase64(text.substr(baseUriMatch[0].length))
}
let encoding = text.slice('data:application/json;'.length)
encoding = encoding.slice(0, encoding.indexOf(','))
let encoding = text.match(/data:application\/json;([^,]+),/)[1]
throw new Error('Unsupported source map encoding ' + encoding)
}
@@ -84,13 +82,7 @@ class PreviousMap {
}
}
loadFile(path, cssFile, trusted) {
/* c8 ignore next 5 */
if (!trusted && !this.unsafeMap) {
if (!/\.map$/i.test(path)) {
return undefined
}
}
loadFile(path) {
this.root = dirname(path)
if (existsSync(path)) {
this.mapFile = path
@@ -107,7 +99,7 @@ class PreviousMap {
} else if (typeof prev === 'function') {
let prevPath = prev(file)
if (prevPath) {
let map = this.loadFile(prevPath, file, true)
let map = this.loadFile(prevPath)
if (!map) {
throw new Error(
'Unable to load previous source map: ' + prevPath.toString()
@@ -131,16 +123,7 @@ class PreviousMap {
} else if (this.annotation) {
let map = this.annotation
if (file) map = join(dirname(file), map)
let unknown = this.loadFile(map, file, false)
if (unknown) {
try {
/* c8 ignore next 4 */
this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ''))
} catch {
return undefined
}
}
return unknown
return this.loadFile(map)
}
}