@mongez/reinforcements 2.2.2 → 2.2.4
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/cjs/string/capitalize.js +1 -0
- package/cjs/string/extension.js +1 -0
- package/cjs/string/ltrim.js +1 -0
- package/cjs/string/readMoreChars.js +1 -0
- package/cjs/string/readMoreWords.js +1 -0
- package/cjs/string/removeFirst.js +1 -0
- package/cjs/string/removeLast.js +1 -0
- package/cjs/string/repeatsOf.js +1 -0
- package/cjs/string/replaceAll.js +1 -0
- package/cjs/string/replaceFirst.js +1 -0
- package/cjs/string/replaceLast.js +1 -0
- package/cjs/string/rtrim.js +1 -0
- package/cjs/string/startsWithArabic.d.ts +1 -1
- package/cjs/string/startsWithArabic.js +4 -3
- package/cjs/string/toCamelCase.js +1 -0
- package/cjs/string/toKebabCase.js +1 -0
- package/cjs/string/toSnakeCase.js +1 -0
- package/cjs/string/toStudlyCase.js +1 -0
- package/cjs/string/trim.js +1 -0
- package/cjs/string/ucfirst.js +1 -0
- package/cjs/types.d.ts +1 -1
- package/esm/string/capitalize.js +1 -0
- package/esm/string/extension.js +1 -0
- package/esm/string/ltrim.js +1 -0
- package/esm/string/readMoreChars.js +1 -0
- package/esm/string/readMoreWords.js +1 -0
- package/esm/string/removeFirst.js +1 -0
- package/esm/string/removeLast.js +1 -0
- package/esm/string/repeatsOf.js +1 -0
- package/esm/string/replaceAll.js +1 -0
- package/esm/string/replaceFirst.js +1 -0
- package/esm/string/replaceLast.js +1 -0
- package/esm/string/rtrim.js +1 -0
- package/esm/string/startsWithArabic.d.ts +1 -1
- package/esm/string/startsWithArabic.js +4 -3
- package/esm/string/toCamelCase.js +1 -0
- package/esm/string/toKebabCase.js +1 -0
- package/esm/string/toSnakeCase.js +1 -0
- package/esm/string/toStudlyCase.js +1 -0
- package/esm/string/trim.js +1 -0
- package/esm/string/ucfirst.js +1 -0
- package/esm/types.d.ts +1 -1
- package/package.json +2 -1
- package/docs/VERSION-1.md +0 -1074
package/cjs/string/capitalize.js
CHANGED
package/cjs/string/extension.js
CHANGED
package/cjs/string/ltrim.js
CHANGED
|
@@ -9,6 +9,7 @@ var escapeRegex = require("../utils/escapeRegex.js");
|
|
|
9
9
|
* @return string
|
|
10
10
|
*/
|
|
11
11
|
function ltrim(string, needle = " ") {
|
|
12
|
+
if (!string) return "";
|
|
12
13
|
const pattern = "^" + escapeRegex(needle) + "+",
|
|
13
14
|
regex = new RegExp(pattern, "g");
|
|
14
15
|
return string.replace(regex, "");
|
package/cjs/string/removeLast.js
CHANGED
package/cjs/string/repeatsOf.js
CHANGED
package/cjs/string/replaceAll.js
CHANGED
package/cjs/string/rtrim.js
CHANGED
|
@@ -9,6 +9,7 @@ var escapeRegex = require("../utils/escapeRegex.js");
|
|
|
9
9
|
* @return string
|
|
10
10
|
*/
|
|
11
11
|
function rtrim(string, needle = " ") {
|
|
12
|
+
if (!string) return "";
|
|
12
13
|
const pattern = escapeRegex(needle) + "+$",
|
|
13
14
|
regex = new RegExp(pattern, "g");
|
|
14
15
|
return string.replace(regex, "");
|
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
var trim = require("./trim.js");
|
|
6
6
|
|
|
7
7
|
const ARABIC_PATTERN = /[\u0600-\u06FF]/;
|
|
8
|
-
function startsWithArabic(
|
|
8
|
+
function startsWithArabic(string, trimmed = true) {
|
|
9
|
+
if (!string) return false;
|
|
9
10
|
if (trimmed === true) {
|
|
10
|
-
|
|
11
|
+
string = trim(String(string));
|
|
11
12
|
}
|
|
12
|
-
return
|
|
13
|
+
return string.charAt(0).match(ARABIC_PATTERN) !== null;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
exports.ARABIC_PATTERN = ARABIC_PATTERN;
|
package/cjs/string/trim.js
CHANGED
package/cjs/string/ucfirst.js
CHANGED
package/cjs/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare type GenericObject = Record<string,
|
|
1
|
+
export declare type GenericObject<T = any> = Record<string, T>;
|
|
2
2
|
//# sourceMappingURL=types.d.ts.map
|
package/esm/string/capitalize.js
CHANGED
package/esm/string/extension.js
CHANGED
package/esm/string/ltrim.js
CHANGED
|
@@ -7,6 +7,7 @@ import escapeRegex from "../utils/escapeRegex.js";
|
|
|
7
7
|
* @return string
|
|
8
8
|
*/
|
|
9
9
|
function ltrim(string, needle = " ") {
|
|
10
|
+
if (!string) return "";
|
|
10
11
|
const pattern = "^" + escapeRegex(needle) + "+",
|
|
11
12
|
regex = new RegExp(pattern, "g");
|
|
12
13
|
return string.replace(regex, "");
|
package/esm/string/removeLast.js
CHANGED
package/esm/string/repeatsOf.js
CHANGED
package/esm/string/replaceAll.js
CHANGED
package/esm/string/rtrim.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import trim from "./trim.js";
|
|
2
2
|
|
|
3
3
|
const ARABIC_PATTERN = /[\u0600-\u06FF]/;
|
|
4
|
-
function startsWithArabic(
|
|
4
|
+
function startsWithArabic(string, trimmed = true) {
|
|
5
|
+
if (!string) return false;
|
|
5
6
|
if (trimmed === true) {
|
|
6
|
-
|
|
7
|
+
string = trim(String(string));
|
|
7
8
|
}
|
|
8
|
-
return
|
|
9
|
+
return string.charAt(0).match(ARABIC_PATTERN) !== null;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export { ARABIC_PATTERN, startsWithArabic as default };
|
package/esm/string/trim.js
CHANGED
package/esm/string/ucfirst.js
CHANGED
package/esm/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare type GenericObject = Record<string,
|
|
1
|
+
export declare type GenericObject<T = any> = Record<string, T>;
|
|
2
2
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongez/reinforcements",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "A lightweight package to give a massive reinforcements to variant types of data in Nodejs/Javascript",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -31,5 +31,6 @@
|
|
|
31
31
|
"author": "hassanzohdy",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"module": "./esm/index.js",
|
|
34
|
+
"type": "commonjs",
|
|
34
35
|
"typings": "./cjs/index.d.ts"
|
|
35
36
|
}
|