"use strict";
/*
 * @poppinss/utils
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.slash = void 0;
/**
 * Convert windows path to unix.
 * Copied from https://github.com/sindresorhus/slash as the package is ESM only
 */
function slash(filePath) {
    const isExtendedLengthPath = /^\\\\\?\\/.test(filePath);
    const hasNonAscii = /[^\u0000-\u0080]+/.test(filePath); // eslint-disable-line no-control-regex
    if (isExtendedLengthPath || hasNonAscii) {
        return filePath;
    }
    return filePath.replace(/\\/g, '/');
}
exports.slash = slash;
