corebasic 1.0.236 → 1.0.237

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.
@@ -1,5 +1,6 @@
1
1
  import * as Mobile from './mobilecodes.js';
2
2
  import crypto from "node:crypto";
3
+ import { fileURLToPath } from 'node:url';
3
4
  // Parse JSON file: fileToJson
4
5
  import { readFile, writeFile } from 'fs/promises';
5
6
  export let pipeline = { execute: execute };
@@ -10,7 +11,8 @@ export function log(...args) {
10
11
  let PROJECT_ROOT_URL = new URL('../../..', import.meta.url);
11
12
  if (String(PROJECT_ROOT_URL).endsWith('node_modules/'))
12
13
  PROJECT_ROOT_URL = new URL('..', PROJECT_ROOT_URL);
13
- export const PROJECT_ROOT_PATH = String(PROJECT_ROOT_URL).endsWith("/") ? String(PROJECT_ROOT_URL).slice(0, -1) : String(PROJECT_ROOT_URL);
14
+ const rootPath = fileURLToPath(PROJECT_ROOT_URL);
15
+ export const PROJECT_ROOT_PATH = rootPath.endsWith('/') ? rootPath.slice(0, -1) : rootPath;
14
16
  let UID_COUNTER = crypto.randomBytes(3).readUIntBE(0, 3);
15
17
  const UID_PROCESS = crypto.randomBytes(5);
16
18
  export function uid() {
package/libs/utils.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as Mobile from './mobilecodes.ts'
2
2
  import crypto from "node:crypto";
3
+ import { fileURLToPath } from 'node:url';
3
4
 
4
5
  // Parse JSON file: fileToJson
5
6
  import {readFile,writeFile} from 'fs/promises';
@@ -14,7 +15,8 @@ export function log(...args: unknown[]): void {
14
15
  let PROJECT_ROOT_URL = new URL('../../..', import.meta.url)
15
16
  if (String(PROJECT_ROOT_URL).endsWith('node_modules/'))
16
17
  PROJECT_ROOT_URL = new URL('..', PROJECT_ROOT_URL)
17
- export const PROJECT_ROOT_PATH: string = String(PROJECT_ROOT_URL).endsWith("/") ? String(PROJECT_ROOT_URL).slice(0, -1) : String(PROJECT_ROOT_URL)
18
+ const rootPath: string = fileURLToPath(PROJECT_ROOT_URL);
19
+ export const PROJECT_ROOT_PATH: string = rootPath.endsWith('/') ? rootPath.slice(0, -1) : rootPath;
18
20
 
19
21
 
20
22
  let UID_COUNTER = crypto.randomBytes(3).readUIntBE(0, 3);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.236",
4
+ "version": "1.0.237",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "./index.ts",