Skip to content

Commit 2417fe1

Browse files
committed
chore(deps): upgrade npm packages (#149)
This commit upgrades all npm packages, including `normalize-url`, `trim-newlines` and `ws` which were reported vulnerable. Among the upgraded packages was `prettier`, which required some code style changes.
1 parent 5cf7391 commit 2417fe1

File tree

5 files changed

+1399
-1518
lines changed

5 files changed

+1399
-1518
lines changed

example/src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ interface DVProps {
271271

272272
const DownloaderView = (props: DVProps) => {
273273
const [isDownloading, setIsDownloading] = useState(false);
274-
const [useAndroidDownloadManager, setUseAndroidDownloadManager] = useState(
275-
false
276-
);
274+
const [useAndroidDownloadManager, setUseAndroidDownloadManager] =
275+
useState(false);
277276
const [received, setReceived] = useState<number>(0);
278277
const [expected, setExpected] = useState<number | undefined>(0);
279278
const [cancelDownload, setCanceller] = useState<() => void>(() => () => {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@
6565
"jest-junit": "^12.0.0",
6666
"pod-install": "^0.1.0",
6767
"prettier": "^2.0.5",
68-
"react-native-builder-bob": "^0.18.0",
6968
"react": "16.11.0",
7069
"react-native": "0.62.2",
70+
"react-native-builder-bob": "^0.18.0",
7171
"release-it": "^13.5.8",
7272
"typescript": "4.0.6"
7373
},
7474
"peerDependencies": {
75-
"react-native": "*",
76-
"react": "*"
75+
"react": "*",
76+
"react-native": "*"
7777
},
7878
"resolutions": {
7979
"xmldom": "0.5.0"

src/__tests__/index.test.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ import type {
3030
TargetType,
3131
} from 'src/ExposedTypes';
3232

33-
const {
34-
BlobCourier: BlobCourierNative,
35-
BlobCourierEventEmitter,
36-
} = NativeModules;
33+
const { BlobCourier: BlobCourierNative, BlobCourierEventEmitter } =
34+
NativeModules;
3735

3836
const NATIVE_EVENT_EMITTER_SINGLETON = new NativeEventEmitter(
3937
BlobCourierEventEmitter
@@ -65,12 +63,13 @@ const DEFAULT_MULTIPART_UPLOAD_REQUEST: BlobMultipartMapUploadRequest = {
6563
url: 'https://github.com/edeckers/react-native-blob-courier',
6664
};
6765

68-
const DEFAULT_MULTIPART_ARRAY_UPLOAD_REQUEST: BlobMultipartArrayUploadRequest = {
69-
...DEFAULT_MULTIPART_UPLOAD_REQUEST,
70-
parts: convertMappedMultipartsWithSymbolizedKeysToArray(
71-
sanitizeMappedMultiparts(DEFAULT_MULTIPART_UPLOAD_REQUEST.parts)
72-
),
73-
};
66+
const DEFAULT_MULTIPART_ARRAY_UPLOAD_REQUEST: BlobMultipartArrayUploadRequest =
67+
{
68+
...DEFAULT_MULTIPART_UPLOAD_REQUEST,
69+
parts: convertMappedMultipartsWithSymbolizedKeysToArray(
70+
sanitizeMappedMultiparts(DEFAULT_MULTIPART_UPLOAD_REQUEST.parts)
71+
),
72+
};
7473

7574
const RANDOM_VALUE_GENERATORS: { [key: string]: () => any } = {
7675
boolean: () => Math.random() >= 0.5,
@@ -165,7 +164,8 @@ describe('Given fallback parameters are provided through a constant', () => {
165164
target: DEFAULT_FETCH_TARGET,
166165
},
167166
method: 'GET',
168-
progressIntervalMilliseconds: DEFAULT_PROGRESS_UPDATE_INTERVAL_MILLISECONDS,
167+
progressIntervalMilliseconds:
168+
DEFAULT_PROGRESS_UPDATE_INTERVAL_MILLISECONDS,
169169
});
170170
});
171171

@@ -329,7 +329,8 @@ describe('Given a fluent fetch request', () => {
329329
testAsync(
330330
'The native module is called with all required values and the provided settings',
331331
async () => {
332-
const progressIntervalMilliseconds = DEFAULT_PROGRESS_UPDATE_INTERVAL_MILLISECONDS;
332+
const progressIntervalMilliseconds =
333+
DEFAULT_PROGRESS_UPDATE_INTERVAL_MILLISECONDS;
333334

334335
await BlobCourier.settings({
335336
progressIntervalMilliseconds,
@@ -454,9 +455,8 @@ describe('Given a fluent fetch request', () => {
454455
},
455456
};
456457

457-
const parameterIntersection = dict(calledWithParameters).intersect(
458-
expectedParameters
459-
);
458+
const parameterIntersection =
459+
dict(calledWithParameters).intersect(expectedParameters);
460460

461461
expect(expectedParameters).toEqual(parameterIntersection);
462462
expect(BlobCourierEventEmitter.addListener).toHaveBeenCalled();
@@ -493,9 +493,8 @@ describe('Given a fluent fetch request', () => {
493493
},
494494
};
495495

496-
const parameterIntersection = dict(calledWithParameters).intersect(
497-
expectedParameters
498-
);
496+
const parameterIntersection =
497+
dict(calledWithParameters).intersect(expectedParameters);
499498

500499
expect(expectedParameters).toEqual(parameterIntersection);
501500
verifyPropertyExistsAndIsDefined(calledWithParameters, 'taskId');

src/index.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,8 @@ const sanitizeSettingsData = <T extends BlobRequestSettings>(
9595
const sanitizeFetchData = <T extends BlobFetchNativeInput>(
9696
input: Readonly<T>
9797
): BlobFetchNativeInput => {
98-
const {
99-
android,
100-
filename,
101-
headers,
102-
ios,
103-
method,
104-
mimeType,
105-
taskId,
106-
url,
107-
} = input;
98+
const { android, filename, headers, ios, method, mimeType, taskId, url } =
99+
input;
108100

109101
const settings = sanitizeSettingsData(input);
110102

0 commit comments

Comments
 (0)