browser-evm-signer 0.1.5 → 0.1.6
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/esm/version.d.ts.map +1 -1
- package/esm/version.js +4 -1
- package/package.json +1 -1
package/esm/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,OAAO,EAAE,MAAqB,CAAC"}
|
package/esm/version.js
CHANGED
|
@@ -2,13 +2,16 @@ import { readFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
function getVersion() {
|
|
5
|
+
// When loaded from JSR, import.meta.url is https:// — filesystem detection won't work
|
|
6
|
+
if (!globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url.startsWith("file://"))
|
|
7
|
+
return "dev";
|
|
5
8
|
const root = join(dirname(fileURLToPath(globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url)), "..");
|
|
6
9
|
// npm bundle: package.json exists at package root
|
|
7
10
|
try {
|
|
8
11
|
return JSON.parse(readFileSync(join(root, "package.json"), "utf-8")).version;
|
|
9
12
|
}
|
|
10
13
|
catch { /* not in npm bundle */ }
|
|
11
|
-
//
|
|
14
|
+
// Local dev: read from deno.jsonc
|
|
12
15
|
try {
|
|
13
16
|
const raw = readFileSync(join(root, "deno.jsonc"), "utf-8");
|
|
14
17
|
return JSON.parse(raw.replace(/^\s*\/\/.*$/gm, "")).version;
|