@sohanemon/utils 4.1.10 → 4.1.12
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/dist/functions/index.js +5 -3
- package/dist/types/utilities.d.ts +8 -0
- package/package.json +7 -21
package/dist/functions/index.js
CHANGED
|
@@ -56,9 +56,11 @@ export function isLinkActive({ path, currentPath, locales = ['en', 'es', 'de', '
|
|
|
56
56
|
* @returns - The cleaned path.
|
|
57
57
|
*/
|
|
58
58
|
export function cleanSrc(src) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
let cleanedSrc = src;
|
|
60
|
+
if (src.includes('/public/')) {
|
|
61
|
+
cleanedSrc = src.replace('/public/', '/');
|
|
62
|
+
}
|
|
63
|
+
return cleanedSrc.trim();
|
|
62
64
|
}
|
|
63
65
|
/**
|
|
64
66
|
* Smoothly scrolls to the top or bottom of a specified container.
|
|
@@ -30,3 +30,11 @@ export type Substract<T extends object, U extends object> = Omit<T, keyof U>;
|
|
|
30
30
|
export type AllOrNone<T> = T | {
|
|
31
31
|
[P in keyof T]?: never;
|
|
32
32
|
};
|
|
33
|
+
export type OneOf<T> = {
|
|
34
|
+
[K in keyof T]: Pick<T, K>;
|
|
35
|
+
}[keyof T];
|
|
36
|
+
export type TwoOf<T> = {
|
|
37
|
+
[K in keyof T]: {
|
|
38
|
+
[L in Exclude<keyof T, K>]: Pick<T, K | L>;
|
|
39
|
+
}[Exclude<keyof T, K>];
|
|
40
|
+
}[keyof T];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sohanemon/utils",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.12",
|
|
4
4
|
"author": "Sohan Emon <sohanemon@outlook.com>",
|
|
5
5
|
"description": "",
|
|
6
6
|
"type": "module",
|
|
@@ -15,33 +15,19 @@
|
|
|
15
15
|
},
|
|
16
16
|
"typesVersions": {
|
|
17
17
|
"*": {
|
|
18
|
-
"core": [
|
|
19
|
-
|
|
20
|
-
],
|
|
21
|
-
"
|
|
22
|
-
"dist/types/index.d.ts"
|
|
23
|
-
],
|
|
24
|
-
"hooks": [
|
|
25
|
-
"dist/hooks/index.d.ts"
|
|
26
|
-
],
|
|
27
|
-
"components": [
|
|
28
|
-
"dist/components/index.d.ts"
|
|
29
|
-
]
|
|
18
|
+
"core": ["dist/index.d.ts"],
|
|
19
|
+
"types": ["dist/types/index.d.ts"],
|
|
20
|
+
"hooks": ["dist/hooks/index.d.ts"],
|
|
21
|
+
"components": ["dist/components/index.d.ts"]
|
|
30
22
|
}
|
|
31
23
|
},
|
|
32
|
-
"files": [
|
|
33
|
-
"dist",
|
|
34
|
-
"README.md"
|
|
35
|
-
],
|
|
24
|
+
"files": ["dist", "README.md"],
|
|
36
25
|
"scripts": {
|
|
37
26
|
"build": "tsc",
|
|
38
27
|
"build:watch": "tsc --watch",
|
|
39
28
|
"export": "tsc && npm publish"
|
|
40
29
|
},
|
|
41
|
-
"keywords": [
|
|
42
|
-
"utils",
|
|
43
|
-
"cn"
|
|
44
|
-
],
|
|
30
|
+
"keywords": ["utils", "cn"],
|
|
45
31
|
"license": "ISC",
|
|
46
32
|
"devDependencies": {
|
|
47
33
|
"@types/node": "^22.4.0",
|