From bb874e9aa36534970bfecef000268ea5a2181b9c Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 18 Jun 2024 14:07:23 +0100 Subject: [PATCH] patch remove lodash dependency from rn-fetch-blob --- patches/rn-fetch-blob+0.12.0.patch | 22 ++++++++++++++++++++++ patches/rn-fetch-blob+0.12.0.patch.md | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 patches/rn-fetch-blob+0.12.0.patch create mode 100644 patches/rn-fetch-blob+0.12.0.patch.md diff --git a/patches/rn-fetch-blob+0.12.0.patch b/patches/rn-fetch-blob+0.12.0.patch new file mode 100644 index 0000000000..01aec89d36 --- /dev/null +++ b/patches/rn-fetch-blob+0.12.0.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/rn-fetch-blob/index.js b/node_modules/rn-fetch-blob/index.js +index 8ab5e96..9bc8802 100644 +--- a/node_modules/rn-fetch-blob/index.js ++++ b/node_modules/rn-fetch-blob/index.js +@@ -21,7 +21,7 @@ import fs from './fs' + import getUUID from './utils/uuid' + import base64 from 'base-64' + import polyfill from './polyfill' +-import _ from 'lodash' ++import reduce from 'lodash.reduce' + import android from './android' + import ios from './ios' + import JSONStream from './json-stream' +@@ -224,7 +224,7 @@ function fetch(...args:any):Promise { + + // # 241 normalize null or undefined headers, in case nil or null string + // pass to native context +- headers = _.reduce(headers, (result, value, key) => { ++ headers = reduce(headers, (result, value, key) => { + result[key] = value || '' + return result + }, {}); diff --git a/patches/rn-fetch-blob+0.12.0.patch.md b/patches/rn-fetch-blob+0.12.0.patch.md new file mode 100644 index 0000000000..642a8f34d3 --- /dev/null +++ b/patches/rn-fetch-blob+0.12.0.patch.md @@ -0,0 +1,3 @@ +## rn-fetch-blob Patch + +This patch removes a dependency on `lodash`, changing it to `lodash.reduce` to reduce bundle size. \ No newline at end of file