@stryke/helpers 0.1.0

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.
Files changed (84) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +295 -0
  3. package/dist/arg-identity.cjs +9 -0
  4. package/dist/arg-identity.d.ts +10 -0
  5. package/dist/arg-identity.mjs +1 -0
  6. package/dist/debounce.cjs +24 -0
  7. package/dist/debounce.d.ts +41 -0
  8. package/dist/debounce.mjs +1 -0
  9. package/dist/deep-clone.cjs +61 -0
  10. package/dist/deep-clone.d.ts +63 -0
  11. package/dist/deep-clone.mjs +1 -0
  12. package/dist/deep-merge.cjs +35 -0
  13. package/dist/deep-merge.d.ts +12 -0
  14. package/dist/deep-merge.mjs +1 -0
  15. package/dist/delay.cjs +28 -0
  16. package/dist/delay.d.ts +72 -0
  17. package/dist/delay.mjs +1 -0
  18. package/dist/errors.cjs +18 -0
  19. package/dist/errors.d.ts +12 -0
  20. package/dist/errors.mjs +1 -0
  21. package/dist/flatten-object.cjs +20 -0
  22. package/dist/flatten-object.d.ts +33 -0
  23. package/dist/flatten-object.mjs +1 -0
  24. package/dist/get-field.cjs +41 -0
  25. package/dist/get-field.d.ts +251 -0
  26. package/dist/get-field.mjs +1 -0
  27. package/dist/get-ordered-by.cjs +18 -0
  28. package/dist/get-ordered-by.d.ts +36 -0
  29. package/dist/get-ordered-by.mjs +1 -0
  30. package/dist/get-unique.cjs +17 -0
  31. package/dist/get-unique.d.ts +22 -0
  32. package/dist/get-unique.mjs +1 -0
  33. package/dist/identity.cjs +9 -0
  34. package/dist/identity.d.ts +15 -0
  35. package/dist/identity.mjs +1 -0
  36. package/dist/index.cjs +280 -0
  37. package/dist/index.d.ts +25 -0
  38. package/dist/index.mjs +1 -0
  39. package/dist/is-equal.cjs +60 -0
  40. package/dist/is-equal.d.ts +18 -0
  41. package/dist/is-equal.mjs +1 -0
  42. package/dist/is-production.cjs +12 -0
  43. package/dist/is-production.d.ts +30 -0
  44. package/dist/is-production.mjs +1 -0
  45. package/dist/is-runtime-server.cjs +10 -0
  46. package/dist/is-runtime-server.d.ts +11 -0
  47. package/dist/is-runtime-server.mjs +1 -0
  48. package/dist/match-sorter.cjs +184 -0
  49. package/dist/match-sorter.d.ts +77 -0
  50. package/dist/match-sorter.mjs +1 -0
  51. package/dist/noop.cjs +10 -0
  52. package/dist/noop.d.ts +18 -0
  53. package/dist/noop.mjs +1 -0
  54. package/dist/remove-accents.cjs +411 -0
  55. package/dist/remove-accents.d.ts +8 -0
  56. package/dist/remove-accents.mjs +1 -0
  57. package/dist/remove-empty-items.cjs +8 -0
  58. package/dist/remove-empty-items.d.ts +7 -0
  59. package/dist/remove-empty-items.mjs +1 -0
  60. package/dist/set-field.cjs +20 -0
  61. package/dist/set-field.d.ts +10 -0
  62. package/dist/set-field.mjs +1 -0
  63. package/dist/throttle.cjs +13 -0
  64. package/dist/throttle.d.ts +28 -0
  65. package/dist/throttle.mjs +1 -0
  66. package/dist/timeout.cjs +11 -0
  67. package/dist/timeout.d.ts +8 -0
  68. package/dist/timeout.mjs +1 -0
  69. package/dist/to-deep-key.cjs +14 -0
  70. package/dist/to-deep-key.d.ts +35 -0
  71. package/dist/to-deep-key.mjs +1 -0
  72. package/dist/to-path.cjs +23 -0
  73. package/dist/to-path.d.ts +18 -0
  74. package/dist/to-path.mjs +1 -0
  75. package/dist/unflatten-object.cjs +10 -0
  76. package/dist/unflatten-object.d.ts +33 -0
  77. package/dist/unflatten-object.mjs +1 -0
  78. package/dist/union.cjs +10 -0
  79. package/dist/union.d.ts +20 -0
  80. package/dist/union.mjs +1 -0
  81. package/dist/with-timeout.cjs +10 -0
  82. package/dist/with-timeout.d.ts +20 -0
  83. package/dist/with-timeout.mjs +1 -0
  84. package/package.json +423 -0
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultBaseSortFn = void 0;
7
+ exports.matchSorter = T;
8
+ exports.rankings = void 0;
9
+ var _removeAccents = require("./remove-accents.cjs");
10
+ const I = exports.rankings = {
11
+ CASE_SENSITIVE_EQUAL: 7,
12
+ EQUAL: 6,
13
+ STARTS_WITH: 5,
14
+ WORD_STARTS_WITH: 4,
15
+ CONTAINS: 3,
16
+ ACRONYM: 2,
17
+ MATCHES: 1,
18
+ NO_MATCH: 0
19
+ },
20
+ g = (n, e) => String(n.rankedValue).localeCompare(String(e.rankedValue));
21
+ exports.defaultBaseSortFn = g;
22
+ function T(n, e, t = {}) {
23
+ const {
24
+ keys: r,
25
+ threshold: c = I.MATCHES,
26
+ baseSort: s = g,
27
+ sorter: y = i => i.sort((o, l) => V(o, l, s))
28
+ } = t,
29
+ u = n.reduce((i, o, l) => a(i, o, l), []);
30
+ return y(u).map(({
31
+ item: i
32
+ }) => i);
33
+ function a(i, o, l) {
34
+ const m = O(o, r, e, t),
35
+ {
36
+ rank: p,
37
+ keyThreshold: f = c
38
+ } = m;
39
+ return p >= f && i.push({
40
+ ...m,
41
+ item: o,
42
+ index: l
43
+ }), i;
44
+ }
45
+ }
46
+ T.rankings = I;
47
+ function O(n, e, t, r) {
48
+ if (!e) {
49
+ const s = n;
50
+ return {
51
+ rankedValue: s,
52
+ rank: k(s, t, r),
53
+ keyIndex: -1,
54
+ keyThreshold: r.threshold
55
+ };
56
+ }
57
+ return M(n, e).reduce(({
58
+ rank: s,
59
+ rankedValue: y,
60
+ keyIndex: u,
61
+ keyThreshold: a
62
+ }, {
63
+ itemValue: i,
64
+ attributes: o
65
+ }, l) => {
66
+ let m = k(i, t, r),
67
+ p = y;
68
+ const {
69
+ minRanking: f,
70
+ maxRanking: d,
71
+ threshold: R
72
+ } = o;
73
+ return m < f && m >= I.MATCHES ? m = f : m > d && (m = d), m > s && (s = m, u = l, a = R, p = i), {
74
+ rankedValue: p,
75
+ rank: s,
76
+ keyIndex: u,
77
+ keyThreshold: a
78
+ };
79
+ }, {
80
+ rankedValue: n,
81
+ rank: I.NO_MATCH,
82
+ keyIndex: -1,
83
+ keyThreshold: r.threshold
84
+ });
85
+ }
86
+ function k(n, e, t) {
87
+ return n = A(n, t), e = A(e, t), e.length > n.length ? I.NO_MATCH : n === e ? I.CASE_SENSITIVE_EQUAL : (n = n.toLowerCase(), e = e.toLowerCase(), n === e ? I.EQUAL : n.startsWith(e) ? I.STARTS_WITH : n.includes(` ${e}`) ? I.WORD_STARTS_WITH : n.includes(e) ? I.CONTAINS : e.length === 1 ? I.NO_MATCH : S(n).includes(e) ? I.ACRONYM : C(n, e));
88
+ }
89
+ function S(n) {
90
+ let e = "";
91
+ const t = n.split(" ");
92
+ for (const r of t) {
93
+ const c = r.split("-");
94
+ for (const s of c) e += s.slice(0, 1);
95
+ }
96
+ return e;
97
+ }
98
+ function C(n, e) {
99
+ let t = 0,
100
+ r = 0;
101
+ function c(a, i, o) {
102
+ for (let l = o, m = i.length; l < m; l++) if (i[l] === a) return t += 1, l + 1;
103
+ return -1;
104
+ }
105
+ function s(a) {
106
+ const i = 1 / a,
107
+ o = t / e.length;
108
+ return I.MATCHES + o * i;
109
+ }
110
+ const y = c(e[0], n, 0);
111
+ if (y < 0) return I.NO_MATCH;
112
+ r = y;
113
+ for (let a = 1, i = e.length; a < i; a++) {
114
+ const o = e[a];
115
+ if (r = c(o, n, r), !(r > -1)) return I.NO_MATCH;
116
+ }
117
+ const u = r - y;
118
+ return s(u);
119
+ }
120
+ function V(n, e, t) {
121
+ const {
122
+ rank: s,
123
+ keyIndex: y
124
+ } = n,
125
+ {
126
+ rank: u,
127
+ keyIndex: a
128
+ } = e;
129
+ return s === u ? y === a ? t(n, e) : y < a ? -1 : 1 : s > u ? -1 : 1;
130
+ }
131
+ function A(n, {
132
+ keepDiacritics: e
133
+ }) {
134
+ return n = `${n}`, e || (n = (0, _removeAccents.removeAccents)(n)), n;
135
+ }
136
+ function K(n, e) {
137
+ typeof e == "object" && (e = e.key);
138
+ let t;
139
+ if (typeof e == "function") t = e(n);else if (n === null) t = null;else if (Object.hasOwnProperty.call(n, e)) t = n[e];else {
140
+ if (e.includes(".")) return x(e, n);
141
+ t = null;
142
+ }
143
+ return t === null ? [] : Array.isArray(t) ? t : [String(t)];
144
+ }
145
+ function x(n, e) {
146
+ const t = n.split(".");
147
+ let r = [e];
148
+ for (let c = 0, s = t.length; c < s; c++) {
149
+ const y = t[c];
150
+ let u = [];
151
+ for (let a = 0, i = r.length; a < i; a++) {
152
+ const o = r[a];
153
+ if (o !== null) if (y && Object.hasOwnProperty.call(o, y)) {
154
+ const l = o[y];
155
+ l !== null && u.push(l);
156
+ } else o && y === "*" && (u = [...u, o]);
157
+ }
158
+ r = u;
159
+ }
160
+ return Array.isArray(r[0]) ? [].concat(...r) : r;
161
+ }
162
+ function M(n, e) {
163
+ const t = [];
164
+ for (let r = 0, c = e.length; r < c; r++) {
165
+ const s = e[r],
166
+ y = H(s),
167
+ u = K(n, s);
168
+ for (let a = 0, i = u.length; a < i; a++) t.push({
169
+ itemValue: u[a],
170
+ attributes: y
171
+ });
172
+ }
173
+ return t;
174
+ }
175
+ const h = {
176
+ maxRanking: 1 / 0,
177
+ minRanking: -1 / 0
178
+ };
179
+ function H(n) {
180
+ return typeof n == "string" ? h : {
181
+ ...h,
182
+ ...n
183
+ };
184
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Forked from match-sorter by Kent C. Dodds
3
+ */
4
+ type KeyAttributes = {
5
+ threshold?: Ranking;
6
+ maxRanking: Ranking;
7
+ minRanking: Ranking;
8
+ };
9
+ interface RankingInfo {
10
+ rankedValue: string;
11
+ rank: Ranking;
12
+ keyIndex: number;
13
+ keyThreshold: Ranking | undefined;
14
+ }
15
+ interface ValueGetterKey<ItemType> {
16
+ (item: ItemType): string | Array<string>;
17
+ }
18
+ interface IndexedItem<ItemType> {
19
+ item: ItemType;
20
+ index: number;
21
+ }
22
+ interface RankedItem<ItemType> extends RankingInfo, IndexedItem<ItemType> {
23
+ }
24
+ interface BaseSorter<ItemType> {
25
+ (a: RankedItem<ItemType>, b: RankedItem<ItemType>): number;
26
+ }
27
+ interface Sorter<ItemType> {
28
+ (matchItems: Array<RankedItem<ItemType>>): Array<RankedItem<ItemType>>;
29
+ }
30
+ interface KeyAttributesOptions<ItemType> {
31
+ key?: string | ValueGetterKey<ItemType>;
32
+ threshold?: Ranking;
33
+ maxRanking?: Ranking;
34
+ minRanking?: Ranking;
35
+ }
36
+ type KeyOption<ItemType> = KeyAttributesOptions<ItemType> | ValueGetterKey<ItemType> | string;
37
+ interface MatchSorterOptions<ItemType = unknown> {
38
+ keys?: ReadonlyArray<KeyOption<ItemType>>;
39
+ threshold?: Ranking;
40
+ baseSort?: BaseSorter<ItemType>;
41
+ keepDiacritics?: boolean;
42
+ sorter?: Sorter<ItemType>;
43
+ }
44
+ declare const rankings: {
45
+ readonly CASE_SENSITIVE_EQUAL: 7;
46
+ readonly EQUAL: 6;
47
+ readonly STARTS_WITH: 5;
48
+ readonly WORD_STARTS_WITH: 4;
49
+ readonly CONTAINS: 3;
50
+ readonly ACRONYM: 2;
51
+ readonly MATCHES: 1;
52
+ readonly NO_MATCH: 0;
53
+ };
54
+ type Ranking = (typeof rankings)[keyof typeof rankings];
55
+ declare const defaultBaseSortFn: BaseSorter<unknown>;
56
+ /**
57
+ * Takes an array of items and a value and returns a new array with the items that match the given value
58
+ * @param items - the items to sort
59
+ * @param value - the value to use for ranking
60
+ * @param options - Some options to configure the sorter
61
+ * @returns - the new sorted array
62
+ */
63
+ declare function matchSorter<ItemType = string>(items: ReadonlyArray<ItemType>, value: string, options?: MatchSorterOptions<ItemType>): Array<ItemType>;
64
+ declare namespace matchSorter {
65
+ var rankings: {
66
+ readonly CASE_SENSITIVE_EQUAL: 7;
67
+ readonly EQUAL: 6;
68
+ readonly STARTS_WITH: 5;
69
+ readonly WORD_STARTS_WITH: 4;
70
+ readonly CONTAINS: 3;
71
+ readonly ACRONYM: 2;
72
+ readonly MATCHES: 1;
73
+ readonly NO_MATCH: 0;
74
+ };
75
+ }
76
+ export { defaultBaseSortFn, matchSorter, rankings };
77
+ export type { KeyAttributes, KeyAttributesOptions, KeyOption, MatchSorterOptions, RankingInfo, ValueGetterKey };
@@ -0,0 +1 @@
1
+ import{removeAccents as b}from"./remove-accents";const I={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},g=(n,e)=>String(n.rankedValue).localeCompare(String(e.rankedValue));function T(n,e,t={}){const{keys:r,threshold:c=I.MATCHES,baseSort:s=g,sorter:y=i=>i.sort((o,l)=>V(o,l,s))}=t,u=n.reduce((i,o,l)=>a(i,o,l),[]);return y(u).map(({item:i})=>i);function a(i,o,l){const m=O(o,r,e,t),{rank:p,keyThreshold:f=c}=m;return p>=f&&i.push({...m,item:o,index:l}),i}}T.rankings=I;function O(n,e,t,r){if(!e){const s=n;return{rankedValue:s,rank:k(s,t,r),keyIndex:-1,keyThreshold:r.threshold}}return M(n,e).reduce(({rank:s,rankedValue:y,keyIndex:u,keyThreshold:a},{itemValue:i,attributes:o},l)=>{let m=k(i,t,r),p=y;const{minRanking:f,maxRanking:d,threshold:R}=o;return m<f&&m>=I.MATCHES?m=f:m>d&&(m=d),m>s&&(s=m,u=l,a=R,p=i),{rankedValue:p,rank:s,keyIndex:u,keyThreshold:a}},{rankedValue:n,rank:I.NO_MATCH,keyIndex:-1,keyThreshold:r.threshold})}function k(n,e,t){return n=A(n,t),e=A(e,t),e.length>n.length?I.NO_MATCH:n===e?I.CASE_SENSITIVE_EQUAL:(n=n.toLowerCase(),e=e.toLowerCase(),n===e?I.EQUAL:n.startsWith(e)?I.STARTS_WITH:n.includes(` ${e}`)?I.WORD_STARTS_WITH:n.includes(e)?I.CONTAINS:e.length===1?I.NO_MATCH:S(n).includes(e)?I.ACRONYM:C(n,e))}function S(n){let e="";const t=n.split(" ");for(const r of t){const c=r.split("-");for(const s of c)e+=s.slice(0,1)}return e}function C(n,e){let t=0,r=0;function c(a,i,o){for(let l=o,m=i.length;l<m;l++)if(i[l]===a)return t+=1,l+1;return-1}function s(a){const i=1/a,o=t/e.length;return I.MATCHES+o*i}const y=c(e[0],n,0);if(y<0)return I.NO_MATCH;r=y;for(let a=1,i=e.length;a<i;a++){const o=e[a];if(r=c(o,n,r),!(r>-1))return I.NO_MATCH}const u=r-y;return s(u)}function V(n,e,t){const{rank:s,keyIndex:y}=n,{rank:u,keyIndex:a}=e;return s===u?y===a?t(n,e):y<a?-1:1:s>u?-1:1}function A(n,{keepDiacritics:e}){return n=`${n}`,e||(n=b(n)),n}function K(n,e){typeof e=="object"&&(e=e.key);let t;if(typeof e=="function")t=e(n);else if(n===null)t=null;else if(Object.hasOwnProperty.call(n,e))t=n[e];else{if(e.includes("."))return x(e,n);t=null}return t===null?[]:Array.isArray(t)?t:[String(t)]}function x(n,e){const t=n.split(".");let r=[e];for(let c=0,s=t.length;c<s;c++){const y=t[c];let u=[];for(let a=0,i=r.length;a<i;a++){const o=r[a];if(o!==null)if(y&&Object.hasOwnProperty.call(o,y)){const l=o[y];l!==null&&u.push(l)}else o&&y==="*"&&(u=[...u,o])}r=u}return Array.isArray(r[0])?[].concat(...r):r}function M(n,e){const t=[];for(let r=0,c=e.length;r<c;r++){const s=e[r],y=H(s),u=K(n,s);for(let a=0,i=u.length;a<i;a++)t.push({itemValue:u[a],attributes:y})}return t}const h={maxRanking:1/0,minRanking:-1/0};function H(n){return typeof n=="string"?h:{...h,...n}}export{g as defaultBaseSortFn,T as matchSorter,I as rankings};
package/dist/noop.cjs ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.asyncNoop = asyncNoop;
7
+ exports.noop = void 0;
8
+ const noop = o => {};
9
+ exports.noop = noop;
10
+ async function asyncNoop(o) {}
package/dist/noop.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A no op, or no-op, function for no operation
3
+ *
4
+ * @remarks Please see {@link https://dev.to/praneshpsg239/noop-in-javascript-478h | this article} for more information.
5
+ *
6
+ * @param _params - An optional parameter passed to the function. It can be anything (but is not used in any way)
7
+ */
8
+ export declare const noop: (_params?: unknown) => void;
9
+ /**
10
+ * An asynchronous no-operation function that does nothing.
11
+ * This can be used as a placeholder or default function.
12
+ *
13
+ * @example
14
+ * asyncNoop(); // Does nothing
15
+ *
16
+ * @returns This function returns a Promise that resolves to undefined.
17
+ */
18
+ export declare function asyncNoop(_params?: unknown): Promise<void>;
package/dist/noop.mjs ADDED
@@ -0,0 +1 @@
1
+ export const noop=o=>{};export async function asyncNoop(o){}
@@ -0,0 +1,411 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.removeAccents = exports.characterMap = void 0;
7
+ const characterMap = exports.characterMap = {
8
+ À: "A",
9
+ Á: "A",
10
+ Â: "A",
11
+ Ã: "A",
12
+ Ä: "A",
13
+ Å: "A",
14
+ Ấ: "A",
15
+ Ắ: "A",
16
+ Ẳ: "A",
17
+ Ẵ: "A",
18
+ Ặ: "A",
19
+ Æ: "AE",
20
+ Ầ: "A",
21
+ Ằ: "A",
22
+ Ȃ: "A",
23
+ Ç: "C",
24
+ Ḉ: "C",
25
+ È: "E",
26
+ É: "E",
27
+ Ê: "E",
28
+ Ë: "E",
29
+ Ế: "E",
30
+ Ḗ: "E",
31
+ Ề: "E",
32
+ Ḕ: "E",
33
+ Ḝ: "E",
34
+ Ȇ: "E",
35
+ Ì: "I",
36
+ Í: "I",
37
+ Î: "I",
38
+ Ï: "I",
39
+ Ḯ: "I",
40
+ Ȋ: "I",
41
+ Ð: "D",
42
+ Ñ: "N",
43
+ Ò: "O",
44
+ Ó: "O",
45
+ Ô: "O",
46
+ Õ: "O",
47
+ Ö: "O",
48
+ Ø: "O",
49
+ Ố: "O",
50
+ Ṍ: "O",
51
+ Ṓ: "O",
52
+ Ȏ: "O",
53
+ Ù: "U",
54
+ Ú: "U",
55
+ Û: "U",
56
+ Ü: "U",
57
+ Ý: "Y",
58
+ à: "a",
59
+ á: "a",
60
+ â: "a",
61
+ ã: "a",
62
+ ä: "a",
63
+ å: "a",
64
+ ấ: "a",
65
+ ắ: "a",
66
+ ẳ: "a",
67
+ ẵ: "a",
68
+ ặ: "a",
69
+ æ: "ae",
70
+ ầ: "a",
71
+ ằ: "a",
72
+ ȃ: "a",
73
+ ç: "c",
74
+ ḉ: "c",
75
+ è: "e",
76
+ é: "e",
77
+ ê: "e",
78
+ ë: "e",
79
+ ế: "e",
80
+ ḗ: "e",
81
+ ề: "e",
82
+ ḕ: "e",
83
+ ḝ: "e",
84
+ ȇ: "e",
85
+ ì: "i",
86
+ í: "i",
87
+ î: "i",
88
+ ï: "i",
89
+ ḯ: "i",
90
+ ȋ: "i",
91
+ ð: "d",
92
+ ñ: "n",
93
+ ò: "o",
94
+ ó: "o",
95
+ ô: "o",
96
+ õ: "o",
97
+ ö: "o",
98
+ ø: "o",
99
+ ố: "o",
100
+ ṍ: "o",
101
+ ṓ: "o",
102
+ ȏ: "o",
103
+ ù: "u",
104
+ ú: "u",
105
+ û: "u",
106
+ ü: "u",
107
+ ý: "y",
108
+ ÿ: "y",
109
+ Ā: "A",
110
+ ā: "a",
111
+ Ă: "A",
112
+ ă: "a",
113
+ Ą: "A",
114
+ ą: "a",
115
+ Ć: "C",
116
+ ć: "c",
117
+ Ĉ: "C",
118
+ ĉ: "c",
119
+ Ċ: "C",
120
+ ċ: "c",
121
+ Č: "C",
122
+ č: "c",
123
+ C̆: "C",
124
+ c̆: "c",
125
+ Ď: "D",
126
+ ď: "d",
127
+ Đ: "D",
128
+ đ: "d",
129
+ Ē: "E",
130
+ ē: "e",
131
+ Ĕ: "E",
132
+ ĕ: "e",
133
+ Ė: "E",
134
+ ė: "e",
135
+ Ę: "E",
136
+ ę: "e",
137
+ Ě: "E",
138
+ ě: "e",
139
+ Ĝ: "G",
140
+ Ǵ: "G",
141
+ ĝ: "g",
142
+ ǵ: "g",
143
+ Ğ: "G",
144
+ ğ: "g",
145
+ Ġ: "G",
146
+ ġ: "g",
147
+ Ģ: "G",
148
+ ģ: "g",
149
+ Ĥ: "H",
150
+ ĥ: "h",
151
+ Ħ: "H",
152
+ ħ: "h",
153
+ Ḫ: "H",
154
+ ḫ: "h",
155
+ Ĩ: "I",
156
+ ĩ: "i",
157
+ Ī: "I",
158
+ ī: "i",
159
+ Ĭ: "I",
160
+ ĭ: "i",
161
+ Į: "I",
162
+ į: "i",
163
+ İ: "I",
164
+ ı: "i",
165
+ IJ: "IJ",
166
+ ij: "ij",
167
+ Ĵ: "J",
168
+ ĵ: "j",
169
+ Ķ: "K",
170
+ ķ: "k",
171
+ Ḱ: "K",
172
+ ḱ: "k",
173
+ K̆: "K",
174
+ k̆: "k",
175
+ Ĺ: "L",
176
+ ĺ: "l",
177
+ Ļ: "L",
178
+ ļ: "l",
179
+ Ľ: "L",
180
+ ľ: "l",
181
+ Ŀ: "L",
182
+ ŀ: "l",
183
+ Ł: "l",
184
+ ł: "l",
185
+ Ḿ: "M",
186
+ ḿ: "m",
187
+ M̆: "M",
188
+ m̆: "m",
189
+ Ń: "N",
190
+ ń: "n",
191
+ Ņ: "N",
192
+ ņ: "n",
193
+ Ň: "N",
194
+ ň: "n",
195
+ ʼn: "n",
196
+ N̆: "N",
197
+ n̆: "n",
198
+ Ō: "O",
199
+ ō: "o",
200
+ Ŏ: "O",
201
+ ŏ: "o",
202
+ Ő: "O",
203
+ ő: "o",
204
+ Œ: "OE",
205
+ œ: "oe",
206
+ P̆: "P",
207
+ p̆: "p",
208
+ Ŕ: "R",
209
+ ŕ: "r",
210
+ Ŗ: "R",
211
+ ŗ: "r",
212
+ Ř: "R",
213
+ ř: "r",
214
+ R̆: "R",
215
+ r̆: "r",
216
+ Ȓ: "R",
217
+ ȓ: "r",
218
+ Ś: "S",
219
+ ś: "s",
220
+ Ŝ: "S",
221
+ ŝ: "s",
222
+ Ş: "S",
223
+ Ș: "S",
224
+ ș: "s",
225
+ ş: "s",
226
+ Š: "S",
227
+ š: "s",
228
+ Ţ: "T",
229
+ ţ: "t",
230
+ ț: "t",
231
+ Ț: "T",
232
+ Ť: "T",
233
+ ť: "t",
234
+ Ŧ: "T",
235
+ ŧ: "t",
236
+ T̆: "T",
237
+ t̆: "t",
238
+ Ũ: "U",
239
+ ũ: "u",
240
+ Ū: "U",
241
+ ū: "u",
242
+ Ŭ: "U",
243
+ ŭ: "u",
244
+ Ů: "U",
245
+ ů: "u",
246
+ Ű: "U",
247
+ ű: "u",
248
+ Ų: "U",
249
+ ų: "u",
250
+ Ȗ: "U",
251
+ ȗ: "u",
252
+ V̆: "V",
253
+ v̆: "v",
254
+ Ŵ: "W",
255
+ ŵ: "w",
256
+ Ẃ: "W",
257
+ ẃ: "w",
258
+ X̆: "X",
259
+ x̆: "x",
260
+ Ŷ: "Y",
261
+ ŷ: "y",
262
+ Ÿ: "Y",
263
+ Y̆: "Y",
264
+ y̆: "y",
265
+ Ź: "Z",
266
+ ź: "z",
267
+ Ż: "Z",
268
+ ż: "z",
269
+ Ž: "Z",
270
+ ž: "z",
271
+ ſ: "s",
272
+ ƒ: "f",
273
+ Ơ: "O",
274
+ ơ: "o",
275
+ Ư: "U",
276
+ ư: "u",
277
+ Ǎ: "A",
278
+ ǎ: "a",
279
+ Ǐ: "I",
280
+ ǐ: "i",
281
+ Ǒ: "O",
282
+ ǒ: "o",
283
+ Ǔ: "U",
284
+ ǔ: "u",
285
+ Ǖ: "U",
286
+ ǖ: "u",
287
+ Ǘ: "U",
288
+ ǘ: "u",
289
+ Ǚ: "U",
290
+ ǚ: "u",
291
+ Ǜ: "U",
292
+ ǜ: "u",
293
+ Ứ: "U",
294
+ ứ: "u",
295
+ Ṹ: "U",
296
+ ṹ: "u",
297
+ Ǻ: "A",
298
+ ǻ: "a",
299
+ Ǽ: "AE",
300
+ ǽ: "ae",
301
+ Ǿ: "O",
302
+ ǿ: "o",
303
+ Þ: "TH",
304
+ þ: "th",
305
+ Ṕ: "P",
306
+ ṕ: "p",
307
+ Ṥ: "S",
308
+ ṥ: "s",
309
+ X́: "X",
310
+ x́: "x",
311
+ Ѓ: "\u0413",
312
+ ѓ: "\u0433",
313
+ Ќ: "\u041A",
314
+ ќ: "\u043A",
315
+ A̋: "A",
316
+ a̋: "a",
317
+ E̋: "E",
318
+ e̋: "e",
319
+ I̋: "I",
320
+ i̋: "i",
321
+ Ǹ: "N",
322
+ ǹ: "n",
323
+ Ồ: "O",
324
+ ồ: "o",
325
+ Ṑ: "O",
326
+ ṑ: "o",
327
+ Ừ: "U",
328
+ ừ: "u",
329
+ Ẁ: "W",
330
+ ẁ: "w",
331
+ Ỳ: "Y",
332
+ ỳ: "y",
333
+ Ȁ: "A",
334
+ ȁ: "a",
335
+ Ȅ: "E",
336
+ ȅ: "e",
337
+ Ȉ: "I",
338
+ ȉ: "i",
339
+ Ȍ: "O",
340
+ ȍ: "o",
341
+ Ȑ: "R",
342
+ ȑ: "r",
343
+ Ȕ: "U",
344
+ ȕ: "u",
345
+ B̌: "B",
346
+ b̌: "b",
347
+ Č̣: "C",
348
+ č̣: "c",
349
+ Ê̌: "E",
350
+ ê̌: "e",
351
+ F̌: "F",
352
+ f̌: "f",
353
+ Ǧ: "G",
354
+ ǧ: "g",
355
+ Ȟ: "H",
356
+ ȟ: "h",
357
+ J̌: "J",
358
+ ǰ: "j",
359
+ Ǩ: "K",
360
+ ǩ: "k",
361
+ M̌: "M",
362
+ m̌: "m",
363
+ P̌: "P",
364
+ p̌: "p",
365
+ Q̌: "Q",
366
+ q̌: "q",
367
+ Ř̩: "R",
368
+ ř̩: "r",
369
+ Ṧ: "S",
370
+ ṧ: "s",
371
+ V̌: "V",
372
+ v̌: "v",
373
+ W̌: "W",
374
+ w̌: "w",
375
+ X̌: "X",
376
+ x̌: "x",
377
+ Y̌: "Y",
378
+ y̌: "y",
379
+ A̧: "A",
380
+ a̧: "a",
381
+ B̧: "B",
382
+ b̧: "b",
383
+ Ḑ: "D",
384
+ ḑ: "d",
385
+ Ȩ: "E",
386
+ ȩ: "e",
387
+ Ɛ̧: "E",
388
+ ɛ̧: "e",
389
+ Ḩ: "H",
390
+ ḩ: "h",
391
+ I̧: "I",
392
+ i̧: "i",
393
+ Ɨ̧: "I",
394
+ ɨ̧: "i",
395
+ M̧: "M",
396
+ m̧: "m",
397
+ O̧: "O",
398
+ o̧: "o",
399
+ Q̧: "Q",
400
+ q̧: "q",
401
+ U̧: "U",
402
+ u̧: "u",
403
+ X̧: "X",
404
+ x̧: "x",
405
+ Z̧: "Z",
406
+ z̧: "z"
407
+ };
408
+ const o = Object.keys(characterMap).join("|"),
409
+ A = new RegExp(o, "g");
410
+ const removeAccents = e => e.replace(A, a => characterMap[a]);
411
+ exports.removeAccents = removeAccents;
@@ -0,0 +1,8 @@
1
+ export declare const characterMap: Record<string, string>;
2
+ /**
3
+ * Removes accents from a string.
4
+ *
5
+ * @param str - The string to remove accents from
6
+ * @returns The string without accents
7
+ */
8
+ export declare const removeAccents: (str: string) => string;