inibase 1.2.18 → 1.2.20
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.d.ts +3 -2
- package/dist/index.js +14 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -51,7 +51,8 @@ declare global {
|
|
|
51
51
|
entries<T extends object>(o: T): Entries<T>;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export declare const ERROR_CODES: readonly ["GROUP_UNIQUE", "FIELD_UNIQUE", "FIELD_REQUIRED", "NO_SCHEMA", "TABLE_EMPTY", "INVALID_ID", "INVALID_TYPE", "INVALID_PARAMETERS", "NO_ENV", "TABLE_EXISTS", "TABLE_NOT_EXISTS", "INVALID_REGEX_MATCH"];
|
|
55
|
+
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
55
56
|
export type ErrorLang = "en" | "ar" | "fr" | "es";
|
|
56
57
|
export declare const globalConfig: {
|
|
57
58
|
[database: string]: {
|
|
@@ -71,7 +72,7 @@ export default class Inibase {
|
|
|
71
72
|
totalItems: Map<string, number>;
|
|
72
73
|
constructor(database: string, mainFolder?: string, language?: ErrorLang);
|
|
73
74
|
private static errorMessages;
|
|
74
|
-
createError(name:
|
|
75
|
+
createError(name: ErrorCode, variable?: string | number | (string | number)[]): Error;
|
|
75
76
|
private getFileExtension;
|
|
76
77
|
private _schemaToIdsPath;
|
|
77
78
|
/**
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,20 @@ import Inison from "inison";
|
|
|
8
8
|
import * as File from "./file.js";
|
|
9
9
|
import * as Utils from "./utils.js";
|
|
10
10
|
import * as UtilsServer from "./utils.server.js";
|
|
11
|
+
export const ERROR_CODES = [
|
|
12
|
+
"GROUP_UNIQUE",
|
|
13
|
+
"FIELD_UNIQUE",
|
|
14
|
+
"FIELD_REQUIRED",
|
|
15
|
+
"NO_SCHEMA",
|
|
16
|
+
"TABLE_EMPTY",
|
|
17
|
+
"INVALID_ID",
|
|
18
|
+
"INVALID_TYPE",
|
|
19
|
+
"INVALID_PARAMETERS",
|
|
20
|
+
"NO_ENV",
|
|
21
|
+
"TABLE_EXISTS",
|
|
22
|
+
"TABLE_NOT_EXISTS",
|
|
23
|
+
"INVALID_REGEX_MATCH",
|
|
24
|
+
];
|
|
11
25
|
// hide ExperimentalWarning glob()
|
|
12
26
|
process.removeAllListeners("warning");
|
|
13
27
|
export const globalConfig = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inibase",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Karim Amahtil",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"dotenv": "^16.5.0",
|
|
81
81
|
"inison": "^2.0.1",
|
|
82
|
-
"re2": "^1.
|
|
82
|
+
"re2": "^1.22.1"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"prepublish": "tsc",
|