@howuse/feedback 0.3.0 → 0.4.0

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/dist/index.cjs CHANGED
@@ -22,18 +22,15 @@ function tryLoadNativeLibrary() {
22
22
  throw new Error(`Unsupported platform: ${platform}`);
23
23
  }
24
24
  let libPath = path.join(packageRoot, "native", libName);
25
- if (!fs.existsSync(libPath)) {
26
- if (libPath.includes(".asar")) {
27
- const asarPath = libPath.replace(".asar", ".asar.unpacked");
28
- if (fs.existsSync(asarPath)) {
29
- libPath = asarPath;
30
- } else {
31
- throw new Error(`Native library asarPath not found: ${asarPath}. Please run 'npm run build:native' first.`);
32
- }
33
- } else {
34
- throw new Error(`Native library not found: ${libPath}. Please run 'npm run build:native' first.`);
25
+ if (libPath.includes(".asar")) {
26
+ const asarPath = libPath.replace(".asar", ".asar.unpacked");
27
+ if (fs.existsSync(asarPath)) {
28
+ libPath = asarPath;
35
29
  }
36
30
  }
31
+ if (!fs.existsSync(libPath)) {
32
+ throw new Error(`Native library not found: ${libPath}. Please run 'npm run build:native' first.`);
33
+ }
37
34
  try {
38
35
  return koffi.load(libPath);
39
36
  } catch (error) {
package/dist/index.mjs CHANGED
@@ -20,18 +20,15 @@ function tryLoadNativeLibrary() {
20
20
  throw new Error(`Unsupported platform: ${platform}`);
21
21
  }
22
22
  let libPath = path.join(packageRoot, "native", libName);
23
- if (!fs.existsSync(libPath)) {
24
- if (libPath.includes(".asar")) {
25
- const asarPath = libPath.replace(".asar", ".asar.unpacked");
26
- if (fs.existsSync(asarPath)) {
27
- libPath = asarPath;
28
- } else {
29
- throw new Error(`Native library asarPath not found: ${asarPath}. Please run 'npm run build:native' first.`);
30
- }
31
- } else {
32
- throw new Error(`Native library not found: ${libPath}. Please run 'npm run build:native' first.`);
23
+ if (libPath.includes(".asar")) {
24
+ const asarPath = libPath.replace(".asar", ".asar.unpacked");
25
+ if (fs.existsSync(asarPath)) {
26
+ libPath = asarPath;
33
27
  }
34
28
  }
29
+ if (!fs.existsSync(libPath)) {
30
+ throw new Error(`Native library not found: ${libPath}. Please run 'npm run build:native' first.`);
31
+ }
35
32
  try {
36
33
  return koffi.load(libPath);
37
34
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howuse/feedback",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Node.js/Electron SDK for user feedback and activation management",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",