-const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;\r
-const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/;\r
-//RFC 4122\r
-const handler = {\r
- scheme: "urn:uuid",\r
- parse: function (urnComponents, options) {\r
- const uuidComponents = urnComponents;\r
- uuidComponents.uuid = uuidComponents.nss;\r
- uuidComponents.nss = undefined;\r
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\r
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";\r
- }\r
- return uuidComponents;\r
- },\r
- serialize: function (uuidComponents, options) {\r
- const urnComponents = uuidComponents;\r
- //normalize UUID\r
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();\r
- return urnComponents;\r
- },\r
-};\r
-export default handler;\r
+const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
+const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/;
+//RFC 4122
+const handler = {
+ scheme: "urn:uuid",
+ parse: function (urnComponents, options) {
+ const uuidComponents = urnComponents;
+ uuidComponents.uuid = uuidComponents.nss;
+ uuidComponents.nss = undefined;
+ if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
+ }
+ return uuidComponents;
+ },
+ serialize: function (uuidComponents, options) {
+ const urnComponents = uuidComponents;
+ //normalize UUID
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
+ return urnComponents;
+ },
+};
+export default handler;