Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

urn-uuid.js 868B

1234567891011121314151617181920212223
  1. const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
  2. const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/;
  3. //RFC 4122
  4. const handler = {
  5. scheme: "urn:uuid",
  6. parse: function (urnComponents, options) {
  7. const uuidComponents = urnComponents;
  8. uuidComponents.uuid = uuidComponents.nss;
  9. uuidComponents.nss = undefined;
  10. if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
  11. uuidComponents.error = uuidComponents.error || "UUID is not valid.";
  12. }
  13. return uuidComponents;
  14. },
  15. serialize: function (uuidComponents, options) {
  16. const urnComponents = uuidComponents;
  17. //normalize UUID
  18. urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
  19. return urnComponents;
  20. },
  21. };
  22. export default handler;
  23. //# sourceMappingURL=urn-uuid.js.map