melperjs 17.1.1 → 17.2.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/README.md +5 -0
- package/dist/general.cjs +425 -43
- package/dist/general.mjs +72 -62
- package/dist/node.cjs +10 -9
- package/dist/node.mjs +4 -4
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/docs/general.md +8 -0
- package/package.json +5 -22
- package/dist/general-C6nIgKnW.cjs +0 -651
package/dist/node.mjs
CHANGED
|
@@ -103,6 +103,10 @@ function writeJsonFileSync(filePath, data) {
|
|
|
103
103
|
const jsonData = JSON.stringify(data);
|
|
104
104
|
return fs.writeFileSync(filePath, jsonData, "utf8");
|
|
105
105
|
}
|
|
106
|
+
function createNumberedDirs(mainDirectory, start = 0, end = 9) {
|
|
107
|
+
fs.mkdirSync(mainDirectory, { recursive: true });
|
|
108
|
+
for (let i = start; i <= end; i++) fs.mkdirSync(path.join(mainDirectory, `${i}`), { recursive: true });
|
|
109
|
+
}
|
|
106
110
|
async function clearDirectory(directoryPath, keepDir = true) {
|
|
107
111
|
await promises.rm(directoryPath, {
|
|
108
112
|
recursive: true,
|
|
@@ -110,10 +114,6 @@ async function clearDirectory(directoryPath, keepDir = true) {
|
|
|
110
114
|
});
|
|
111
115
|
if (keepDir) await promises.mkdir(directoryPath, { recursive: true });
|
|
112
116
|
}
|
|
113
|
-
function createNumberedDirs(mainDirectory, start = 0, end = 9) {
|
|
114
|
-
fs.mkdirSync(mainDirectory, { recursive: true });
|
|
115
|
-
for (let i = start; i <= end; i++) fs.mkdirSync(path.join(mainDirectory, `${i}`), { recursive: true });
|
|
116
|
-
}
|
|
117
117
|
async function executeCommand(command) {
|
|
118
118
|
const { stdout } = await execAsync(command);
|
|
119
119
|
return stdout.trim();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
Object.defineProperty(exports, "__toESM", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return __toESM;
|
|
27
|
+
}
|
|
28
|
+
});
|
package/docs/general.md
CHANGED
|
@@ -129,6 +129,14 @@ Capitalizes the first letter of each word delimited by `separator`. Other charac
|
|
|
129
129
|
- `separator` (String): Word boundary. Defaults to a single space.
|
|
130
130
|
- **Returns:** Title-cased string.
|
|
131
131
|
|
|
132
|
+
### castString(value)
|
|
133
|
+
|
|
134
|
+
Coerces any value to a string. `null` / `undefined` become `""`; strings are returned as-is; objects and arrays are serialized with `JSON.stringify` (falling back to `"{}"` if serialization throws); all other primitives go through `String()`. Pure — returns a new value, never mutates.
|
|
135
|
+
|
|
136
|
+
- **Parameters:**
|
|
137
|
+
- `value` (Any): Value to convert.
|
|
138
|
+
- **Returns:** `String`.
|
|
139
|
+
|
|
132
140
|
### limitString(string, limit = 35, omission = "...")
|
|
133
141
|
|
|
134
142
|
Truncates a string if it exceeds `limit` characters and appends `omission`. Strings shorter than the limit are returned unchanged.
|
package/package.json
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "melperjs",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.2.1",
|
|
4
4
|
"description": "A compact JavaScript utility library for strings, objects, tokens, hashing, cookies, proxies, file I/O, shell, and more.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"melperjs",
|
|
7
6
|
"utilities",
|
|
8
7
|
"utils",
|
|
9
8
|
"helpers",
|
|
10
|
-
"
|
|
11
|
-
"nodejs",
|
|
12
|
-
"esm",
|
|
13
|
-
"cjs",
|
|
14
|
-
"string",
|
|
15
|
-
"object",
|
|
16
|
-
"random",
|
|
17
|
-
"token",
|
|
18
|
-
"uuid",
|
|
19
|
-
"bcrypt",
|
|
20
|
-
"hash",
|
|
21
|
-
"crypto",
|
|
22
|
-
"cookie",
|
|
23
|
-
"base64",
|
|
24
|
-
"proxy",
|
|
25
|
-
"file-system",
|
|
26
|
-
"shell"
|
|
9
|
+
"random"
|
|
27
10
|
],
|
|
28
11
|
"homepage": "https://github.com/mahelbir/melperjs#readme",
|
|
29
12
|
"bugs": {
|
|
@@ -62,12 +45,12 @@
|
|
|
62
45
|
},
|
|
63
46
|
"dependencies": {
|
|
64
47
|
"bcryptjs": "^3.0.3",
|
|
65
|
-
"es-toolkit": "^1.
|
|
66
|
-
"set-cookie-parser": "^3.1.
|
|
48
|
+
"es-toolkit": "^1.49.0",
|
|
49
|
+
"set-cookie-parser": "^3.1.1",
|
|
67
50
|
"xss": "^1.0.15"
|
|
68
51
|
},
|
|
69
52
|
"devDependencies": {
|
|
70
|
-
"tsdown": "^0.22.
|
|
53
|
+
"tsdown": "^0.22.3"
|
|
71
54
|
},
|
|
72
55
|
"publishConfig": {
|
|
73
56
|
"access": "public"
|