@remotion/noise 4.0.50 → 4.0.52
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.
|
@@ -3,100 +3,93 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
4
|
const index_1 = require("../index");
|
|
5
5
|
// Make Node.JS 14 pass
|
|
6
|
-
|
|
7
|
-
(0,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(0, vitest_1.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(0,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(0,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(0,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(0,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const end2 = performance.now();
|
|
97
|
-
const time2 = end2 - start2;
|
|
98
|
-
(0, vitest_1.expect)(time2 * 4).toBeGreaterThan(time);
|
|
99
|
-
}, {
|
|
100
|
-
retry: 2,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
6
|
+
(0, vitest_1.test)('Noise should be deterministic', () => {
|
|
7
|
+
const noise1 = (0, index_1.noise2D)(1, 0, 0);
|
|
8
|
+
const noise2 = (0, index_1.noise2D)(1, 0, 0);
|
|
9
|
+
(0, vitest_1.expect)(noise1).toBe(noise2);
|
|
10
|
+
(0, vitest_1.expect)(noise1).toBe(0);
|
|
11
|
+
(0, vitest_1.expect)((0, index_1.noise2D)('my-seed', 0.5, 0.5)).toBe(0.3071565136272162);
|
|
12
|
+
(0, vitest_1.expect)((0, index_1.noise3D)('my-seed', 0.7, 0.5, 0.5)).toBe(0.6402128434567901);
|
|
13
|
+
(0, vitest_1.expect)((0, index_1.noise4D)('my-seed', 0.7, 0.5, 0.5, 0.9)).toBe(0.2714290963058814);
|
|
14
|
+
}, { retry: 2 });
|
|
15
|
+
(0, vitest_1.test)('Noise should be cached', () => {
|
|
16
|
+
const start = performance.now();
|
|
17
|
+
(0, index_1.noise2D)('new-seed', 0.5, 0.5);
|
|
18
|
+
const end = performance.now();
|
|
19
|
+
const time = end - start;
|
|
20
|
+
const start2 = performance.now();
|
|
21
|
+
(0, index_1.noise2D)('new-seed', 0.5, 0.5);
|
|
22
|
+
const end2 = performance.now();
|
|
23
|
+
const time2 = end2 - start2;
|
|
24
|
+
(0, vitest_1.expect)(time2 * 10).toBeLessThan(time);
|
|
25
|
+
}, { retry: 2 });
|
|
26
|
+
(0, vitest_1.test)('Should only keep 10 cache entries', () => {
|
|
27
|
+
const start = performance.now();
|
|
28
|
+
(0, index_1.noise2D)('seed-1', 0.5, 0.5);
|
|
29
|
+
const end = performance.now();
|
|
30
|
+
const time = end - start;
|
|
31
|
+
(0, index_1.noise2D)('seed-2', 0.5, 0.5);
|
|
32
|
+
(0, index_1.noise2D)('seed-3', 0.5, 0.5);
|
|
33
|
+
(0, index_1.noise2D)('seed-4', 0.5, 0.5);
|
|
34
|
+
(0, index_1.noise2D)('seed-5', 0.5, 0.5);
|
|
35
|
+
(0, index_1.noise2D)('seed-6', 0.5, 0.5);
|
|
36
|
+
(0, index_1.noise2D)('seed-7', 0.5, 0.5);
|
|
37
|
+
(0, index_1.noise2D)('seed-8', 0.5, 0.5);
|
|
38
|
+
(0, index_1.noise2D)('seed-9', 0.5, 0.5);
|
|
39
|
+
(0, index_1.noise2D)('seed-10', 0.5, 0.5);
|
|
40
|
+
(0, index_1.noise2D)('seed-11', 0.5, 0.5);
|
|
41
|
+
(0, index_1.noise2D)('seed-12', 0.5, 0.5);
|
|
42
|
+
const start2 = performance.now();
|
|
43
|
+
(0, index_1.noise2D)('seed-1', 0.5, 0.5);
|
|
44
|
+
const end2 = performance.now();
|
|
45
|
+
const time2 = end2 - start2;
|
|
46
|
+
(0, vitest_1.expect)(time2 * 4).toBeGreaterThan(time);
|
|
47
|
+
}, {
|
|
48
|
+
retry: 2,
|
|
49
|
+
});
|
|
50
|
+
(0, vitest_1.test)('Should only keep 10 cache entries (3D)', () => {
|
|
51
|
+
const start = performance.now();
|
|
52
|
+
(0, index_1.noise3D)('seed-1', 0.5, 0.5, 0.8);
|
|
53
|
+
const end = performance.now();
|
|
54
|
+
const time = end - start;
|
|
55
|
+
(0, index_1.noise3D)('seed-2', 0.5, 0.5, 0.8);
|
|
56
|
+
(0, index_1.noise3D)('seed-3', 0.5, 0.5, 0.8);
|
|
57
|
+
(0, index_1.noise3D)('seed-4', 0.5, 0.5, 0.8);
|
|
58
|
+
(0, index_1.noise3D)('seed-5', 0.5, 0.5, 0.8);
|
|
59
|
+
(0, index_1.noise3D)('seed-6', 0.5, 0.5, 0.8);
|
|
60
|
+
(0, index_1.noise3D)('seed-7', 0.5, 0.5, 0.8);
|
|
61
|
+
(0, index_1.noise3D)('seed-8', 0.5, 0.5, 0.8);
|
|
62
|
+
(0, index_1.noise3D)('seed-9', 0.5, 0.5, 0.8);
|
|
63
|
+
(0, index_1.noise3D)('seed-10', 0.5, 0, 0.85);
|
|
64
|
+
(0, index_1.noise3D)('seed-11', 0.5, 0, 0.85);
|
|
65
|
+
(0, index_1.noise3D)('seed-12', 0.5, 0, 0.85);
|
|
66
|
+
const start2 = performance.now();
|
|
67
|
+
(0, index_1.noise3D)('seed-1', 0.5, 0.5, 0.8);
|
|
68
|
+
const end2 = performance.now();
|
|
69
|
+
const time2 = end2 - start2;
|
|
70
|
+
(0, vitest_1.expect)(time2 * 4).toBeGreaterThan(time);
|
|
71
|
+
}, { retry: 2 });
|
|
72
|
+
(0, vitest_1.test)('Should only keep 10 cache entries (4D)', () => {
|
|
73
|
+
const start = performance.now();
|
|
74
|
+
(0, index_1.noise4D)('seed-1', 0.5, 0.5, 0.8, 9);
|
|
75
|
+
const end = performance.now();
|
|
76
|
+
const time = end - start;
|
|
77
|
+
(0, index_1.noise4D)('seed-2', 0.5, 0.5, 0.8, 9);
|
|
78
|
+
(0, index_1.noise4D)('seed-3', 0.5, 0.5, 0.8, 9);
|
|
79
|
+
(0, index_1.noise4D)('seed-4', 0.5, 0.5, 0.8, 9);
|
|
80
|
+
(0, index_1.noise4D)('seed-5', 0.5, 0.5, 0.8, 9);
|
|
81
|
+
(0, index_1.noise4D)('seed-6', 0.5, 0.5, 0.8, 9);
|
|
82
|
+
(0, index_1.noise4D)('seed-7', 0.5, 0.5, 0.8, 9);
|
|
83
|
+
(0, index_1.noise4D)('seed-8', 0.5, 0.5, 0.8, 9);
|
|
84
|
+
(0, index_1.noise4D)('seed-9', 0.5, 0.5, 0.8, 9);
|
|
85
|
+
(0, index_1.noise4D)('seed-10', 0.5, 0, 0.85, 9);
|
|
86
|
+
(0, index_1.noise4D)('seed-11', 0.5, 0, 0.85, 9);
|
|
87
|
+
(0, index_1.noise4D)('seed-12', 0.5, 0, 0.85, 9);
|
|
88
|
+
const start2 = performance.now();
|
|
89
|
+
(0, index_1.noise4D)('seed-1', 0.5, 0.5, 0.8, 9);
|
|
90
|
+
const end2 = performance.now();
|
|
91
|
+
const time2 = end2 - start2;
|
|
92
|
+
(0, vitest_1.expect)(time2 * 4).toBeGreaterThan(time);
|
|
93
|
+
}, {
|
|
94
|
+
retry: 2,
|
|
95
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/noise",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.52",
|
|
4
4
|
"description": "Noise effect for Remotion",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"simplex-noise": "4.0.1",
|
|
33
|
-
"remotion": "4.0.
|
|
33
|
+
"remotion": "4.0.52"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@jonny/eslint-config": "3.0.276",
|