/**1* @license2* Copyright 2022 The Emscripten Authors3* SPDX-License-Identifier: MIT4*/56// This implementation ensures that Windows-style paths are being7// used when running on a Windows operating system - see:8// https://nodejs.org/api/path.html#path_windows_vs_posix9// It's only used/needed when linking with `-sNODERAWFS`, as that10// will replace all normal filesystem access with direct Node.js11// operations. Hence, using `nodePath` should be safe here.1213addToLibrary({14$nodePath: "require('path')",15$PATH__deps: ['$nodePath'],16$PATH: `{17isAbs: nodePath.isAbsolute,18normalize: nodePath.normalize,19dirname: nodePath.dirname,20basename: nodePath.basename,21join: nodePath.join,22join2: nodePath.join,23}`,24// The FS-using parts are split out into a separate object, so simple path25// usage does not require the FS.26$PATH_FS__deps: ['$FS', '$nodePath'],27$PATH_FS__docs: '/** @type{{resolve: function(...*)}} */',28$PATH_FS: {29resolve: (...paths) => {30paths.unshift(FS.cwd());31return nodePath.posix.resolve(...paths);32},33relative: (from, to) => nodePath.posix.relative(from || FS.cwd(), to || FS.cwd()),34}35});363738