react-native-mmkv
Version:
⚡️ The fastest key/value storage for React Native.
17 lines (16 loc) • 422 B
JavaScript
export function createTextDecoder() {
const g = global ?? globalThis ?? window;
if (g.TextDecoder != null) {
return new g.TextDecoder();
}
else {
return {
decode: () => {
throw new Error('TextDecoder is not supported in this environment!');
},
encoding: 'utf-8',
fatal: false,
ignoreBOM: false,
};
}
}