From b22f6770c8bd084d66950655203c61dd701b3d90 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 4 Jun 2022 08:51:19 +0200 Subject: Remove node_modules --- node_modules/got/source/utils/get-body-size.js | 32 -------------------------- 1 file changed, 32 deletions(-) delete mode 100644 node_modules/got/source/utils/get-body-size.js (limited to 'node_modules/got/source/utils/get-body-size.js') diff --git a/node_modules/got/source/utils/get-body-size.js b/node_modules/got/source/utils/get-body-size.js deleted file mode 100644 index 0df5af2..0000000 --- a/node_modules/got/source/utils/get-body-size.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; -const fs = require('fs'); -const util = require('util'); -const is = require('@sindresorhus/is'); -const isFormData = require('./is-form-data'); - -module.exports = async options => { - const {body} = options; - - if (options.headers['content-length']) { - return Number(options.headers['content-length']); - } - - if (!body && !options.stream) { - return 0; - } - - if (is.string(body)) { - return Buffer.byteLength(body); - } - - if (isFormData(body)) { - return util.promisify(body.getLength.bind(body))(); - } - - if (body instanceof fs.ReadStream) { - const {size} = await util.promisify(fs.stat)(body.path); - return size; - } - - return null; -}; -- cgit