MCPcopy Index your code
hub / github.com/nodejs/node / validateUUID

Function validateUUID

deps/npm/lib/utils/validate-uuid.js:4–8  ·  view source on GitHub ↗
(value, fieldName)

Source from the content-addressed store, hash-verified

2const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
3
4const validateUUID = (value, fieldName) => {
5 if (!UUID_REGEX.test(value)) {
6 throw new Error(`${fieldName} must be a valid UUID`)
7 }
8}
9
10module.exports = { UUID_REGEX, validateUUID }

Callers 5

validateUuidMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85

Calls 1

testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…