@alwatr/nitrobase-helper 7.10.1 → 9.1.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/main.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 📦 @alwatr/nitrobase-helper v9.1.0 */
2
+ import{flatString as z}from"@alwatr/flat-string";import{StoreFileExtension as A}from"@alwatr/nitrobase-types";function D(k){let q=k.region+"/"+k.name;if(k.ownerId!==void 0)q+="/"+k.ownerId;return z(q)}function G(k){let q=k.region;if(k.ownerId!==void 0)q+="/"+k.ownerId.slice(0,3)+"/"+k.ownerId;return q+=`/${k.name}.${k.type}.${k.extension??A.Json}`,z(q)}export{G as getStorePath,D as getStoreId};
3
+
4
+ //# debugId=A4578072432048EF64756E2164756E21
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/main.ts"],
4
+ "sourcesContent": [
5
+ "import {flatString} from '@alwatr/flat-string';\nimport {StoreFileExtension, type StoreFileId, type StoreFileStat} from '@alwatr/nitrobase-types';\n\n/**\n * Convert StoreFileId to a string ID.\n *\n * @param storeId - The StoreFileId.\n * @returns The nitrobase ID as a string.\n */\nexport function getStoreId(storeId: StoreFileId): string {\n let id = storeId.region + '/' + storeId.name;\n if (storeId.ownerId !== undefined) {\n id += '/' + storeId.ownerId;\n }\n return flatString(id);\n}\n\n/**\n * Returns the nitrobase path based on the provided storeStat object.\n *\n * @param storeStat The nitrobase file stat object.\n * @returns The nitrobase path.\n */\nexport function getStorePath(storeStat: StoreFileStat): string {\n let path: string = storeStat.region;\n if (storeStat.ownerId !== undefined) {\n path += '/' + storeStat.ownerId.slice(0, 3) + '/' + storeStat.ownerId;\n }\n path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? StoreFileExtension.Json}`;\n return flatString(path);\n}\n"
6
+ ],
7
+ "mappings": ";AAAA,qBAAQ,4BACR,6BAAQ,gCAQD,SAAS,CAAU,CAAC,EAA8B,CACvD,IAAI,EAAK,EAAQ,OAAS,IAAM,EAAQ,KACxC,GAAI,EAAQ,UAAY,OACtB,GAAM,IAAM,EAAQ,QAEtB,OAAO,EAAW,CAAE,EASf,SAAS,CAAY,CAAC,EAAkC,CAC7D,IAAI,EAAe,EAAU,OAC7B,GAAI,EAAU,UAAY,OACxB,GAAQ,IAAM,EAAU,QAAQ,MAAM,EAAG,CAAC,EAAI,IAAM,EAAU,QAGhE,OADA,GAAQ,IAAI,EAAU,QAAQ,EAAU,QAAQ,EAAU,WAAa,EAAmB,OACnF,EAAW,CAAI",
8
+ "debugId": "A4578072432048EF64756E2164756E21",
9
+ "names": []
10
+ }
package/package.json CHANGED
@@ -1,31 +1,63 @@
1
1
  {
2
2
  "name": "@alwatr/nitrobase-helper",
3
+ "version": "9.1.0",
3
4
  "description": "Extremely fast and compact JSON-based database that operates in memory, includes a JSON file backup, and serve over the highly accelerated Nginx.",
4
- "version": "7.10.1",
5
- "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
- "bugs": "https://github.com/Alwatr/nitrobase/issues",
7
- "dependencies": {
8
- "@alwatr/flat-string": "^5.5.26",
9
- "@alwatr/logger": "^6.0.15",
10
- "@alwatr/nitrobase-types": "^7.10.1"
11
- },
12
- "devDependencies": {
13
- "@alwatr/nanolib": "^7.3.4",
14
- "@types/node": "^24.10.4",
15
- "typescript": "^5.9.3"
5
+ "license": "MPL-2.0",
6
+ "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
7
+ "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Alwatr/alwatr",
11
+ "directory": "pkg/nitrobase-old/helper"
16
12
  },
13
+ "homepage": "https://github.com/Alwatr/alwatr/tree/main/pkg/nitrobase-old/helper#readme",
14
+ "bugs": "https://github.com/Alwatr/alwatr/issues",
17
15
  "exports": {
18
16
  ".": {
19
17
  "types": "./dist/main.d.ts",
20
- "import": "./dist/main.mjs",
21
- "require": "./dist/main.cjs"
18
+ "import": "./dist/main.js",
19
+ "default": "./dist/main.js"
22
20
  }
23
21
  },
22
+ "sideEffects": false,
23
+ "dependencies": {
24
+ "@alwatr/flat-string": "9.1.0",
25
+ "@alwatr/logger": "9.1.0",
26
+ "@alwatr/nitrobase-types": "^9.1.0"
27
+ },
28
+ "devDependencies": {
29
+ "@alwatr/nano-build": "9.1.0",
30
+ "@alwatr/tsconfig-base": "9.1.0",
31
+ "@alwatr/type-helper": "9.1.0",
32
+ "@types/node": "^25.5.0",
33
+ "typescript": "^6.0.2"
34
+ },
35
+ "scripts": {
36
+ "b": "bun run build",
37
+ "build": "bun run build:ts && bun run build:es",
38
+ "build:es": "nano-build --preset=module src/main.ts",
39
+ "build:ts": "tsc --build",
40
+ "cl": "bun run clean",
41
+ "clean": "rm -rfv dist *.tsbuildinfo",
42
+ "format": "prettier --write \"src/**/*.ts\"",
43
+ "lint": "eslint src/ --ext .ts",
44
+ "t": "bun run test",
45
+ "test": "ALWATR_DEBUG=0 bun test",
46
+ "w": "bun run watch",
47
+ "watch": "bun run watch:ts & bun run watch:es",
48
+ "watch:es": "bun run build:es --watch",
49
+ "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
50
+ },
24
51
  "files": [
25
- "**/*.{js,mjs,cjs,map,d.ts,html,md}",
26
- "!demo/**/*"
52
+ "dist",
53
+ "src/**/*.ts",
54
+ "!src/**/*.test.ts",
55
+ "README.md",
56
+ "LICENSE"
27
57
  ],
28
- "homepage": "https://github.com/Alwatr/nitrobase#readme",
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
29
61
  "keywords": [
30
62
  "alwatr",
31
63
  "data",
@@ -39,34 +71,6 @@
39
71
  "storage",
40
72
  "typescript"
41
73
  ],
42
- "license": "MPL-2.0",
43
- "main": "./dist/main.cjs",
44
- "module": "./dist/main.mjs",
45
74
  "prettier": "@alwatr/nanolib/prettier-config",
46
- "publishConfig": {
47
- "access": "public"
48
- },
49
- "repository": {
50
- "type": "git",
51
- "url": "https://github.com/Alwatr/nitrobase",
52
- "directory": "packages/helper"
53
- },
54
- "scripts": {
55
- "b": "yarn run build",
56
- "build": "yarn run build:ts & yarn run build:es",
57
- "build:es": "nano-build --preset=module",
58
- "build:ts": "tsc --build",
59
- "c": "yarn run clean",
60
- "cb": "yarn run clean && yarn run build",
61
- "clean": "rm -rfv dist *.tsbuildinfo",
62
- "d": "yarn run build:es && yarn node",
63
- "w": "yarn run watch",
64
- "watch": "yarn run watch:ts & yarn run watch:es",
65
- "watch:es": "yarn run build:es --watch",
66
- "watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
67
- },
68
- "sideEffects": false,
69
- "type": "module",
70
- "types": "./dist/main.d.ts",
71
- "gitHead": "e23943a279d6b0905b205c0c17b2b3249efab226"
75
+ "gitHead": "4a25cd3e0499cf61dd761e87d3711abf9b0cd208"
72
76
  }
package/src/main.ts ADDED
@@ -0,0 +1,31 @@
1
+ import {flatString} from '@alwatr/flat-string';
2
+ import {StoreFileExtension, type StoreFileId, type StoreFileStat} from '@alwatr/nitrobase-types';
3
+
4
+ /**
5
+ * Convert StoreFileId to a string ID.
6
+ *
7
+ * @param storeId - The StoreFileId.
8
+ * @returns The nitrobase ID as a string.
9
+ */
10
+ export function getStoreId(storeId: StoreFileId): string {
11
+ let id = storeId.region + '/' + storeId.name;
12
+ if (storeId.ownerId !== undefined) {
13
+ id += '/' + storeId.ownerId;
14
+ }
15
+ return flatString(id);
16
+ }
17
+
18
+ /**
19
+ * Returns the nitrobase path based on the provided storeStat object.
20
+ *
21
+ * @param storeStat The nitrobase file stat object.
22
+ * @returns The nitrobase path.
23
+ */
24
+ export function getStorePath(storeStat: StoreFileStat): string {
25
+ let path: string = storeStat.region;
26
+ if (storeStat.ownerId !== undefined) {
27
+ path += '/' + storeStat.ownerId.slice(0, 3) + '/' + storeStat.ownerId;
28
+ }
29
+ path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? StoreFileExtension.Json}`;
30
+ return flatString(path);
31
+ }
package/CHANGELOG.md DELETED
@@ -1,159 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [7.10.1](https://github.com/Alwatr/nitrobase/compare/v7.10.0...v7.10.1) (2025-12-14)
7
-
8
- ### 🧹 Miscellaneous Chores
9
-
10
- * update tsconfig extends to use @alwatr/nanolib ([ffbc8ce](https://github.com/Alwatr/nitrobase/commit/ffbc8ce74d47d7f4e1ff0061722df10f68af11cc))
11
-
12
- ### 🔗 Dependencies update
13
-
14
- * update `@alwatr/nanolib` and `@types/node` dependencies across all packages. ([bc6d96f](https://github.com/Alwatr/nitrobase/commit/bc6d96f4fd423bcfb817d74b526596669d8a8aed))
15
- * update dependencies and switch prettier config to @alwatr/nanolib ([e826de4](https://github.com/Alwatr/nitrobase/commit/e826de494a2fb03125edad10930fac819e23c801))
16
-
17
- ## [7.10.0](https://github.com/Alwatr/nitrobase/compare/v7.9.0...v7.10.0) (2025-09-21)
18
-
19
- ### 🐛 Bug Fixes
20
-
21
- * add "sideEffects": false to package.json files for better tree-shaking ([cb6f75b](https://github.com/Alwatr/nitrobase/commit/cb6f75b86eb7dba6812aaad5136fcd867e885562))
22
-
23
- ### 🧹 Miscellaneous Chores
24
-
25
- * remove Exir Studio sponsorship logo from multiple README files ([506459f](https://github.com/Alwatr/nitrobase/commit/506459fea7d29b97e478da562590dd202ce7e833))
26
- * remove unused types from tsconfig.json files and update references ([b504ced](https://github.com/Alwatr/nitrobase/commit/b504ced4a8f98de4fe79a2c974937278bd4e46cb))
27
- * Update license from AGPL-3.0 to MPL-2.0 ([af1746e](https://github.com/Alwatr/nitrobase/commit/af1746ee9a3786c1cb2e0014f138e9f3b7086b8d))
28
- * update package.json files across all packages for consistency and improved metadata ([647900d](https://github.com/Alwatr/nitrobase/commit/647900d9966f8df275c4e2ef0550c501be38ece0))
29
-
30
- ### 🔗 Dependencies update
31
-
32
- * add missing dependencies for flat-string and logger ([1ee8b82](https://github.com/Alwatr/nitrobase/commit/1ee8b821864115b922a654e23984ff2f537e73d4))
33
- * remove unused packageTracer import from main.ts ([ad4e1de](https://github.com/Alwatr/nitrobase/commit/ad4e1def8502bbafb0d6496edd3c44c414041591))
34
- * update dependencies in package.json files across all packages to latest versions ([72c20ef](https://github.com/Alwatr/nitrobase/commit/72c20efbc1cac9825fb4880772e3fad797d74a23))
35
-
36
- ## [7.8.0](https://github.com/Alwatr/nitrobase/compare/v7.7.0...v7.8.0) (2025-03-06)
37
-
38
- ### Dependencies update
39
-
40
- * **deps-dev:** bump the dependencies group across 1 directory with 5 updates ([fe6ab37](https://github.com/Alwatr/nitrobase/commit/fe6ab37263f609f8bce8398462b7105b8e5a55fe)) by @dependabot[bot]
41
- * update @alwatr/nanolib, @alwatr/nano-build, and @alwatr/type-helper to latest versions ([5f3f89b](https://github.com/Alwatr/nitrobase/commit/5f3f89b1236f66e9167957d60d43c8d0abff108d)) by @
42
-
43
- ## [7.7.0](https://github.com/Alwatr/nitrobase/compare/v7.6.1...v7.7.0) (2025-02-26)
44
-
45
- **Note:** Version bump only for package @alwatr/nitrobase-helper
46
-
47
- ## [7.6.0](https://github.com/Alwatr/nitrobase/compare/v7.5.9...v7.6.0) (2025-02-26)
48
-
49
- ### Miscellaneous Chores
50
-
51
- * rollback all versions ([9ff6c11](https://github.com/Alwatr/nitrobase/commit/9ff6c11ef3e44ea669a814da73ed39ddc2c8e971)) by @alimd
52
-
53
- ## [7.5.8](https://github.com/Alwatr/nitrobase/compare/v7.5.7...v7.5.8) (2025-02-18)
54
-
55
- ### Dependencies update
56
-
57
- * bump @alwatr/nanolib, @alwatr/nano-build, and @types/node to latest versions across multiple packages ([3e89c62](https://github.com/Alwatr/nitrobase/commit/3e89c62ad20f3afe0c38c6ae36d91bcb6199b231)) by @
58
- * **deps-dev:** bump the dependencies group across 1 directory with 2 updates ([03715d0](https://github.com/Alwatr/nitrobase/commit/03715d0b5534b127dfb57ffe0ea713fb168eefe6)) by @dependabot[bot]
59
-
60
- ## [7.5.7](https://github.com/Alwatr/nitrobase/compare/v7.5.6...v7.5.7) (2025-02-03)
61
-
62
- ### Dependencies update
63
-
64
- * update [@alwatr](https://github.com/alwatr) dependencies to latest versions ([f8bb10f](https://github.com/Alwatr/nitrobase/commit/f8bb10fa3343f25e2a442e80fbddb88c55fac813)) by @
65
-
66
- ## [7.5.5](https://github.com/Alwatr/nitrobase/compare/v7.5.4...v7.5.5) (2025-02-02)
67
-
68
- ### Dependencies update
69
-
70
- * **deps-dev:** bump @types/node ([d60ee96](https://github.com/Alwatr/nitrobase/commit/d60ee96716b8df7837b3d7f9fe4b8705c94e5af0)) by @dependabot[bot]
71
- * update ([0b9eccd](https://github.com/Alwatr/nitrobase/commit/0b9eccd3b54dade17e3eeb94bd08612c57356801)) by @alimd
72
-
73
- ## [7.5.4](https://github.com/Alwatr/nitrobase/compare/v7.5.3...v7.5.4) (2025-01-12)
74
-
75
- ### Dependencies update
76
-
77
- * **deps-dev:** bump the dependencies group across 1 directory with 11 updates ([fdd30a6](https://github.com/Alwatr/nitrobase/commit/fdd30a6639ae7ead4e8dbfaca0295cb2bf0e6649)) by @dependabot[bot]
78
-
79
- ## [7.5.0](https://github.com/Alwatr/nitrobase/compare/v7.4.1...v7.5.0) (2024-11-09)
80
-
81
- **Note:** Version bump only for package @alwatr/nitrobase-helper
82
-
83
- ## [7.4.0](https://github.com/Alwatr/nitrobase/compare/v7.3.1...v7.4.0) (2024-11-08)
84
-
85
- ### Dependencies update
86
-
87
- * bump @alwatr/nanolib from 5.2.0 to 5.2.1 across multiple packages ([e1f87b0](https://github.com/Alwatr/nitrobase/commit/e1f87b07d33e8227440256a70f012aa63410f153)) by @
88
- * **deps-dev:** bump @types/node in the dependencies group ([67ffbad](https://github.com/Alwatr/nitrobase/commit/67ffbad06c95c304d47acbe46fd137fb4cf69f95)) by @dependabot[bot]
89
- * **deps:** bump @alwatr/nanolib from 5.0.0 to 5.2.0 in the alwatr group ([dfa1eef](https://github.com/Alwatr/nitrobase/commit/dfa1eefb191bbaac2ff2fff410bb1d3ec615d959)) by @dependabot[bot]
90
-
91
- ## [7.3.1](https://github.com/Alwatr/nitrobase/compare/v7.3.0...v7.3.1) (2024-11-02)
92
-
93
- ### Miscellaneous Chores
94
-
95
- * **deps-dev:** bump the development-dependencies group with 8 updates ([63f7adc](https://github.com/Alwatr/nitrobase/commit/63f7adc5ff83d4876f34d4f089a4be9b95b711a6)) by @dependabot[bot]
96
- * **deps:** bump the alwatr-dependencies group with 2 updates ([20fb436](https://github.com/Alwatr/nitrobase/commit/20fb436b9f146d5ec7452a693c7af8faa32bedff)) by @dependabot[bot]
97
-
98
- ### Dependencies update
99
-
100
- * **deps-dev:** bump @types/node in the dependencies group ([dd3e94a](https://github.com/Alwatr/nitrobase/commit/dd3e94a4c007da8fddda4cfeffe5f0763d74952e)) by @dependabot[bot]
101
- * **deps:** bump the alwatr group with 6 updates ([eb9eeb1](https://github.com/Alwatr/nitrobase/commit/eb9eeb1901f7947cde783bf6f06340c984d6f59d)) by @dependabot[bot]
102
-
103
- ## [7.3.0](https://github.com/Alwatr/nitrobase/compare/v7.2.1...v7.3.0) (2024-10-11)
104
-
105
- ### Features
106
-
107
- * update `import`s & packages based on the latest changes of `nanolib` & prevent side-effects ([0d66f89](https://github.com/Alwatr/nitrobase/commit/0d66f894dc4ff615ab73ebd27c275f98dc384fbe)) by @mohammadhonarvar
108
-
109
- ### Bug Fixes
110
-
111
- * **helper:** Update dependencies and packages for @alwatr/type-helper ([b57a97d](https://github.com/Alwatr/nitrobase/commit/b57a97da61af4217b6a0aeaa82190fbc132f61b7)) by @AliMD
112
-
113
- ### Code Refactoring
114
-
115
- * update `import`s & packages based on the latest changes of `nanolib` ([ce990a2](https://github.com/Alwatr/nitrobase/commit/ce990a2fedc5545e971c3bb6e58b55bfba8c0bd9)) by @mohammadhonarvar
116
-
117
- ### Miscellaneous Chores
118
-
119
- * **deps-dev:** bump the development-dependencies group with 10 updates ([7bdcf3f](https://github.com/Alwatr/nitrobase/commit/7bdcf3f47ddb8e1376a1c7ae6e221811182bae58)) by @dependabot[bot]
120
- * **deps:** bump the alwatr-dependencies group with 10 updates ([60afdde](https://github.com/Alwatr/nitrobase/commit/60afdde98562f3023e6624ee0579d6bdee80bc32)) by @dependabot[bot]
121
- * **deps:** bump the alwatr-dependencies group with 6 updates ([1cf29b2](https://github.com/Alwatr/nitrobase/commit/1cf29b20055554945cd669ea9d022ab7c503d9fc)) by @dependabot[bot]
122
-
123
- ### Dependencies update
124
-
125
- * cleanup dependencies ([91eab0b](https://github.com/Alwatr/nitrobase/commit/91eab0b0fc570b2493cccd5ccd891b01405450d7)) by @AliMD
126
-
127
- ## [7.2.1](https://github.com/Alwatr/nitrobase/compare/v7.2.0...v7.2.1) (2024-09-29)
128
-
129
- ### Miscellaneous Chores
130
-
131
- * **deps-dev:** bump @types/node in the development-dependencies group ([9b146d2](https://github.com/Alwatr/nitrobase/commit/9b146d2f6cf7d1d79a2a6f46a5e8f50e7fb2ac75)) by @dependabot[bot]
132
- * **helper:** change the license to AGPL-3.0 ([1fe19df](https://github.com/Alwatr/nitrobase/commit/1fe19dfdb234bf4510c1e62453beccb767d373e5)) by @ArmanAsadian
133
-
134
- ### Dependencies update
135
-
136
- * update ([90a0fe1](https://github.com/Alwatr/nitrobase/commit/90a0fe146eb703c183c116776d7c5748918282da)) by @
137
-
138
- ## [7.2.0](https://github.com/Alwatr/nitrobase/compare/v7.1.1...v7.2.0) (2024-09-24)
139
-
140
- ### Code Refactoring
141
-
142
- * rename all store to nitrobase ([9e31765](https://github.com/Alwatr/nitrobase/commit/9e31765b63ecd94bcf600cb44cfd9e341dd11a4e)) by @AliMD
143
-
144
- ## [7.1.1](https://github.com/Alwatr/nitrobase/compare/v7.1.0...v7.1.1) (2024-09-24)
145
-
146
- ### Miscellaneous Chores
147
-
148
- * **deps-dev:** bump the development-dependencies group across 1 directory with 3 updates ([122251c](https://github.com/Alwatr/nitrobase/commit/122251c315c422b7e9c2d5aba827f27b321194bb)) by @dependabot[bot]
149
- * **deps:** bump the alwatr-dependencies group with 9 updates ([2a94694](https://github.com/Alwatr/nitrobase/commit/2a94694b2ec12c2915aa77934023328751d13837)) by @dependabot[bot]
150
-
151
- ### Dependencies update
152
-
153
- * update ([82c475e](https://github.com/Alwatr/nitrobase/commit/82c475e29bd7f42ad03660556f40f180b3b6c9c6)) by @AliMD
154
-
155
- ## [7.1.0](https://github.com/Alwatr/nitrobase/compare/v7.0.0...v7.1.0) (2024-09-08)
156
-
157
- ### Features
158
-
159
- * **helper:** add @alwatr/nitrobase-helper package ([158377c](https://github.com/Alwatr/nitrobase/commit/158377c69a2fe9ead17fa8160f95298fbbae19ec)) by @AliMD
package/dist/main.cjs DELETED
@@ -1,4 +0,0 @@
1
- /** 📦 @alwatr/nitrobase-helper v7.10.1 */
2
- __dev_mode__: console.debug("📦 @alwatr/nitrobase-helper v7.10.1");
3
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{getStoreId:()=>getStoreId,getStorePath:()=>getStorePath});module.exports=__toCommonJS(main_exports);var import_flat_string=require("@alwatr/flat-string");var import_nitrobase_types=require("@alwatr/nitrobase-types");function getStoreId(storeId){let id=storeId.region+"/"+storeId.name;if(storeId.ownerId!==void 0){id+="/"+storeId.ownerId}return(0,import_flat_string.flatString)(id)}function getStorePath(storeStat){let path=storeStat.region;if(storeStat.ownerId!==void 0){path+="/"+storeStat.ownerId.slice(0,3)+"/"+storeStat.ownerId}path+=`/${storeStat.name}.${storeStat.type}.${storeStat.extension??import_nitrobase_types.StoreFileExtension.Json}`;return(0,import_flat_string.flatString)(path)}0&&(module.exports={getStoreId,getStorePath});
4
- //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {flatString} from '@alwatr/flat-string';\nimport {StoreFileExtension, type StoreFileId, type StoreFileStat} from '@alwatr/nitrobase-types';\n\n/**\n * Convert StoreFileId to a string ID.\n *\n * @param storeId - The StoreFileId.\n * @returns The nitrobase ID as a string.\n */\nexport function getStoreId(storeId: StoreFileId): string {\n let id = storeId.region + '/' + storeId.name;\n if (storeId.ownerId !== undefined) {\n id += '/' + storeId.ownerId;\n }\n return flatString(id);\n}\n\n/**\n * Returns the nitrobase path based on the provided storeStat object.\n *\n * @param storeStat The nitrobase file stat object.\n * @returns The nitrobase path.\n */\nexport function getStorePath(storeStat: StoreFileStat): string {\n let path: string = storeStat.region;\n if (storeStat.ownerId !== undefined) {\n path += '/' + storeStat.ownerId.slice(0, 3) + '/' + storeStat.ownerId;\n }\n path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? StoreFileExtension.Json}`;\n return flatString(path);\n}\n"],
5
- "mappings": ";;qqBAAA,sKAAyB,+BACzB,2BAAuE,mCAQhE,SAAS,WAAW,QAA8B,CACvD,IAAI,GAAK,QAAQ,OAAS,IAAM,QAAQ,KACxC,GAAI,QAAQ,UAAY,OAAW,CACjC,IAAM,IAAM,QAAQ,OACtB,CACA,SAAO,+BAAW,EAAE,CACtB,CAQO,SAAS,aAAa,UAAkC,CAC7D,IAAI,KAAe,UAAU,OAC7B,GAAI,UAAU,UAAY,OAAW,CACnC,MAAQ,IAAM,UAAU,QAAQ,MAAM,EAAG,CAAC,EAAI,IAAM,UAAU,OAChE,CACA,MAAQ,IAAI,UAAU,IAAI,IAAI,UAAU,IAAI,IAAI,UAAU,WAAa,0CAAmB,IAAI,GAC9F,SAAO,+BAAW,IAAI,CACxB",
6
- "names": []
7
- }
package/dist/main.mjs DELETED
@@ -1,4 +0,0 @@
1
- /** 📦 @alwatr/nitrobase-helper v7.10.1 */
2
- __dev_mode__: console.debug("📦 @alwatr/nitrobase-helper v7.10.1");
3
- import{flatString}from"@alwatr/flat-string";import{StoreFileExtension}from"@alwatr/nitrobase-types";function getStoreId(storeId){let id=storeId.region+"/"+storeId.name;if(storeId.ownerId!==void 0){id+="/"+storeId.ownerId}return flatString(id)}function getStorePath(storeStat){let path=storeStat.region;if(storeStat.ownerId!==void 0){path+="/"+storeStat.ownerId.slice(0,3)+"/"+storeStat.ownerId}path+=`/${storeStat.name}.${storeStat.type}.${storeStat.extension??StoreFileExtension.Json}`;return flatString(path)}export{getStoreId,getStorePath};
4
- //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {flatString} from '@alwatr/flat-string';\nimport {StoreFileExtension, type StoreFileId, type StoreFileStat} from '@alwatr/nitrobase-types';\n\n/**\n * Convert StoreFileId to a string ID.\n *\n * @param storeId - The StoreFileId.\n * @returns The nitrobase ID as a string.\n */\nexport function getStoreId(storeId: StoreFileId): string {\n let id = storeId.region + '/' + storeId.name;\n if (storeId.ownerId !== undefined) {\n id += '/' + storeId.ownerId;\n }\n return flatString(id);\n}\n\n/**\n * Returns the nitrobase path based on the provided storeStat object.\n *\n * @param storeStat The nitrobase file stat object.\n * @returns The nitrobase path.\n */\nexport function getStorePath(storeStat: StoreFileStat): string {\n let path: string = storeStat.region;\n if (storeStat.ownerId !== undefined) {\n path += '/' + storeStat.ownerId.slice(0, 3) + '/' + storeStat.ownerId;\n }\n path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? StoreFileExtension.Json}`;\n return flatString(path);\n}\n"],
5
- "mappings": ";;AAAA,OAAQ,eAAiB,sBACzB,OAAQ,uBAA+D,0BAQhE,SAAS,WAAW,QAA8B,CACvD,IAAI,GAAK,QAAQ,OAAS,IAAM,QAAQ,KACxC,GAAI,QAAQ,UAAY,OAAW,CACjC,IAAM,IAAM,QAAQ,OACtB,CACA,OAAO,WAAW,EAAE,CACtB,CAQO,SAAS,aAAa,UAAkC,CAC7D,IAAI,KAAe,UAAU,OAC7B,GAAI,UAAU,UAAY,OAAW,CACnC,MAAQ,IAAM,UAAU,QAAQ,MAAM,EAAG,CAAC,EAAI,IAAM,UAAU,OAChE,CACA,MAAQ,IAAI,UAAU,IAAI,IAAI,UAAU,IAAI,IAAI,UAAU,WAAa,mBAAmB,IAAI,GAC9F,OAAO,WAAW,IAAI,CACxB",
6
- "names": []
7
- }