File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ var uuid4 = require('uuid/v4')
55 */
66
77export default function random ( ) {
8- return uuid4 ( )
8+ return uuid4 ( ) . replace ( / - / g , '' ) ;
99}
Original file line number Diff line number Diff line change 11import random from '../../src/random'
22
3- const pattern = / ^ [ 0 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - 4 [ 0 - 9 a - f ] { 3 } - [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } - [ 0 - 9 a - f ] { 12 } $ /
3+ const pattern = / ^ [ 0 - 9 a - f ] { 8 } [ 0 - 9 a - f ] { 4 } 4 [ 0 - 9 a - f ] { 3 } [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } [ 0 - 9 a - f ] { 12 } $ /
4+ //const pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
45
56
67describe ( 'random' , function ( ) {
7- it ( 'should return a valid RFC4122 v4 guid' , function ( ) {
8+ it ( 'should return a valid RFC4122 v4 guid (sans dashes) ' , function ( ) {
89 const rnd = random ( )
10+ console . log ( rnd ) ;
911 rnd . should . match ( pattern )
1012 } )
1113} )
You can’t perform that action at this time.
0 commit comments