@@ -30,27 +30,30 @@ The maintainers of `core-js` and thousands of other packages are working with Ti
30
30
31
31
---
32
32
33
- [ * Example of usage* ] ( https://is.gd/yHurcF ) :
33
+ [ * Example of usage* ] ( https://is.gd/FdIG6n ) :
34
34
``` js
35
35
import ' core-js' ; // <- at the top of your entry point
36
36
37
37
Array .from (new Set ([1 , 2 , 3 , 2 , 1 ])); // => [1, 2, 3]
38
38
[1 , 2 , 3 , 4 ].findLast (it => it % 2 ); // => 3
39
39
Promise .resolve (42 ).then (x => console .log (x)); // => 42
40
+ structuredClone (new Set ([1 , 2 , 3 ])); // => new Set([1, 2, 3])
40
41
queueMicrotask (() => console .log (' called as microtask' ));
41
42
```
42
43
43
44
* You can load only required features* :
44
45
``` js
45
- import ' core-js/actual/array/from' ; // <- at the top of your entry point
46
- import ' core-js/actual/array/find-last' ; // <- at the top of your entry point
47
- import ' core-js/actual/set' ; // <- at the top of your entry point
48
- import ' core-js/actual/promise' ; // <- at the top of your entry point
49
- import ' core-js/actual/queue-microtask' ; // <- at the top of your entry point
46
+ import ' core-js/actual/array/from' ; // <- at the top of your entry point
47
+ import ' core-js/actual/array/find-last' ; // <- at the top of your entry point
48
+ import ' core-js/actual/set' ; // <- at the top of your entry point
49
+ import ' core-js/actual/promise' ; // <- at the top of your entry point
50
+ import ' core-js/actual/structured-clone' ; // <- at the top of your entry point
51
+ import ' core-js/actual/queue-microtask' ; // <- at the top of your entry point
50
52
51
53
Array .from (new Set ([1 , 2 , 3 , 2 , 1 ])); // => [1, 2, 3]
52
54
[1 , 2 , 3 , 4 ].findLast (it => it % 2 ); // => 3
53
55
Promise .resolve (42 ).then (x => console .log (x)); // => 42
56
+ structuredClone (new Set ([1 , 2 , 3 ])); // => new Set([1, 2, 3])
54
57
queueMicrotask (() => console .log (' called as microtask' ));
55
58
```
56
59
@@ -60,11 +63,13 @@ import from from 'core-js-pure/actual/array/from';
60
63
import findLast from ' core-js-pure/actual/array/find-last' ;
61
64
import Set from ' core-js-pure/actual/set' ;
62
65
import Promise from ' core-js-pure/actual/promise' ;
66
+ import structuredClone from ' core-js-pure/actual/structured-clone' ;
63
67
import queueMicrotask from ' core-js-pure/actual/queue-microtask' ;
64
68
65
69
from (new Set ([1 , 2 , 3 , 2 , 1 ])); // => [1, 2, 3]
66
70
findLast ([1 , 2 , 3 , 4 ], it => it % 2 ); // => 3
67
71
Promise .resolve (42 ).then (x => console .log (x)); // => 42
72
+ structuredClone (new Set ([1 , 2 , 3 ])); // => new Set([1, 2, 3])
68
73
queueMicrotask (() => console .log (' called as microtask' ));
69
74
```
70
75
0 commit comments