{"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","meta","url","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","util","vm","zlib","packages","console","module","process","packagesWithNodeProtocol","packageName","packagePath","Object","entries"],"mappings":";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