chore(xapi/extractOpaqueRef): named function for better stacktraces

This commit is contained in:
Julien Fontanet
2023-05-24 12:05:56 +02:00
parent c576114dad
commit cf7393992c

View File

@@ -2,7 +2,7 @@
const OPAQUE_REF_RE = /OpaqueRef:[0-9a-z-]+/
module.exports = str => {
module.exports = function extractOpaqueRef(str) {
const matches = OPAQUE_REF_RE.exec(str)
if (!matches) {
throw new Error('no opaque ref found')