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
1717to include it with common js module you should do this:
1818
1919``` js
20- var randomArrayElement = require (' @smakss/random-array-element' );
20+ var randomArrayElement = require (" @smakss/random-array-element" );
2121```
2222
2323and to include it with ECMAscript module you can simply do this one:
2424
2525``` js
26- import randomArrayElement from ' @smakss/random-array-element' ;
26+ import randomArrayElement from " @smakss/random-array-element" ;
2727```
2828
2929then to use it within your application you can do it just like this:
@@ -36,7 +36,7 @@ const chooser = randomArrayElement();
3636```
3737
3838``` js
39- const chooser = randomArrayElement ([' Foo' , ' Bar' , ' FU ' , ' FooBar' ]);
39+ const chooser = randomArrayElement ([" Foo" , " Bar" , " FU " , " FooBar" ]);
4040// Initiating the selector once and then we can use the returned function to select random none repeatable elements from the array.
4141
4242chooser ();
@@ -59,3 +59,7 @@ chooser();
5959## Demo
6060
6161You 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 11{
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+ },
46 "description" : " Selects a random unique array element without repetition from provided array." ,
5- "type" : " module" ,
6- "main" : " ./index.cjs" ,
77 "exports" : {
88 "import" : " ./index.mjs" ,
99 "require" : " ./index.cjs"
1010 },
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" ,
1512 "keywords" : [
1613 " npm" ,
1714 " yarn" ,
2522 " random-element-without-repeat" ,
2623 " random-array-element-without-repetition"
2724 ],
28- "author" : " SMAKSS" ,
2925 "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"
3231 },
33- "homepage" : " https://github.com/SMAKSS/random-array-element#readme"
32+ "type" : " module" ,
33+ "version" : " 1.2.4"
3434}
You can’t perform that action at this time.
0 commit comments