{"version":3,"file":"index.js","sources":["../index.js"],"sourcesContent":["import createRequire from 'create-require';\nimport pkgDir from 'pkg-dir';\n\n/**\n * @param {string} path\n */\nconst resolvePath = (path) => {\n\tconst resolvedPath = (\n\t\tglobalThis.require ?? createRequire(import.meta.url)\n\t).resolve(path);\n\tif (!path.includes('./')) {\n\t\tconst directory = pkgDir.sync(resolvedPath) ?? '';\n\t\treturn directory;\n\t}\n\treturn resolvedPath;\n};\n\nconst assert = resolvePath('assert/');\nconst buffer = resolvePath('buffer/');\nconst child_process = resolvePath('./mock/empty.js');\nconst cluster = resolvePath('./mock/empty.js');\nconst _console = resolvePath('console-browserify');\nconst constants = resolvePath('constants-browserify');\nconst crypto = resolvePath('crypto-browserify');\nconst dgram = resolvePath('./mock/empty.js');\nconst dns = resolvePath('./mock/empty.js');\nconst domain = resolvePath('domain-browser');\nconst events = resolvePath('events/');\nconst fs = resolvePath('./mock/empty.js');\nconst http = resolvePath('stream-http');\nconst https = resolvePath('https-browserify');\nconst http2 = resolvePath('./mock/empty.js');\nconst _module = resolvePath('./mock/empty.js');\nconst net = resolvePath('./mock/empty.js');\nconst os = resolvePath('os-browserify/browser.js');\nconst path = resolvePath('path-browserify');\nconst punycode = resolvePath('punycode/');\nconst _process = resolvePath('process/browser.js');\nconst querystring = resolvePath('./proxy/querystring.js');\nconst readline = resolvePath('./mock/empty.js');\nconst repl = resolvePath('./mock/empty.js');\nconst stream = resolvePath('stream-browserify');\nconst _stream_duplex = resolvePath('readable-stream/lib/_stream_duplex.js');\nconst _stream_passthrough = resolvePath(\n\t'readable-stream/lib/_stream_passthrough.js'\n);\nconst _stream_readable = resolvePath('readable-stream/lib/_stream_readable.js');\nconst _stream_transform = resolvePath(\n\t'readable-stream/lib/_stream_transform.js'\n);\nconst _stream_writable = resolvePath('readable-stream/lib/_stream_writable.js');\nconst string_decoder = resolvePath('string_decoder/');\nconst sys = resolvePath('util/util.js');\nconst timers = resolvePath('timers-browserify');\nconst timersPromises = resolvePath('isomorphic-timers-promises');\nconst tls = resolvePath('./mock/empty.js');\nconst tty = resolvePath('tty-browserify');\nconst url = resolvePath('./proxy/url.js');\nconst util = resolvePath('util/util.js');\nconst vm = resolvePath('vm-browserify');\nconst zlib = resolvePath('browserify-zlib');\n\nconst packages = {\n\tassert,\n\tbuffer,\n\tchild_process,\n\tcluster,\n\tconsole: _console,\n\tconstants,\n\tcrypto,\n\tdgram,\n\tdns,\n\tdomain,\n\tevents,\n\tfs,\n\thttp,\n\thttps,\n\thttp2,\n\tmodule: _module,\n\tnet,\n\tos,\n\tpath,\n\tpunycode,\n\tprocess: _process,\n\tquerystring,\n\treadline,\n\trepl,\n\tstream,\n\t_stream_duplex,\n\t_stream_passthrough,\n\t_stream_readable,\n\t_stream_transform,\n\t_stream_writable,\n\tstring_decoder,\n\tsys,\n\t'timers/promises': timersPromises,\n\ttimers,\n\ttls,\n\ttty,\n\turl,\n\tutil,\n\tvm,\n\tzlib\n};\n\n/** @typedef {typeof packages} Packages */\n/** @typedef {keyof Packages} PackageNames */\n/** @typedef {{ [Property in PackageNames as `node:${Property}`]: Packages[Property] }} NodeProtocolPackages */\n\nconst packagesWithNodeProtocol = /** @type NodeProtocolPackages */ ({});\nfor (const [packageName, packagePath] of Object.entries(packages)) {\n\tpackagesWithNodeProtocol[\n\t\t`node:${/** @type PackageNames */ (packageName)}`\n\t] = /** @type PackageNames */ packagePath;\n}\n\nexport default {\n\t...packages,\n\t...packagesWithNodeProtocol\n};\n"],"names":["resolvePath","path","_globalThis$require","resolvedPath","_globalThis","require","createRequire","import","resolve","includes","_pkgDir$sync","directory","pkgDir","sync","assert","buffer","child_process","cluster","_console","constants","crypto","dgram","dns","domain","events","fs","http","https","http2","_module","net","os","punycode","_process","querystring","readline","repl","stream","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_writable","string_decoder","sys","timers","timersPromises","tls","tty","url","util","vm","zlib","packages","console","module","process","packagesWithNodeProtocol","packageName","packagePath","Object","entries"],"mappings":";;;;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