hrefInfo.js 759 B

123456789101112131415161718192021
  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;