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')
5
5
*/
6
6
7
7
export default function random ( ) {
8
- return uuid4 ( )
8
+ return uuid4 ( ) . replace ( / - / g , '' ) ;
9
9
}
Original file line number Diff line number Diff line change 1
1
import random from '../../src/random'
2
2
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}$/
4
5
5
6
6
7
describe ( 'random' , function ( ) {
7
- it ( 'should return a valid RFC4122 v4 guid' , function ( ) {
8
+ it ( 'should return a valid RFC4122 v4 guid (sans dashes) ' , function ( ) {
8
9
const rnd = random ( )
10
+ console . log ( rnd ) ;
9
11
rnd . should . match ( pattern )
10
12
} )
11
13
} )
You can’t perform that action at this time.
0 commit comments