@mongez/reinforcements 2.2.1 → 2.2.3
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 +917 -121
- package/cjs/array/countBy.d.ts +3 -1
- package/cjs/array/countBy.js +23 -0
- package/cjs/array/pushUnique.d.ts +1 -1
- package/cjs/array/unshiftUnique.d.ts +6 -0
- package/cjs/array/unshiftUnique.js +16 -0
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +6 -2
- package/cjs/mixed/shuffle/shuffle.d.ts +2 -2
- package/cjs/mixed/shuffle/shuffle.js +8 -6
- 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/esm/array/countBy.d.ts +3 -1
- package/esm/array/countBy.js +21 -0
- package/esm/array/pushUnique.d.ts +1 -1
- package/esm/array/unshiftUnique.d.ts +6 -0
- package/esm/array/unshiftUnique.js +14 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +3 -1
- package/esm/mixed/shuffle/shuffle.d.ts +2 -2
- package/esm/mixed/shuffle/shuffle.js +8 -6
- 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/package.json +1 -1
- package/cjs/array/prependUnique.d.ts +0 -6
- package/cjs/object/obj.d.ts +0 -27
- package/cjs/object/obj.js +0 -30
- package/docs/VERSION-1.md +0 -1074
- package/esm/array/prependUnique.d.ts +0 -6
- package/esm/object/obj.d.ts +0 -27
- package/esm/object/obj.js +0 -28
|
@@ -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/package.json
CHANGED
package/cjs/object/obj.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import areEqual from "src/mixed/areEqual/areEqual";
|
|
2
|
-
import clone from "../mixed/clone/clone";
|
|
3
|
-
import except from "./except";
|
|
4
|
-
import flatten from "./flatten";
|
|
5
|
-
import get from "./get";
|
|
6
|
-
import map from "./map";
|
|
7
|
-
import merge from "./merge";
|
|
8
|
-
import only from "./only";
|
|
9
|
-
import set from "./set";
|
|
10
|
-
import sort from "./sort";
|
|
11
|
-
/**
|
|
12
|
-
* Object methods
|
|
13
|
-
*/
|
|
14
|
-
declare const Obj: {
|
|
15
|
-
set: typeof set;
|
|
16
|
-
get: typeof get;
|
|
17
|
-
merge: typeof merge;
|
|
18
|
-
clone: typeof clone;
|
|
19
|
-
sort: typeof sort;
|
|
20
|
-
only: typeof only;
|
|
21
|
-
except: typeof except;
|
|
22
|
-
map: typeof map;
|
|
23
|
-
flatten: typeof flatten;
|
|
24
|
-
areEqual: typeof areEqual;
|
|
25
|
-
};
|
|
26
|
-
export default Obj;
|
|
27
|
-
//# sourceMappingURL=obj.d.ts.map
|
package/cjs/object/obj.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var areEqual = require("../mixed/areEqual/areEqual.js");
|
|
4
|
-
var clone = require("../mixed/clone/clone.js");
|
|
5
|
-
var except = require("./except.js");
|
|
6
|
-
var flatten = require("./flatten.js");
|
|
7
|
-
var get = require("./get.js");
|
|
8
|
-
var map = require("./map.js");
|
|
9
|
-
var merge = require("./merge.js");
|
|
10
|
-
var only = require("./only.js");
|
|
11
|
-
var set = require("./set.js");
|
|
12
|
-
var sort = require("./sort.js");
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Object methods
|
|
16
|
-
*/
|
|
17
|
-
const Obj = {
|
|
18
|
-
set,
|
|
19
|
-
get,
|
|
20
|
-
merge,
|
|
21
|
-
clone,
|
|
22
|
-
sort,
|
|
23
|
-
only,
|
|
24
|
-
except,
|
|
25
|
-
map,
|
|
26
|
-
flatten,
|
|
27
|
-
areEqual,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = Obj;
|