@alwatr/nitrobase-helper 7.8.0 → 7.10.1
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/CHANGELOG.md +30 -0
- package/LICENSE +373 -661
- package/README.md +0 -6
- package/dist/main.cjs +3 -50
- package/dist/main.cjs.map +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.mjs +3 -25
- package/dist/main.mjs.map +2 -2
- package/package.json +40 -43
package/README.md
CHANGED
|
@@ -78,12 +78,6 @@ Explore the provided demo code (`collection.mjs`, `document.mjs`, `benchmark.mjs
|
|
|
78
78
|
|
|
79
79
|
The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
|
|
80
80
|
|
|
81
|
-
[](https://exirstudio.com)
|
|
82
|
-
|
|
83
81
|
### Contributing
|
|
84
82
|
|
|
85
83
|
Contributions are welcome! Please read our [contribution guidelines](https://github.com/Alwatr/.github/blob/next/CONTRIBUTING.md) before submitting a pull request.
|
|
86
|
-
|
|
87
|
-
### License
|
|
88
|
-
|
|
89
|
-
This project is licensed under the [AGPL-3.0 License](LICENSE).
|
package/dist/main.cjs
CHANGED
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
"
|
|
3
|
-
var __defProp = Object.
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/main.ts
|
|
22
|
-
var main_exports = {};
|
|
23
|
-
__export(main_exports, {
|
|
24
|
-
getStoreId: () => getStoreId,
|
|
25
|
-
getStorePath: () => getStorePath
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(main_exports);
|
|
28
|
-
var import_nanolib = require("@alwatr/nanolib");
|
|
29
|
-
var import_nitrobase_types = require("@alwatr/nitrobase-types");
|
|
30
|
-
__dev_mode__: import_nanolib.packageTracer.add("@alwatr/nitrobase-helper", "7.8.0");
|
|
31
|
-
function getStoreId(storeId) {
|
|
32
|
-
let id = storeId.region + "/" + storeId.name;
|
|
33
|
-
if (storeId.ownerId !== void 0) {
|
|
34
|
-
id += "/" + storeId.ownerId;
|
|
35
|
-
}
|
|
36
|
-
return (0, import_nanolib.flatString)(id);
|
|
37
|
-
}
|
|
38
|
-
function getStorePath(storeStat) {
|
|
39
|
-
let path = storeStat.region;
|
|
40
|
-
if (storeStat.ownerId !== void 0) {
|
|
41
|
-
path += "/" + storeStat.ownerId.slice(0, 3) + "/" + storeStat.ownerId;
|
|
42
|
-
}
|
|
43
|
-
path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? import_nitrobase_types.StoreFileExtension.Json}`;
|
|
44
|
-
return (0, import_nanolib.flatString)(path);
|
|
45
|
-
}
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
getStoreId,
|
|
49
|
-
getStorePath
|
|
50
|
-
});
|
|
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});
|
|
51
4
|
//# sourceMappingURL=main.cjs.map
|
package/dist/main.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/main.ts"],
|
|
4
|
-
"sourcesContent": ["import {flatString
|
|
5
|
-
"mappings": "
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,WAAW,EAAE,KAAK,aAAa,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,WAAW,EAAE,KAAK,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEjG;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAO7D"}
|
package/dist/main.mjs
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { flatString, packageTracer } from "@alwatr/nanolib";
|
|
5
|
-
import { StoreFileExtension } from "@alwatr/nitrobase-types";
|
|
6
|
-
__dev_mode__: packageTracer.add("@alwatr/nitrobase-helper", "7.8.0");
|
|
7
|
-
function getStoreId(storeId) {
|
|
8
|
-
let id = storeId.region + "/" + storeId.name;
|
|
9
|
-
if (storeId.ownerId !== void 0) {
|
|
10
|
-
id += "/" + storeId.ownerId;
|
|
11
|
-
}
|
|
12
|
-
return flatString(id);
|
|
13
|
-
}
|
|
14
|
-
function getStorePath(storeStat) {
|
|
15
|
-
let path = storeStat.region;
|
|
16
|
-
if (storeStat.ownerId !== void 0) {
|
|
17
|
-
path += "/" + storeStat.ownerId.slice(0, 3) + "/" + storeStat.ownerId;
|
|
18
|
-
}
|
|
19
|
-
path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? StoreFileExtension.Json}`;
|
|
20
|
-
return flatString(path);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
getStoreId,
|
|
24
|
-
getStorePath
|
|
25
|
-
};
|
|
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};
|
|
26
4
|
//# sourceMappingURL=main.mjs.map
|
package/dist/main.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/main.ts"],
|
|
4
|
-
"sourcesContent": ["import {flatString
|
|
5
|
-
"mappings": "
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/nitrobase-helper",
|
|
3
|
-
"version": "7.8.0",
|
|
4
3
|
"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
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"typescript"
|
|
16
|
-
|
|
17
|
-
"alwatr"
|
|
18
|
-
],
|
|
19
|
-
"type": "module",
|
|
20
|
-
"main": "./dist/main.cjs",
|
|
21
|
-
"module": "./dist/main.mjs",
|
|
22
|
-
"types": "./dist/main.d.ts",
|
|
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"
|
|
16
|
+
},
|
|
23
17
|
"exports": {
|
|
24
18
|
".": {
|
|
25
19
|
"types": "./dist/main.d.ts",
|
|
@@ -27,11 +21,28 @@
|
|
|
27
21
|
"require": "./dist/main.cjs"
|
|
28
22
|
}
|
|
29
23
|
},
|
|
30
|
-
"license": "AGPL-3.0-only",
|
|
31
24
|
"files": [
|
|
32
25
|
"**/*.{js,mjs,cjs,map,d.ts,html,md}",
|
|
33
26
|
"!demo/**/*"
|
|
34
27
|
],
|
|
28
|
+
"homepage": "https://github.com/Alwatr/nitrobase#readme",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"alwatr",
|
|
31
|
+
"data",
|
|
32
|
+
"data-storage",
|
|
33
|
+
"database",
|
|
34
|
+
"esm",
|
|
35
|
+
"file",
|
|
36
|
+
"json",
|
|
37
|
+
"no-sql",
|
|
38
|
+
"nosql",
|
|
39
|
+
"storage",
|
|
40
|
+
"typescript"
|
|
41
|
+
],
|
|
42
|
+
"license": "MPL-2.0",
|
|
43
|
+
"main": "./dist/main.cjs",
|
|
44
|
+
"module": "./dist/main.mjs",
|
|
45
|
+
"prettier": "@alwatr/nanolib/prettier-config",
|
|
35
46
|
"publishConfig": {
|
|
36
47
|
"access": "public"
|
|
37
48
|
},
|
|
@@ -40,36 +51,22 @@
|
|
|
40
51
|
"url": "https://github.com/Alwatr/nitrobase",
|
|
41
52
|
"directory": "packages/helper"
|
|
42
53
|
},
|
|
43
|
-
"homepage": "https://github.com/Alwatr/nitrobase#readme",
|
|
44
|
-
"bugs": {
|
|
45
|
-
"url": "https://github.com/Alwatr/nitrobase/issues"
|
|
46
|
-
},
|
|
47
|
-
"prettier": "@alwatr/prettier-config",
|
|
48
54
|
"scripts": {
|
|
49
55
|
"b": "yarn run build",
|
|
50
|
-
"w": "yarn run watch",
|
|
51
|
-
"c": "yarn run clean",
|
|
52
|
-
"cb": "yarn run clean && yarn run build",
|
|
53
|
-
"d": "yarn run build:es && yarn node",
|
|
54
56
|
"build": "yarn run build:ts & yarn run build:es",
|
|
55
57
|
"build:es": "nano-build --preset=module",
|
|
56
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",
|
|
57
64
|
"watch": "yarn run watch:ts & yarn run watch:es",
|
|
58
65
|
"watch:es": "yarn run build:es --watch",
|
|
59
|
-
"watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
|
|
60
|
-
"clean": "rm -rfv dist *.tsbuildinfo"
|
|
66
|
+
"watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
|
|
61
67
|
},
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"devDependencies": {
|
|
67
|
-
"@alwatr/nano-build": "^5.5.0",
|
|
68
|
-
"@alwatr/prettier-config": "^5.0.0",
|
|
69
|
-
"@alwatr/tsconfig-base": "^5.0.0",
|
|
70
|
-
"@alwatr/type-helper": "^5.4.0",
|
|
71
|
-
"@types/node": "^22.13.9",
|
|
72
|
-
"typescript": "^5.8.2"
|
|
73
|
-
},
|
|
74
|
-
"gitHead": "fc40e664a2fe93d060fdbed6a05377043bbdc890"
|
|
68
|
+
"sideEffects": false,
|
|
69
|
+
"type": "module",
|
|
70
|
+
"types": "./dist/main.d.ts",
|
|
71
|
+
"gitHead": "e23943a279d6b0905b205c0c17b2b3249efab226"
|
|
75
72
|
}
|