inibase 1.0.0-rc.47 → 1.0.0-rc.48
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/file.js +1 -17
- package/dist/index.js +0 -3
- package/package.json +1 -1
package/dist/file.js
CHANGED
|
@@ -99,13 +99,6 @@ const secureString = (input) => {
|
|
|
99
99
|
// Replace characters using a single regular expression.
|
|
100
100
|
return decodedInput.replace(/\\n/g, "\n").replace(/\n/g, "\\n");
|
|
101
101
|
};
|
|
102
|
-
/**
|
|
103
|
-
* Secures each element in an array or a single value using secureString.
|
|
104
|
-
*
|
|
105
|
-
* @param arr_str - An array or a single value of any type.
|
|
106
|
-
* @returns An array with each element secured, or a single secured value.
|
|
107
|
-
*/
|
|
108
|
-
const secureArray = (arr_str) => Array.isArray(arr_str) ? arr_str.map(secureArray) : secureString(arr_str);
|
|
109
102
|
/**
|
|
110
103
|
* Encodes the input using 'secureString' and 'Inison.stringify' functions.
|
|
111
104
|
* If the input is an array, it is first secured and then joined into a string.
|
|
@@ -114,16 +107,7 @@ const secureArray = (arr_str) => Array.isArray(arr_str) ? arr_str.map(secureArra
|
|
|
114
107
|
* @param input - A value or array of values (string, number, boolean, null).
|
|
115
108
|
* @returns The secured and/or joined string.
|
|
116
109
|
*/
|
|
117
|
-
export const encode = (input) => Array.isArray(input)
|
|
118
|
-
? Inison.stringify(secureArray(input))
|
|
119
|
-
: secureString(input);
|
|
120
|
-
/**
|
|
121
|
-
* Decodes each element in an array or a single value using unSecureString.
|
|
122
|
-
*
|
|
123
|
-
* @param arr_str - An array or a single value of any type.
|
|
124
|
-
* @returns An array with each element decoded, or a single decoded value.
|
|
125
|
-
*/
|
|
126
|
-
const unSecureArray = (arr_str) => Array.isArray(arr_str) ? arr_str.map(unSecureArray) : unSecureString(arr_str);
|
|
110
|
+
export const encode = (input) => Array.isArray(input) ? Inison.stringify(input) : secureString(input);
|
|
127
111
|
/**
|
|
128
112
|
* Reverses the encoding done by 'secureString'. Replaces encoded characters with their original symbols.
|
|
129
113
|
*
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import Utils from "./utils.js";
|
|
|
8
8
|
import UtilsServer from "./utils.server.js";
|
|
9
9
|
import Config from "./config.js";
|
|
10
10
|
import { inspect } from "node:util";
|
|
11
|
-
import Inison from "inison";
|
|
12
11
|
export default class Inibase {
|
|
13
12
|
folder;
|
|
14
13
|
database;
|
|
@@ -262,8 +261,6 @@ export default class Inibase {
|
|
|
262
261
|
return Utils.isNumber(value)
|
|
263
262
|
? value
|
|
264
263
|
: UtilsServer.decodeID(value, this.salt);
|
|
265
|
-
case "json":
|
|
266
|
-
return Inison.stringify(value);
|
|
267
264
|
default:
|
|
268
265
|
return value;
|
|
269
266
|
}
|