@signaldb/core 1.2.1 → 1.2.2
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.cjs2.js +8 -2
- package/dist/index.cjs5.js +2 -1
- package/dist/index2.mjs +8 -2
- package/dist/index5.mjs +2 -1
- package/package.json +1 -1
package/dist/index.cjs2.js
CHANGED
|
@@ -17,6 +17,12 @@ const packageName = "@signaldb/devtools";
|
|
|
17
17
|
function isNodeErrorWithCode(error) {
|
|
18
18
|
return typeof error === "object" && error !== null && "code" in error && typeof error.code === "string";
|
|
19
19
|
}
|
|
20
|
+
function isFailedDevToolsImportError(error) {
|
|
21
|
+
if (isNodeErrorWithCode(error)) {
|
|
22
|
+
return error.code === "MODULE_NOT_FOUND";
|
|
23
|
+
}
|
|
24
|
+
return error.name === "TypeError" && error.message.includes("Failed to resolve module specifier") && error.message.includes(packageName);
|
|
25
|
+
}
|
|
20
26
|
function isCommonJS() {
|
|
21
27
|
return typeof module !== "undefined" && !!module.exports;
|
|
22
28
|
}
|
|
@@ -39,7 +45,7 @@ async function checkDevtoolsAvailability() {
|
|
|
39
45
|
);
|
|
40
46
|
return true;
|
|
41
47
|
} catch (error) {
|
|
42
|
-
if (!
|
|
48
|
+
if (!isFailedDevToolsImportError(error)) {
|
|
43
49
|
throw error;
|
|
44
50
|
}
|
|
45
51
|
}
|
|
@@ -62,7 +68,7 @@ async function checkAndImportDevtools() {
|
|
|
62
68
|
require(packageName);
|
|
63
69
|
return true;
|
|
64
70
|
} catch (error) {
|
|
65
|
-
if (
|
|
71
|
+
if (isFailedDevToolsImportError(error)) {
|
|
66
72
|
return false;
|
|
67
73
|
}
|
|
68
74
|
throw error;
|
package/dist/index.cjs5.js
CHANGED
|
@@ -23,7 +23,8 @@ function createTemporaryFallbackExecutor(firstResolvingPromiseFunction, secondRe
|
|
|
23
23
|
}
|
|
24
24
|
isResolved = true;
|
|
25
25
|
resolvedValue = result;
|
|
26
|
-
options.onResolve
|
|
26
|
+
if (options == null ? void 0 : options.onResolve)
|
|
27
|
+
options.onResolve(resolvedValue);
|
|
27
28
|
return result;
|
|
28
29
|
});
|
|
29
30
|
} else if (isResolved) {
|
package/dist/index2.mjs
CHANGED
|
@@ -14,6 +14,12 @@ const packageName = "@signaldb/devtools";
|
|
|
14
14
|
function isNodeErrorWithCode(error) {
|
|
15
15
|
return typeof error === "object" && error !== null && "code" in error && typeof error.code === "string";
|
|
16
16
|
}
|
|
17
|
+
function isFailedDevToolsImportError(error) {
|
|
18
|
+
if (isNodeErrorWithCode(error)) {
|
|
19
|
+
return error.code === "MODULE_NOT_FOUND";
|
|
20
|
+
}
|
|
21
|
+
return error.name === "TypeError" && error.message.includes("Failed to resolve module specifier") && error.message.includes(packageName);
|
|
22
|
+
}
|
|
17
23
|
function isCommonJS() {
|
|
18
24
|
return typeof module !== "undefined" && !!module.exports;
|
|
19
25
|
}
|
|
@@ -36,7 +42,7 @@ async function checkDevtoolsAvailability() {
|
|
|
36
42
|
);
|
|
37
43
|
return true;
|
|
38
44
|
} catch (error) {
|
|
39
|
-
if (!
|
|
45
|
+
if (!isFailedDevToolsImportError(error)) {
|
|
40
46
|
throw error;
|
|
41
47
|
}
|
|
42
48
|
}
|
|
@@ -59,7 +65,7 @@ async function checkAndImportDevtools() {
|
|
|
59
65
|
require(packageName);
|
|
60
66
|
return true;
|
|
61
67
|
} catch (error) {
|
|
62
|
-
if (
|
|
68
|
+
if (isFailedDevToolsImportError(error)) {
|
|
63
69
|
return false;
|
|
64
70
|
}
|
|
65
71
|
throw error;
|
package/dist/index5.mjs
CHANGED
|
@@ -21,7 +21,8 @@ function createTemporaryFallbackExecutor(firstResolvingPromiseFunction, secondRe
|
|
|
21
21
|
}
|
|
22
22
|
isResolved = true;
|
|
23
23
|
resolvedValue = result;
|
|
24
|
-
options.onResolve
|
|
24
|
+
if (options == null ? void 0 : options.onResolve)
|
|
25
|
+
options.onResolve(resolvedValue);
|
|
25
26
|
return result;
|
|
26
27
|
});
|
|
27
28
|
} else if (isResolved) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaldb/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON interface to places such as localStorage.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist && vite build"
|