vevet 4.0.0-beta.1 → 4.0.0-beta.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/lib/cjs/Vevet/index.js +1 -1
- package/lib/cjs/utils/common/index.js +0 -3
- package/lib/cjs/utils/common/index.js.map +1 -1
- package/lib/cjs/utils/internal/pickObjectProps.js.map +1 -0
- package/lib/cjs/utils/internal/times.js +14 -0
- package/lib/cjs/utils/internal/times.js.map +1 -0
- package/lib/esm/Vevet/index.js +1 -1
- package/lib/esm/utils/common/index.js +0 -3
- package/lib/esm/utils/common/index.js.map +1 -1
- package/lib/esm/utils/internal/pickObjectProps.js.map +1 -0
- package/lib/esm/utils/internal/times.js +10 -0
- package/lib/esm/utils/internal/times.js.map +1 -0
- package/lib/types/utils/common/index.d.ts +0 -3
- package/lib/types/utils/common/index.d.ts.map +1 -1
- package/lib/types/utils/internal/pickObjectProps.d.ts.map +1 -0
- package/lib/types/utils/internal/times.d.ts +2 -0
- package/lib/types/utils/internal/times.d.ts.map +1 -0
- package/package.json +7 -4
- package/src/Vevet/events/createViewport/stories/index.tsx +1 -1
- package/src/Vevet/index.ts +1 -1
- package/src/Vevet/stories/index.tsx +1 -1
- package/src/components/CustomScroll/stories/Default.tsx +1 -1
- package/src/components/CustomScroll/stories/WithHorizontal.tsx +1 -1
- package/src/components/CustomScroll/stories/WithInnerLerp.tsx +1 -1
- package/src/components/CustomScrollDragPlugin/stories/index.tsx +1 -1
- package/src/components/CustomScrollKeyboardPlugin/stories/index.tsx +1 -1
- package/src/components/Marquee/stories/index.tsx +1 -1
- package/src/components/ScrollBar/stories/Default.tsx +1 -1
- package/src/components/ScrollBar/stories/WithCustomScrollComponent.tsx +1 -1
- package/src/components/ScrollBar/stories/WithInnerScroll.tsx +1 -1
- package/src/components/ScrollView/stories/index.tsx +1 -1
- package/src/components/SlideProgress/stories/index.tsx +1 -1
- package/src/utils/common/index.ts +0 -3
- package/src/utils/internal/times.ts +14 -0
- package/lib/cjs/utils/common/objectKeys.js +0 -19
- package/lib/cjs/utils/common/objectKeys.js.map +0 -1
- package/lib/cjs/utils/common/pickObjectProps.js.map +0 -1
- package/lib/cjs/utils/common/times.js +0 -31
- package/lib/cjs/utils/common/times.js.map +0 -1
- package/lib/esm/utils/common/objectKeys.js +0 -15
- package/lib/esm/utils/common/objectKeys.js.map +0 -1
- package/lib/esm/utils/common/pickObjectProps.js.map +0 -1
- package/lib/esm/utils/common/times.js +0 -27
- package/lib/esm/utils/common/times.js.map +0 -1
- package/lib/types/utils/common/objectKeys.d.ts +0 -13
- package/lib/types/utils/common/objectKeys.d.ts.map +0 -1
- package/lib/types/utils/common/pickObjectProps.d.ts.map +0 -1
- package/lib/types/utils/common/times.d.ts +0 -19
- package/lib/types/utils/common/times.d.ts.map +0 -1
- package/src/utils/common/objectKeys.ts +0 -14
- package/src/utils/common/times.ts +0 -31
- /package/lib/cjs/utils/{common → internal}/pickObjectProps.js +0 -0
- /package/lib/esm/utils/{common → internal}/pickObjectProps.js +0 -0
- /package/lib/types/utils/{common → internal}/pickObjectProps.d.ts +0 -0
- /package/src/utils/{common → internal}/pickObjectProps.ts +0 -0
package/lib/cjs/Vevet/index.js
CHANGED
|
@@ -15,9 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./normalizedTimeoutCallback"), exports);
|
|
18
|
-
__exportStar(require("./objectKeys"), exports);
|
|
19
18
|
__exportStar(require("./PCancelable"), exports);
|
|
20
|
-
__exportStar(require("./pickObjectProps"), exports);
|
|
21
19
|
__exportStar(require("./uid"), exports);
|
|
22
|
-
__exportStar(require("./times"), exports);
|
|
23
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,gDAA8B;AAC9B,wCAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickObjectProps.js","sourceRoot":"","sources":["../../../../src/utils/internal/pickObjectProps.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,eAAe,CAG7B,MAAS,EAAE,IAAS;IACpB,IAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG;QACf,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAoB,CAAC;AAC9B,CAAC;AAXD,0CAWC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.times = void 0;
|
|
4
|
+
function times(callback, count) {
|
|
5
|
+
var index = 0;
|
|
6
|
+
var list = [];
|
|
7
|
+
while (index < count) {
|
|
8
|
+
list.push(callback(index, count));
|
|
9
|
+
index += 1;
|
|
10
|
+
}
|
|
11
|
+
return list;
|
|
12
|
+
}
|
|
13
|
+
exports.times = times;
|
|
14
|
+
//# sourceMappingURL=times.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"times.js","sourceRoot":"","sources":["../../../../src/utils/internal/times.ts"],"names":[],"mappings":";;;AAAA,SAAgB,KAAK,CACnB,QAA6C,EAC7C,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAM,IAAI,GAAQ,EAAE,CAAC;IAErB,OAAO,KAAK,GAAG,KAAK,EAAE;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAClC,KAAK,IAAI,CAAC,CAAC;KACZ;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,sBAaC"}
|
package/lib/esm/Vevet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickObjectProps.js","sourceRoot":"","sources":["../../../../src/utils/internal/pickObjectProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAG7B,MAAS,EAAE,IAAS;IACpB,MAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"times.js","sourceRoot":"","sources":["../../../../src/utils/internal/times.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK,CACnB,QAA6C,EAC7C,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAQ,EAAE,CAAC;IAErB,OAAO,KAAK,GAAG,KAAK,EAAE;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAClC,KAAK,IAAI,CAAC,CAAC;KACZ;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickObjectProps.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/pickObjectProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,MAAM,CAAC,EACjB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAQlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/times.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,CAAC,EACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EAC7C,KAAK,EAAE,MAAM,GACZ,CAAC,EAAE,CAUL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vevet",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "Vevet - A JavaScript Library for Creative Developers",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"storybook": "storybook dev -p 6006",
|
|
@@ -28,25 +28,28 @@
|
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"vevet",
|
|
31
|
+
"helpers",
|
|
32
|
+
"animations",
|
|
31
33
|
"callbacks",
|
|
32
34
|
"viewport",
|
|
33
35
|
"onresize",
|
|
34
36
|
"onload",
|
|
35
|
-
"
|
|
37
|
+
"responsive",
|
|
36
38
|
"mutableProps",
|
|
37
39
|
"wheel",
|
|
38
40
|
"animationframe",
|
|
39
41
|
"fps",
|
|
40
42
|
"timeline",
|
|
43
|
+
"canvas",
|
|
41
44
|
"ctx2d",
|
|
42
|
-
"
|
|
45
|
+
"prerender",
|
|
43
46
|
"cursor",
|
|
44
47
|
"drag",
|
|
45
48
|
"swipe",
|
|
46
49
|
"marquee",
|
|
47
50
|
"preloader",
|
|
48
51
|
"scrollbar",
|
|
49
|
-
"
|
|
52
|
+
"smooth scroll",
|
|
50
53
|
"split text"
|
|
51
54
|
],
|
|
52
55
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { pickObjectProps } from '@/utils/common';
|
|
3
2
|
import { getApp } from '@/utils/internal/getApp';
|
|
3
|
+
import { pickObjectProps } from '@/utils/internal/pickObjectProps';
|
|
4
4
|
|
|
5
5
|
export const Component: FC = () => {
|
|
6
6
|
const [features, setFeatures] = useState<Record<string, boolean | number>>();
|
package/src/Vevet/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { pickObjectProps } from '@/utils/common';
|
|
3
2
|
import { getApp } from '@/utils/internal/getApp';
|
|
3
|
+
import { pickObjectProps } from '@/utils/internal/pickObjectProps';
|
|
4
4
|
|
|
5
5
|
export const Component: FC = () => {
|
|
6
6
|
const [features, setFeatures] =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { CustomScroll } from '..';
|
|
3
|
-
import { times } from '@/utils/
|
|
3
|
+
import { times } from '@/utils/internal/times';
|
|
4
4
|
|
|
5
5
|
export const DefaultComponent: FC = () => {
|
|
6
6
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { CustomScroll } from '..';
|
|
3
|
-
import { times } from '@/utils/
|
|
3
|
+
import { times } from '@/utils/internal/times';
|
|
4
4
|
|
|
5
5
|
export const WithHorizontalComponent: FC = () => {
|
|
6
6
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { CustomScroll } from '..';
|
|
3
|
-
import { times } from '@/utils/
|
|
3
|
+
import { times } from '@/utils/internal/times';
|
|
4
4
|
|
|
5
5
|
export const WithInnerLerpComponent: FC = () => {
|
|
6
6
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { CustomScrollDragPlugin } from '..';
|
|
3
3
|
import { CustomScroll } from '@/components/CustomScroll';
|
|
4
|
-
import { times } from '@/utils/
|
|
4
|
+
import { times } from '@/utils/internal/times';
|
|
5
5
|
|
|
6
6
|
export const Component: FC = () => {
|
|
7
7
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { FC, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { CustomScrollKeyboardPlugin } from '..';
|
|
4
4
|
import { CustomScroll } from '@/components/CustomScroll';
|
|
5
|
-
import { times } from '@/utils/
|
|
5
|
+
import { times } from '@/utils/internal/times';
|
|
6
6
|
|
|
7
7
|
export const Component: FC = () => {
|
|
8
8
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, useEffect, useRef } from 'react';
|
|
2
|
-
import { times } from '@/utils/common';
|
|
3
2
|
import { CustomScroll } from '@/components/CustomScroll';
|
|
4
3
|
import { ScrollBar } from '..';
|
|
4
|
+
import { times } from '@/utils/internal/times';
|
|
5
5
|
|
|
6
6
|
export const WithCustomScrollComponent: FC = () => {
|
|
7
7
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, useEffect, useRef } from 'react';
|
|
2
|
-
import { times } from '@/utils/common';
|
|
3
2
|
import { ScrollBar } from '..';
|
|
3
|
+
import { times } from '@/utils/internal/times';
|
|
4
4
|
|
|
5
5
|
export const WithInnerScrollComponent: FC = () => {
|
|
6
6
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
import React, { FC, useEffect, useRef } from 'react';
|
|
3
3
|
import { ScrollView } from '..';
|
|
4
|
-
import { times } from '@/utils/
|
|
4
|
+
import { times } from '@/utils/internal/times';
|
|
5
5
|
|
|
6
6
|
export const Component: FC = () => {
|
|
7
7
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
import React, { FC, useEffect, useRef } from 'react';
|
|
3
3
|
import { SlideProgress } from '..';
|
|
4
|
-
import { times } from '@/utils/
|
|
4
|
+
import { times } from '@/utils/internal/times';
|
|
5
5
|
|
|
6
6
|
export const Component: FC = () => {
|
|
7
7
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectKeys = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves the keys of an object as an array of the object's keys.
|
|
6
|
-
*
|
|
7
|
-
* This function ensures that the returned keys are typed correctly based on the input object.
|
|
8
|
-
*
|
|
9
|
-
* @param object - The object from which the keys will be retrieved.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const person = { name: 'Alice', age: 25 };
|
|
13
|
-
* const keys = objectKeys(person); // ['name', 'age']
|
|
14
|
-
*/
|
|
15
|
-
function objectKeys(object) {
|
|
16
|
-
return Object.keys(object);
|
|
17
|
-
}
|
|
18
|
-
exports.objectKeys = objectKeys;
|
|
19
|
-
//# sourceMappingURL=objectKeys.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectKeys.js","sourceRoot":"","sources":["../../../../src/utils/common/objectKeys.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CAAI,MAAS;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAa,CAAgB,CAAC;AACnD,CAAC;AAFD,gCAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pickObjectProps.js","sourceRoot":"","sources":["../../../../src/utils/common/pickObjectProps.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,eAAe,CAG7B,MAAS,EAAE,IAAS;IACpB,IAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG;QACf,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAoB,CAAC;AAC9B,CAAC;AAXD,0CAWC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.times = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Repeats a function `n` times and returns an array of the results.
|
|
6
|
-
*
|
|
7
|
-
* The function executes the provided `callback` for each iteration, passing the current index and the total count as arguments.
|
|
8
|
-
* It collects and returns the results of the callback in an array.
|
|
9
|
-
*
|
|
10
|
-
* @param callback - The function to be called on each iteration. Receives the current index and the total count.
|
|
11
|
-
* @param count - The number of times to execute the callback.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* const result = times((index, count) => index / count, 5);
|
|
15
|
-
* // => [0, 0.2, 0.4, 0.6, 0.8]
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* const repeatedStrings = times(() => 'hello', 3);
|
|
19
|
-
* // => ['hello', 'hello', 'hello']
|
|
20
|
-
*/
|
|
21
|
-
function times(callback, count) {
|
|
22
|
-
var index = 0;
|
|
23
|
-
var list = [];
|
|
24
|
-
while (index < count) {
|
|
25
|
-
list.push(callback(index, count));
|
|
26
|
-
index += 1;
|
|
27
|
-
}
|
|
28
|
-
return list;
|
|
29
|
-
}
|
|
30
|
-
exports.times = times;
|
|
31
|
-
//# sourceMappingURL=times.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"times.js","sourceRoot":"","sources":["../../../../src/utils/common/times.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,KAAK,CACnB,QAA6C,EAC7C,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAM,IAAI,GAAQ,EAAE,CAAC;IAErB,OAAO,KAAK,GAAG,KAAK,EAAE;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAClC,KAAK,IAAI,CAAC,CAAC;KACZ;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,sBAaC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the keys of an object as an array of the object's keys.
|
|
3
|
-
*
|
|
4
|
-
* This function ensures that the returned keys are typed correctly based on the input object.
|
|
5
|
-
*
|
|
6
|
-
* @param object - The object from which the keys will be retrieved.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const person = { name: 'Alice', age: 25 };
|
|
10
|
-
* const keys = objectKeys(person); // ['name', 'age']
|
|
11
|
-
*/
|
|
12
|
-
export function objectKeys(object) {
|
|
13
|
-
return Object.keys(object);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=objectKeys.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectKeys.js","sourceRoot":"","sources":["../../../../src/utils/common/objectKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAI,MAAS;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAa,CAAgB,CAAC;AACnD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pickObjectProps.js","sourceRoot":"","sources":["../../../../src/utils/common/pickObjectProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAG7B,MAAS,EAAE,IAAS;IACpB,MAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Repeats a function `n` times and returns an array of the results.
|
|
3
|
-
*
|
|
4
|
-
* The function executes the provided `callback` for each iteration, passing the current index and the total count as arguments.
|
|
5
|
-
* It collects and returns the results of the callback in an array.
|
|
6
|
-
*
|
|
7
|
-
* @param callback - The function to be called on each iteration. Receives the current index and the total count.
|
|
8
|
-
* @param count - The number of times to execute the callback.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const result = times((index, count) => index / count, 5);
|
|
12
|
-
* // => [0, 0.2, 0.4, 0.6, 0.8]
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const repeatedStrings = times(() => 'hello', 3);
|
|
16
|
-
* // => ['hello', 'hello', 'hello']
|
|
17
|
-
*/
|
|
18
|
-
export function times(callback, count) {
|
|
19
|
-
let index = 0;
|
|
20
|
-
const list = [];
|
|
21
|
-
while (index < count) {
|
|
22
|
-
list.push(callback(index, count));
|
|
23
|
-
index += 1;
|
|
24
|
-
}
|
|
25
|
-
return list;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=times.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"times.js","sourceRoot":"","sources":["../../../../src/utils/common/times.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,KAAK,CACnB,QAA6C,EAC7C,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAQ,EAAE,CAAC;IAErB,OAAO,KAAK,GAAG,KAAK,EAAE;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAClC,KAAK,IAAI,CAAC,CAAC;KACZ;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the keys of an object as an array of the object's keys.
|
|
3
|
-
*
|
|
4
|
-
* This function ensures that the returned keys are typed correctly based on the input object.
|
|
5
|
-
*
|
|
6
|
-
* @param object - The object from which the keys will be retrieved.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const person = { name: 'Alice', age: 25 };
|
|
10
|
-
* const keys = objectKeys(person); // ['name', 'age']
|
|
11
|
-
*/
|
|
12
|
-
export declare function objectKeys<T>(object: T): (keyof T)[];
|
|
13
|
-
//# sourceMappingURL=objectKeys.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectKeys.d.ts","sourceRoot":"","sources":["../../../../src/utils/common/objectKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAEpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pickObjectProps.d.ts","sourceRoot":"","sources":["../../../../src/utils/common/pickObjectProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,MAAM,CAAC,EACjB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAQlC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Repeats a function `n` times and returns an array of the results.
|
|
3
|
-
*
|
|
4
|
-
* The function executes the provided `callback` for each iteration, passing the current index and the total count as arguments.
|
|
5
|
-
* It collects and returns the results of the callback in an array.
|
|
6
|
-
*
|
|
7
|
-
* @param callback - The function to be called on each iteration. Receives the current index and the total count.
|
|
8
|
-
* @param count - The number of times to execute the callback.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const result = times((index, count) => index / count, 5);
|
|
12
|
-
* // => [0, 0.2, 0.4, 0.6, 0.8]
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const repeatedStrings = times(() => 'hello', 3);
|
|
16
|
-
* // => ['hello', 'hello', 'hello']
|
|
17
|
-
*/
|
|
18
|
-
export declare function times<T>(callback: (index: number, count: number) => T, count: number): T[];
|
|
19
|
-
//# sourceMappingURL=times.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../../../src/utils/common/times.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EAC7C,KAAK,EAAE,MAAM,GACZ,CAAC,EAAE,CAUL"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the keys of an object as an array of the object's keys.
|
|
3
|
-
*
|
|
4
|
-
* This function ensures that the returned keys are typed correctly based on the input object.
|
|
5
|
-
*
|
|
6
|
-
* @param object - The object from which the keys will be retrieved.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const person = { name: 'Alice', age: 25 };
|
|
10
|
-
* const keys = objectKeys(person); // ['name', 'age']
|
|
11
|
-
*/
|
|
12
|
-
export function objectKeys<T>(object: T): (keyof T)[] {
|
|
13
|
-
return Object.keys(object as any) as (keyof T)[];
|
|
14
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Repeats a function `n` times and returns an array of the results.
|
|
3
|
-
*
|
|
4
|
-
* The function executes the provided `callback` for each iteration, passing the current index and the total count as arguments.
|
|
5
|
-
* It collects and returns the results of the callback in an array.
|
|
6
|
-
*
|
|
7
|
-
* @param callback - The function to be called on each iteration. Receives the current index and the total count.
|
|
8
|
-
* @param count - The number of times to execute the callback.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const result = times((index, count) => index / count, 5);
|
|
12
|
-
* // => [0, 0.2, 0.4, 0.6, 0.8]
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const repeatedStrings = times(() => 'hello', 3);
|
|
16
|
-
* // => ['hello', 'hello', 'hello']
|
|
17
|
-
*/
|
|
18
|
-
export function times<T>(
|
|
19
|
-
callback: (index: number, count: number) => T,
|
|
20
|
-
count: number,
|
|
21
|
-
): T[] {
|
|
22
|
-
let index = 0;
|
|
23
|
-
const list: T[] = [];
|
|
24
|
-
|
|
25
|
-
while (index < count) {
|
|
26
|
-
list.push(callback(index, count));
|
|
27
|
-
index += 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return list;
|
|
31
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|