socket-function 0.134.0 → 0.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/require/require.ts +6 -2
package/package.json
CHANGED
package/require/require.ts
CHANGED
|
@@ -480,6 +480,10 @@ export function requireMain() {
|
|
|
480
480
|
|
|
481
481
|
function createRequire(module: ModuleType, serializedModule: SerializedModule, asyncIsFineOuter?: boolean) {
|
|
482
482
|
require.cache = moduleCache;
|
|
483
|
+
// Dynamically get folder, incase our filename changes
|
|
484
|
+
function getModuleFolder() {
|
|
485
|
+
return module.filename.replace(/\\/g, "/").split("/").slice(0, -1).join("/") + "/";
|
|
486
|
+
}
|
|
483
487
|
function resolve(request: string) {
|
|
484
488
|
let requests = serializedModule.requests;
|
|
485
489
|
if (request in requests) {
|
|
@@ -487,7 +491,7 @@ export function requireMain() {
|
|
|
487
491
|
}
|
|
488
492
|
let absolutePath = request;
|
|
489
493
|
if (absolutePath.startsWith("./") || absolutePath.startsWith("../")) {
|
|
490
|
-
let folderParts =
|
|
494
|
+
let folderParts = getModuleFolder().split("/");
|
|
491
495
|
while (absolutePath.startsWith("./") || absolutePath.startsWith("../")) {
|
|
492
496
|
if (absolutePath.startsWith("./")) {
|
|
493
497
|
absolutePath = absolutePath.slice("./".length);
|
|
@@ -505,7 +509,6 @@ export function requireMain() {
|
|
|
505
509
|
return absolutePath;
|
|
506
510
|
}
|
|
507
511
|
require.resolve = resolve;
|
|
508
|
-
let moduleFolder = module.filename.replace(/\\/g, "/").split("/").slice(0, -1).join("/") + "/";
|
|
509
512
|
return require;
|
|
510
513
|
function require(request: string, asyncIsFine?: boolean) {
|
|
511
514
|
if (asyncIsFineOuter) {
|
|
@@ -792,6 +795,7 @@ export function requireMain() {
|
|
|
792
795
|
},
|
|
793
796
|
},
|
|
794
797
|
module.exports,
|
|
798
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
795
799
|
module.require,
|
|
796
800
|
module,
|
|
797
801
|
module.filename,
|