Skip to content

Commit

Permalink
Fix type errors from Flow 0.107 (oblador#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee authored Apr 27, 2020
1 parent cb41f78 commit e6090b2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ untyped-import
untyped-type-import

[version]
^0.105.2
^0.107.0
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ export type SecSecurityRules = $Values<typeof SECURITY_RULES>;

export type SecBiometryType = $Values<typeof BIOMETRY_TYPE>;

export type AuthenticationPrompt = {
export type AuthenticationPrompt = {|
title?: string,
subtitle?: string,
description?: string,
cancel?: string,
};
|};

type BaseOptions = {
type BaseOptions = {|
accessControl?: SecAccessControl,
accessGroup?: string,
accessible?: SecAccessible,
Expand All @@ -83,7 +83,7 @@ type BaseOptions = {
securityLevel?: SecMinimumLevel,
storage?: SecStorageType,
rules?: SecSecurityRules,
};
|};

type NormalizedOptions = {
authenticationPrompt?: AuthenticationPrompt,
Expand Down Expand Up @@ -116,7 +116,7 @@ const AUTH_PROMPT_DEFAULTS = {
cancel: 'Cancel',
};

function normalizeServiceOption(serviceOrOptions?: string | Options): Options {
function normalizeServiceOption(serviceOrOptions?: string | Options) {
if (typeof serviceOrOptions === 'string') {
console.warn(
`You passed a service string as an argument to one of the react-native-keychain functions.
Expand Down Expand Up @@ -155,6 +155,7 @@ function normalizeOptions(
};
}

// $FlowFixMe >=0.107.x – remove in next major, when authenticationPrompt as string is removed
return options;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"license": "MIT",
"devDependencies": {
"flow-bin": "0.105.2",
"flow-bin": "^0.107.0",
"react-native": "^0.61.2"
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1948,10 +1948,10 @@ find-up@^4.1.0:
locate-path "^5.0.0"
path-exists "^4.0.0"

flow-bin@0.105.2:
version "0.105.2"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.105.2.tgz#9d03d5ae3e1d011e311f309cb8786b3b3695fec2"
integrity sha512-VCHt0SCjFPviv/Ze/W7AgkcE0uH4TocypSFA8wR3ZH1P7BSjny4l3uhHyOjzU3Qo1i0jO4NyaU6q3Y5IaQ6xng==
flow-bin@^0.107.0:
version "0.107.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.107.0.tgz#b37bfcce51204d35d58f8eb93b3a76b52291e4cc"
integrity sha512-hsmwO5Q0+XUXaO2kIKLpleUNNBSFcsGEQGBOTEC/KR/4Ez695I1fweX/ioSjbU4RWhPZhkIqnpbF9opVAauCHg==

for-in@^1.0.2:
version "1.0.2"
Expand Down

0 comments on commit e6090b2

Please sign in to comment.