moderndash 4.0.0 → 4.0.2
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 +6 -6
- package/dist/index.cjs +45 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
<p align=center>
|
|
4
4
|
<b>
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
<span>
|
|
33
33
|
<img alt="node-current" src="https://img.shields.io/node/v/moderndash?color=blue">
|
|
34
34
|
</span>
|
|
35
|
-
<a href="https://github.com/
|
|
36
|
-
<img alt="GitHub" src="https://img.shields.io/github/license/
|
|
35
|
+
<a href="https://github.com/maxdewald/moderndash/blob/main/LICENSE">
|
|
36
|
+
<img alt="GitHub" src="https://img.shields.io/github/license/maxdewald/moderndash?color=orange">
|
|
37
37
|
</a>
|
|
38
38
|
</div>
|
|
39
39
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
---
|
|
47
47
|
|
|
48
48
|
<div align=center class="space-y">
|
|
49
|
-
<img alt="Intro Code" width=100% src="https://raw.githubusercontent.com/
|
|
49
|
+
<img alt="Intro Code" width=100% src="https://raw.githubusercontent.com/maxdewald/moderndash/main/website/src/assets/introCodeV6.svg"></img>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
## 💾 Installation
|
|
@@ -62,7 +62,7 @@ npm install moderndash
|
|
|
62
62
|
|
|
63
63
|
ModernDash aims to outperform Lodash and deliver lightning-fast utility functions. Performance is not an afterthought, but a top priority. You can expect ModernDash to exceed or at least match the performance of Lodash in most benchmarks, ensuring that your project stays speedy and efficient.
|
|
64
64
|
|
|
65
|
-
**[[ Benchmark Results](https://github.com/
|
|
65
|
+
**[[ Benchmark Results](https://github.com/maxdewald/moderndash/blob/main/benchmark/RESULTS.md) ]**
|
|
66
66
|
|
|
67
67
|
## 🗃 FAQ
|
|
68
68
|
|
|
@@ -79,4 +79,4 @@ To [type-fest](https://github.com/sindresorhus/type-fest) for providing some val
|
|
|
79
79
|
|
|
80
80
|
- Star the repo if you like it
|
|
81
81
|
|
|
82
|
-
- Check the [contributing](https://github.com/
|
|
82
|
+
- Check the [contributing](https://github.com/maxdewald/moderndash/blob/main/CONTRIBUTING.md) section!
|
package/dist/index.cjs
CHANGED
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
Queue: () => Queue,
|
|
24
24
|
average: () => average,
|
|
25
25
|
camelCase: () => camelCase,
|
|
@@ -87,7 +87,7 @@ __export(src_exports, {
|
|
|
87
87
|
unescapeHtml: () => unescapeHtml,
|
|
88
88
|
unique: () => unique
|
|
89
89
|
});
|
|
90
|
-
module.exports = __toCommonJS(
|
|
90
|
+
module.exports = __toCommonJS(index_exports);
|
|
91
91
|
|
|
92
92
|
// src/array/chunk.ts
|
|
93
93
|
function chunk(array, chunkSize) {
|
|
@@ -545,6 +545,7 @@ function merge(target, ...sources) {
|
|
|
545
545
|
const targetCopy = { ...target };
|
|
546
546
|
for (const source of sources) {
|
|
547
547
|
for (const [key, value] of Object.entries(source)) {
|
|
548
|
+
if (key === "__proto__") continue;
|
|
548
549
|
targetCopy[key] = isPlainObject(value) && isPlainObject(targetCopy[key]) ? merge(targetCopy[key], value) : value;
|
|
549
550
|
}
|
|
550
551
|
}
|
|
@@ -578,6 +579,8 @@ function set(obj, path, value) {
|
|
|
578
579
|
let currentObj = obj;
|
|
579
580
|
for (let index = 0; index < pathParts.length; index++) {
|
|
580
581
|
const key = pathParts[index].replace(matchBracketsRegex, "");
|
|
582
|
+
if (key === "__proto__")
|
|
583
|
+
return obj;
|
|
581
584
|
if (index === pathParts.length - 1) {
|
|
582
585
|
currentObj[key] = value;
|
|
583
586
|
break;
|
|
@@ -775,9 +778,46 @@ function capitalize(str) {
|
|
|
775
778
|
}
|
|
776
779
|
|
|
777
780
|
// src/string/deburr.ts
|
|
778
|
-
var
|
|
781
|
+
var ligatures = {
|
|
782
|
+
198: "AE",
|
|
783
|
+
230: "ae",
|
|
784
|
+
208: "D",
|
|
785
|
+
240: "d",
|
|
786
|
+
216: "O",
|
|
787
|
+
248: "o",
|
|
788
|
+
222: "Th",
|
|
789
|
+
254: "th",
|
|
790
|
+
223: "ss",
|
|
791
|
+
272: "D",
|
|
792
|
+
273: "d",
|
|
793
|
+
294: "H",
|
|
794
|
+
295: "h",
|
|
795
|
+
305: "i",
|
|
796
|
+
306: "IJ",
|
|
797
|
+
307: "ij",
|
|
798
|
+
312: "k",
|
|
799
|
+
319: "L",
|
|
800
|
+
320: "l",
|
|
801
|
+
321: "L",
|
|
802
|
+
322: "l",
|
|
803
|
+
329: "'n",
|
|
804
|
+
330: "N",
|
|
805
|
+
331: "n",
|
|
806
|
+
338: "OE",
|
|
807
|
+
339: "oe",
|
|
808
|
+
358: "T",
|
|
809
|
+
359: "t",
|
|
810
|
+
383: "s"
|
|
811
|
+
};
|
|
779
812
|
function deburr(str) {
|
|
780
|
-
|
|
813
|
+
const nfd = str.normalize("NFD");
|
|
814
|
+
let result = "";
|
|
815
|
+
for (let i = 0; i < nfd.length; i++) {
|
|
816
|
+
const code = nfd.charCodeAt(i);
|
|
817
|
+
if (code >= 768 && code <= 879) continue;
|
|
818
|
+
result += ligatures[code] ?? nfd[i];
|
|
819
|
+
}
|
|
820
|
+
return result;
|
|
781
821
|
}
|
|
782
822
|
|
|
783
823
|
// src/string/camelCase.ts
|