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.

24 lines
705 B

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var path = require("path");
  4. /**
  5. * Returns «true» if the last partial of the path starting with a period.
  6. */
  7. function isDotDirectory(filepath) {
  8. return path.basename(filepath).startsWith('.');
  9. }
  10. exports.isDotDirectory = isDotDirectory;
  11. /**
  12. * Convert a windows-like path to a unix-style path.
  13. */
  14. function normalize(filepath) {
  15. return filepath.replace(/\\/g, '/');
  16. }
  17. exports.normalize = normalize;
  18. /**
  19. * Returns normalized absolute path of provided filepath.
  20. */
  21. function makeAbsolute(cwd, filepath) {
  22. return normalize(path.resolve(cwd, filepath));
  23. }
  24. exports.makeAbsolute = makeAbsolute;