Skip to content

Commit 9993f6e

Browse files
authored
fix: multiSet should expect read-only input (#1103)
1 parent bbf2179 commit 9993f6e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/default-storage/src/helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { ErrorLike } from "./types";
22

3-
export function checkValidArgs(keyValuePairs: unknown[], callback: unknown) {
3+
export function checkValidArgs(
4+
keyValuePairs: readonly unknown[],
5+
callback: unknown
6+
) {
47
if (
58
!Array.isArray(keyValuePairs) ||
69
keyValuePairs.length === 0 ||

packages/default-storage/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export type AsyncStorageStatic = {
128128
* See https://react-native-async-storage.github.io/async-storage/docs/api#multiset
129129
*/
130130
multiSet: (
131-
keyValuePairs: [string, string][],
131+
keyValuePairs: ReadonlyArray<readonly [string, string]>,
132132
callback?: MultiCallback
133133
) => Promise<void>;
134134

0 commit comments

Comments
 (0)