Spaces:
Runtime error
Runtime error
Download src/utils/vendorCode.js from yeshwanth-kr/dss-server: direct link, hf CLI and curl.
- Browser
- Download file 512 Bytes
-
https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/utils/vendorCode.js
- Command line
-
hf download hf://spaces/yeshwanth-kr/dss-server/src/utils/vendorCode.js
-
curl -L -o vendorCode.js https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/utils/vendorCode.js
512 Bytes
| const VENDOR_CODE_REGEX = /^([A-Z]{4})-DSS-(\d{2})-(\d{3})$/; | |
| function normalizeVendorCode(value) { | |
| return String(value || '').trim().toUpperCase(); | |
| } | |
| function parseVendorCode(value) { | |
| const normalized = normalizeVendorCode(value); | |
| const match = normalized.match(VENDOR_CODE_REGEX); | |
| if (!match) { | |
| return null; | |
| } | |
| return { | |
| normalized, | |
| name4: match[1], | |
| year: match[2], | |
| sequence: match[3] | |
| }; | |
| } | |
| module.exports = { | |
| VENDOR_CODE_REGEX, | |
| normalizeVendorCode, | |
| parseVendorCode | |
| }; | |