IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

detect-uuids.js 574B

123456789101112131415161718192021222324252627
  1. function detectUuids(obj) {
  2. let Q = [ obj ];
  3. let matches = {};
  4. while (Q.length > 0) {
  5. let item = Q.pop();
  6. if (!item)
  7. continue;
  8. if (typeof(item) === 'string') {
  9. // use regexes
  10. let rx = /[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/g;
  11. for (let m = rx.exec(item); m; m = rx.exec(item))
  12. matches[m[0]] = true;
  13. } else if (typeof(item) === 'object') {
  14. Object.keys(item).map(k => Q.push(item[k]));
  15. }
  16. }
  17. matches = Object.keys(matches);
  18. return matches;
  19. }
  20. export default detectUuids;