react-native-fast-html-parser 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-fast-html-parser",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A lightning-fast HTML parser library for React Native that converts raw HTML fragments into a structured JSON AST tree. Built on a high-performance Rust core and integrated via direct C++ JSI HostObjects, it achieves pure zero-copy shared-memory access on-device. This avoids standard string/JSON serialization overhead and Hermes garbage collection pauses during render loops.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -94,7 +94,6 @@ function download(url, destPath) {
94
94
  },
95
95
  function (res) {
96
96
  if (res.statusCode === 301 || res.statusCode === 302) {
97
- file.close();
98
97
  return get(res.headers.location);
99
98
  }
100
99
  if (res.statusCode !== 200) {
@@ -113,11 +112,17 @@ function download(url, destPath) {
113
112
  }
114
113
  res.pipe(file);
115
114
  file.on('finish', function () {
116
- file.close(function() {
115
+ file.close(function () {
117
116
  const stat = fs.statSync(destPath);
118
117
  if (stat.size === 0) {
119
- try { fs.unlinkSync(destPath); } catch {}
120
- return reject(new Error('Downloaded file is empty: ' + path.basename(destPath)));
118
+ try {
119
+ fs.unlinkSync(destPath);
120
+ } catch {}
121
+ return reject(
122
+ new Error(
123
+ 'Downloaded file is empty: ' + path.basename(destPath)
124
+ )
125
+ );
121
126
  }
122
127
  resolve();
123
128
  });