You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
759 B

4 years ago
  1. "use strict";
  2. function hrefInfo(urlObj)
  3. {
  4. var minimumPathOnly = (!urlObj.scheme && !urlObj.auth && !urlObj.host.full && !urlObj.port);
  5. var minimumResourceOnly = (minimumPathOnly && !urlObj.path.absolute.string);
  6. var minimumQueryOnly = (minimumResourceOnly && !urlObj.resource);
  7. var minimumHashOnly = (minimumQueryOnly && !urlObj.query.string.full.length);
  8. var empty = (minimumHashOnly && !urlObj.hash);
  9. urlObj.extra.hrefInfo.minimumPathOnly = minimumPathOnly;
  10. urlObj.extra.hrefInfo.minimumResourceOnly = minimumResourceOnly;
  11. urlObj.extra.hrefInfo.minimumQueryOnly = minimumQueryOnly;
  12. urlObj.extra.hrefInfo.minimumHashOnly = minimumHashOnly;
  13. urlObj.extra.hrefInfo.empty = empty;
  14. }
  15. module.exports = hrefInfo;