github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/@actions/core/lib/path-utils.js (about)

     1  "use strict";
     2  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
     3      if (k2 === undefined) k2 = k;
     4      Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
     5  }) : (function(o, m, k, k2) {
     6      if (k2 === undefined) k2 = k;
     7      o[k2] = m[k];
     8  }));
     9  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    10      Object.defineProperty(o, "default", { enumerable: true, value: v });
    11  }) : function(o, v) {
    12      o["default"] = v;
    13  });
    14  var __importStar = (this && this.__importStar) || function (mod) {
    15      if (mod && mod.__esModule) return mod;
    16      var result = {};
    17      if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    18      __setModuleDefault(result, mod);
    19      return result;
    20  };
    21  Object.defineProperty(exports, "__esModule", { value: true });
    22  exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
    23  const path = __importStar(require("path"));
    24  /**
    25   * toPosixPath converts the given path to the posix form. On Windows, \\ will be
    26   * replaced with /.
    27   *
    28   * @param pth. Path to transform.
    29   * @return string Posix path.
    30   */
    31  function toPosixPath(pth) {
    32      return pth.replace(/[\\]/g, '/');
    33  }
    34  exports.toPosixPath = toPosixPath;
    35  /**
    36   * toWin32Path converts the given path to the win32 form. On Linux, / will be
    37   * replaced with \\.
    38   *
    39   * @param pth. Path to transform.
    40   * @return string Win32 path.
    41   */
    42  function toWin32Path(pth) {
    43      return pth.replace(/[/]/g, '\\');
    44  }
    45  exports.toWin32Path = toWin32Path;
    46  /**
    47   * toPlatformPath converts the given path to a platform-specific path. It does
    48   * this by replacing instances of / and \ with the platform-specific path
    49   * separator.
    50   *
    51   * @param pth The path to platformize.
    52   * @return string The platform-specific path.
    53   */
    54  function toPlatformPath(pth) {
    55      return pth.replace(/[/\\]/g, path.sep);
    56  }
    57  exports.toPlatformPath = toPlatformPath;
    58  //# sourceMappingURL=path-utils.js.map