File tree Expand file tree Collapse file tree 2 files changed +19
-15
lines changed Expand file tree Collapse file tree 2 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ yarn add @smakss/random-array-element
17
17
to include it with common js module you should do this:
18
18
19
19
``` js
20
- var randomArrayElement = require (' @smakss/random-array-element' );
20
+ var randomArrayElement = require (" @smakss/random-array-element" );
21
21
```
22
22
23
23
and to include it with ECMAscript module you can simply do this one:
24
24
25
25
``` js
26
- import randomArrayElement from ' @smakss/random-array-element' ;
26
+ import randomArrayElement from " @smakss/random-array-element" ;
27
27
```
28
28
29
29
then to use it within your application you can do it just like this:
@@ -36,7 +36,7 @@ const chooser = randomArrayElement();
36
36
```
37
37
38
38
``` js
39
- const chooser = randomArrayElement ([' Foo' , ' Bar' , ' FU ' , ' FooBar' ]);
39
+ const chooser = randomArrayElement ([" Foo" , " Bar" , " FU " , " FooBar" ]);
40
40
// Initiating the selector once and then we can use the returned function to select random none repeatable elements from the array.
41
41
42
42
chooser ();
@@ -59,3 +59,7 @@ chooser();
59
59
## Demo
60
60
61
61
You can check the [ working demo] ( https://runkit.com/smakss/random-array-element ) in runkit.
62
+
63
+ or
64
+
65
+ [ ![ View @smakss/random-array-element ] ( https://codesandbox.io/static/img/play-codesandbox.svg )] ( https://codesandbox.io/s/smakss-random-array-element-7yizos?fontsize=14&hidenavigation=1&theme=dark )
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " @smakss/random-array-element" ,
3
- "version" : " 1.2.3" ,
2
+ "author" : " SMAKSS" ,
3
+ "bugs" : {
4
+ "url" : " https://github.com/SMAKSS/random-array-element/issues"
5
+ },
4
6
"description" : " Selects a random unique array element without repetition from provided array." ,
5
- "type" : " module" ,
6
- "main" : " ./index.cjs" ,
7
7
"exports" : {
8
8
"import" : " ./index.mjs" ,
9
9
"require" : " ./index.cjs"
10
10
},
11
- "repository" : {
12
- "type" : " git" ,
13
- "url" : " git+https://github.com/SMAKSS/random-array-element.git"
14
- },
11
+ "homepage" : " https://github.com/SMAKSS/random-array-element#readme" ,
15
12
"keywords" : [
16
13
" npm" ,
17
14
" yarn" ,
25
22
" random-element-without-repeat" ,
26
23
" random-array-element-without-repetition"
27
24
],
28
- "author" : " SMAKSS" ,
29
25
"license" : " MIT" ,
30
- "bugs" : {
31
- "url" : " https://github.com/SMAKSS/random-array-element/issues"
26
+ "main" : " ./index.cjs" ,
27
+ "name" : " @smakss/random-array-element" ,
28
+ "repository" : {
29
+ "type" : " git" ,
30
+ "url" : " git+https://github.com/SMAKSS/random-array-element.git"
32
31
},
33
- "homepage" : " https://github.com/SMAKSS/random-array-element#readme"
32
+ "type" : " module" ,
33
+ "version" : " 1.2.4"
34
34
}
You can’t perform that action at this time.
0 commit comments