Projektstart

This commit is contained in:
2026-01-22 15:49:12 +01:00
parent 7212eb6f7a
commit 57e5f652f8
10637 changed files with 2598792 additions and 64 deletions

26
backend/node_modules/avvio/lib/validate-plugin.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict'
const { AVV_ERR_PLUGIN_NOT_VALID } = require('./errors')
/**
* @param {any} maybePlugin
* @throws {AVV_ERR_PLUGIN_NOT_VALID}
*
* @returns {asserts plugin is Function|PromiseLike}
*/
function validatePlugin (maybePlugin) {
// validate if plugin is a function or Promise
if (!(maybePlugin && (typeof maybePlugin === 'function' || typeof maybePlugin.then === 'function'))) {
if (Array.isArray(maybePlugin)) {
throw new AVV_ERR_PLUGIN_NOT_VALID('array')
} else if (maybePlugin === null) {
throw new AVV_ERR_PLUGIN_NOT_VALID('null')
} else {
throw new AVV_ERR_PLUGIN_NOT_VALID(typeof maybePlugin)
}
}
}
module.exports = {
validatePlugin
}