normalize_path_sep.js 527 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. /**
  6. * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  7. *
  8. * This source code is licensed under the MIT license found in the
  9. * LICENSE file in the root directory of this source tree.
  10. *
  11. *
  12. */
  13. const path = require('path');
  14. let normalizePathSep;
  15. if (path.sep === '/') {
  16. normalizePathSep = filePath => filePath;
  17. } else {
  18. normalizePathSep = filePath => filePath.replace(/\//g, path.sep);
  19. }
  20. exports.default = normalizePathSep;