npm and error messages

This commit is contained in:
2018-10-27 03:51:47 -05:00
parent 692ab70565
commit 025a403027
29601 changed files with 2759363 additions and 14 deletions

50
node_modules/vue/src/server/write.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
/* @flow */
const MAX_STACK_DEPTH = 1000
const noop = _ => _
const defer = typeof process !== 'undefined' && process.nextTick
? process.nextTick
: typeof Promise !== 'undefined'
? fn => Promise.resolve().then(fn)
: typeof setTimeout !== 'undefined'
? setTimeout
: noop
if (defer === noop) {
throw new Error(
'Your JavaScript runtime does not support any asynchronous primitives ' +
'that are required by vue-server-renderer. Please use a polyfill for ' +
'either Promise or setTimeout.'
)
}
export function createWriteFunction (
write: (text: string, next: Function) => boolean,
onError: Function
): Function {
let stackDepth = 0
const cachedWrite = (text, next) => {
if (text && cachedWrite.caching) {
cachedWrite.cacheBuffer[cachedWrite.cacheBuffer.length - 1] += text
}
const waitForNext = write(text, next)
if (waitForNext !== true) {
if (stackDepth >= MAX_STACK_DEPTH) {
defer(() => {
try { next() } catch (e) {
onError(e)
}
})
} else {
stackDepth++
next()
stackDepth--
}
}
}
cachedWrite.caching = false
cachedWrite.cacheBuffer = []
cachedWrite.componentBuffer = []
return cachedWrite
}