mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix: serialize external function (#4916)
This commit is contained in:
parent
32b0f155c9
commit
14f43da9b2
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import serialize from 'serialize-javascript'
|
import serialize from 'serialize-javascript'
|
||||||
|
|
||||||
export function serializeFunction(func) {
|
export function serializeFunction(func) {
|
||||||
@ -15,7 +14,7 @@ export function serializeFunction(func) {
|
|||||||
return _
|
return _
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.replace(`${func.name}(`, 'function (')
|
.replace(`${func.name || 'function'}(`, 'function (')
|
||||||
}
|
}
|
||||||
|
|
||||||
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch))(\w+)\s*\((.*?)\)\s*\{/gm
|
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch))(\w+)\s*\((.*?)\)\s*\{/gm
|
||||||
|
Loading…
Reference in New Issue
Block a user