change-string-case/node_modules/@fastify/busboy/lib/utils/getLimit.js
Alex Szczuczko d0603cd0a7 npm install
2023-10-25 14:27:07 -06:00

17 lines
359 B
JavaScript

'use strict'
module.exports = function getLimit (limits, name, defaultLimit) {
if (
!limits ||
limits[name] === undefined ||
limits[name] === null
) { return defaultLimit }
if (
typeof limits[name] !== 'number' ||
isNaN(limits[name])
) { throw new TypeError('Limit ' + name + ' is not a valid number') }
return limits[name]
}