@rss/common
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -5,5 +5,5 @@ 'use strict'; | ||
UC: { | ||
'03': /^UC\d{10}$|^3415925DA\w{6,31}$/ | ||
'03': /^UC\d{10}$|^3415925DA\w{6,31}$|^(201[8-9]|20[2-9]\d{1}|2[1-9]\d{2}|[3-9]\d{3})\d{19}[1-9]$/ | ||
}, | ||
DEFAULT: /^UC\d{10}$/ | ||
}; |
{ | ||
"name": "@rss/common", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "common constant, classes, & helper", | ||
@@ -5,0 +5,0 @@ "author": "Risk & Safety Solution", |
module.exports = { | ||
UC: { | ||
'03': /^UC\d{10}$|^3415925DA\w{6,31}$/, | ||
'03': /^UC\d{10}$|^3415925DA\w{6,31}$|^(201[8-9]|20[2-9]\d{1}|2[1-9]\d{2}|[3-9]\d{3})\d{19}[1-9]$/, | ||
}, | ||
DEFAULT: /^UC\d{10}$/, | ||
}; |
@@ -30,2 +30,13 @@ const Helper = require('./helper'); | ||
}); | ||
it('should validate UC Davis barcodes', () => { | ||
const barcodePattern = new RegExp(Helper.getBarcodePattern({ tenantCode: 'UC', campusCode: '03' })); | ||
const defaultBarcode = 'UC0000000001'; | ||
const davisBarcode1 = '3415925DA0000000000008D4'; | ||
const davisBarcode2 = '201800000000000000000001'; | ||
expect(barcodePattern.test(defaultBarcode)).toBeTruthy(); | ||
expect(barcodePattern.test(davisBarcode1)).toBeTruthy(); | ||
expect(barcodePattern.test(davisBarcode2)).toBeTruthy(); | ||
}); | ||
}); |
696025
209
11738