File tree Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 4
4
ArrayLike copying for JavaScript.
5
5
See [ docs] ( https://array-like.github.io/copy/index.html ) .
6
6
7
- > :building_construction : Caveat emptor! This is work in progress. Code may be
8
- > working. Documentation may be present. Coherence may be. Maybe.
7
+ ``` js
8
+ import {range } from ' @iterable-iterator/range' ;
9
+ const n = 100 ;
10
+ const a = Array .from (range (n))
11
+ const ai = 0 ;
12
+ const aj = n;
13
+ const b = new Uint8Array (n);
14
+ const bi = 0 ;
9
15
10
- > : warning : Depending on your environment, the code may require
11
- > ` regeneratorRuntime ` to be defined, for instance by importing
12
- > [ regenerator-runtime/runtime ] ( https://www.npmjs.com/package/regenerator-runtime ) .
16
+ import { copy } from ' @array-like/copy ' ;
17
+ copy (a, ai, aj, b, bi);
18
+ ```
13
19
14
20
[ ![ License] ( https://img.shields.io/github/license/array-like/copy.svg )] ( https://raw.githubusercontent.com/array-like/copy/main/LICENSE )
15
21
[ ![ Version] ( https://img.shields.io/npm/v/@array-like/copy.svg )] ( https://www.npmjs.org/package/@array-like/copy )
Original file line number Diff line number Diff line change 1
1
# Usage
2
2
3
- > :warning : Depending on your environment, the code may require
4
- > ` regeneratorRuntime ` to be defined, for instance by importing
5
- > [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
6
-
7
- First, require the polyfill at the entry point of your application
8
- ``` js
9
- await import (' regenerator-runtime/runtime.js' );
10
- // or
11
- import ' regenerator-runtime/runtime.js' ;
12
- ```
13
-
14
- Then, import the library where needed
3
+ Import the library where needed
15
4
``` js
16
5
const copy = await import (' @array-like/copy' );
17
6
// or
You can’t perform that action at this time.
0 commit comments