react-native-gzip-new-architecture
Version:
Fast gzip to compress strings for android & ios in React Native with New Architecture support
30 lines (29 loc) • 862 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deflate = deflate;
exports.inflate = inflate;
var _reactNative = require("react-native");
const LINKING_ERROR = `The package 'react-native-gzip' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const Gzip = _reactNative.NativeModules.Gzip ? _reactNative.NativeModules.Gzip : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
/**
* Decompress data encoded as base64 string
*/
function inflate(base64) {
return Gzip.inflate(base64);
}
/**
* Compress data to base64 encoded string
*/
function deflate(data) {
return Gzip.deflate(data);
}
//# sourceMappingURL=index.js.map