@creative-web-solution/front-library 7.1.25 → 7.1.26
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/CHANGELOG.md +2 -0
- package/Helpers/Insert.ts +9 -9
- package/README.md +1 -1
- package/Types/Global.d.ts +0 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/Helpers/Insert.ts
CHANGED
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @returns New modified array
|
|
11
11
|
*/
|
|
12
|
-
export function insert(
|
|
12
|
+
export function insert(list: any[], what: any, indexWhere: number): any[] {
|
|
13
13
|
const listLength = list.length;
|
|
14
14
|
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
15
|
+
if (!listLength) {
|
|
16
|
+
return [what];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
if (
|
|
20
|
-
return [
|
|
19
|
+
if (indexWhere <= 0) {
|
|
20
|
+
return [what, ...list];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (
|
|
24
|
-
return [
|
|
23
|
+
if (indexWhere >= listLength) {
|
|
24
|
+
return [...list, what];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
return [
|
|
28
|
-
...list.slice(
|
|
28
|
+
...list.slice(0, indexWhere),
|
|
29
29
|
what,
|
|
30
|
-
...list.slice(
|
|
30
|
+
...list.slice(indexWhere, list.length),
|
|
31
31
|
];
|
|
32
32
|
}
|
package/README.md
CHANGED
package/Types/Global.d.ts
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type RequestIdleCallbackHandle = any;
|
|
2
|
-
type RequestIdleCallbackOptions = {
|
|
3
|
-
timeout: number;
|
|
4
|
-
};
|
|
5
|
-
type RequestIdleCallbackDeadline = {
|
|
6
|
-
readonly didTimeout: boolean;
|
|
7
|
-
timeRemaining: ( () => number );
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
interface Window {
|
|
11
|
-
MSPointerEvent: any;
|
|
12
|
-
$$DEBUG$$: any;
|
|
13
|
-
requestIdleCallback: (
|
|
14
|
-
(
|
|
15
|
-
callback: (( deadline: RequestIdleCallbackDeadline ) => void ),
|
|
16
|
-
opts?: RequestIdleCallbackOptions,
|
|
17
|
-
) => RequestIdleCallbackHandle
|
|
18
|
-
);
|
|
19
|
-
cancelIdleCallback: (( handle: RequestIdleCallbackHandle ) => void );
|
|
20
|
-
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@creative-web-solution/front-library",
|
|
3
3
|
"title": "Frontend library",
|
|
4
4
|
"description": "Frontend functions and modules",
|
|
5
|
-
"version": "7.1.
|
|
5
|
+
"version": "7.1.26",
|
|
6
6
|
"homepage": "https://github.com/creative-web-solution/front-library",
|
|
7
7
|
"author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
|
|
8
8
|
"keywords": [],
|