NET-Web-API-w-Angular/my-app/node_modules/@fastify/busboy/lib/utils/getLimit.js

17 lines
359 B
JavaScript
Raw Normal View History

2024-02-09 00:38:41 +00:00
'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]
}