mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-18 06:24:21 +01:00
Rename workspace members (subfolders) (#149)
* Rename ls-sdk-bindings workspace member * Rename ls-sdk-core workspace member * Rename ls-sdk-react-native
This commit is contained in:
5
packages/react-native/example/utils/security.ts
Normal file
5
packages/react-native/example/utils/security.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
const RE = /\w/g;
|
||||
|
||||
export const obfuscateString = (text: string): string => {
|
||||
return text.replace(RE, "*")
|
||||
}
|
||||
20
packages/react-native/example/utils/storage.ts
Normal file
20
packages/react-native/example/utils/storage.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import SecureStorage from "react-native-secure-storage"
|
||||
|
||||
const secureConfig = {}
|
||||
|
||||
export const clearSecureStorage = async (): Promise<void> => {
|
||||
const keys = await SecureStorage.getAllKeys()
|
||||
|
||||
for await (const key of keys) {
|
||||
await SecureStorage.removeItem(key, secureConfig)
|
||||
}
|
||||
}
|
||||
|
||||
export const setSecureItem = async (key: string, item: any): Promise<void> => {
|
||||
return await SecureStorage.setItem(key, JSON.stringify(item), secureConfig)
|
||||
}
|
||||
|
||||
export const getSecureItem = async (key: string): Promise<any | null> => {
|
||||
const item = await SecureStorage.getItem(key, secureConfig)
|
||||
return item && JSON.parse(item)
|
||||
}
|
||||
Reference in New Issue
Block a user