@rindo/core 3.2.1 → 3.2.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/sys/node",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Rindo Node System.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Node System Worker v3.2.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System Worker v3.2.2 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Testing v3.2.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Testing v3.2.2 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -516,278 +516,7 @@ function mockCompilerCtx(e) {
516
516
  };
517
517
  return Object.defineProperty(t, "fs", {
518
518
  get() {
519
- return null == this._fs && (this._fs = (e => {
520
- const t = new Map, r = new Map, s = async (e, r = {}) => {
521
- e = normalizePath(e);
522
- const s = [];
523
- if (!0 === r.inMemoryOnly) {
524
- let n = e;
525
- n.endsWith("/") || (n += "/");
526
- const i = e.split("/");
527
- t.forEach(((t, n) => {
528
- if (!n.startsWith(e)) return;
529
- const a = n.split("/");
530
- if ((a.length === i.length + 1 || r.recursive && a.length > i.length) && t.exists) {
531
- const e = {
532
- absPath: n,
533
- relPath: a[i.length],
534
- isDirectory: t.isDirectory,
535
- isFile: t.isFile
536
- };
537
- o(r, e) || s.push(e);
538
- }
539
- }));
540
- } else await n(e, e, r, s);
541
- return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
542
- }, n = async (t, r, s, i) => {
543
- const a = await e.readDir(r);
544
- if (a.length > 0) {
545
- const e = E(r);
546
- e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map((async e => {
547
- const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), c = await l(r), u = {
548
- absPath: r,
549
- relPath: a,
550
- isDirectory: c.isDirectory,
551
- isFile: c.isFile
552
- };
553
- o(s, u) || (i.push(u), !0 === s.recursive && !0 === c.isDirectory && await n(t, r, s, i));
554
- })));
555
- }
556
- }, o = (e, t) => {
557
- if (t.isDirectory) {
558
- if (Array.isArray(e.excludeDirNames)) {
559
- const r = path$2.basename(t.absPath);
560
- if (e.excludeDirNames.some((e => r === e))) return !0;
561
- }
562
- } else if (Array.isArray(e.excludeExtensions)) {
563
- const r = t.relPath.toLowerCase();
564
- if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
565
- }
566
- return !1;
567
- }, i = async e => {
568
- const t = E(e);
569
- t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
570
- try {
571
- const t = await s(e, {
572
- recursive: !0
573
- });
574
- await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : a(e.absPath))));
575
- } catch (e) {}
576
- }, a = async e => {
577
- const t = E(e);
578
- t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
579
- }, l = async t => {
580
- const r = E(t);
581
- if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
582
- const s = await e.stat(t);
583
- s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
584
- r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
585
- r.isDirectory = !1, r.size = null));
586
- }
587
- return {
588
- exists: !!r.exists,
589
- isFile: !!r.isFile,
590
- isDirectory: !!r.isDirectory,
591
- size: "number" == typeof r.size ? r.size : 0
592
- };
593
- }, c = t => {
594
- const r = E(t);
595
- if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
596
- const s = e.statSync(t);
597
- s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
598
- r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
599
- r.isDirectory = !1, r.size = null));
600
- }
601
- return {
602
- exists: !!r.exists,
603
- isFile: !!r.isFile,
604
- isDirectory: !!r.isDirectory,
605
- size: r.size
606
- };
607
- }, u = async (t, s, n) => {
608
- if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
609
- if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
610
- const o = {
611
- ignored: !1,
612
- changedContent: !1,
613
- queuedWrite: !1
614
- };
615
- if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
616
- const i = E(t);
617
- if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
618
- "string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
619
- i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
620
- !1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
621
- await d(t, !0); else if (null != n && !0 === n.immediateWrite) {
622
- if (o.changedContent || !0 !== n.useCache) {
623
- const r = await e.readFile(t);
624
- "string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
625
- o.changedContent && (await d(t, !1), await e.writeFile(t, i.fileText));
626
- }
627
- } else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
628
- o.queuedWrite = !0);
629
- return o;
630
- }, d = async (e, t) => {
631
- const r = [];
632
- for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
633
- r.reverse(), await h(r, t);
634
- }, h = async (t, r) => {
635
- const s = [];
636
- for (const n of t) {
637
- const t = E(n);
638
- if (!0 !== t.exists || !0 !== t.isDirectory) try {
639
- t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(n), s.push(n);
640
- } catch (e) {}
641
- }
642
- return s;
643
- }, p = t => {
644
- const r = Promise.all(t.map((async t => {
645
- const [r, s] = t;
646
- return await e.copyFile(r, s), [ r, s ];
647
- })));
648
- return r;
649
- }, f = e => Promise.all(e.map((async e => {
650
- if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
651
- return m(e);
652
- }))), m = async t => {
653
- const r = E(t);
654
- if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
655
- return await e.writeFile(t, r.fileText), !1 === r.useCache && _(t), t;
656
- }, g = async t => await Promise.all(t.map((async t => {
657
- if ("string" != typeof t) throw new Error("unable to unlink without filePath");
658
- return await e.removeFile(t), t;
659
- }))), y = async t => {
660
- const r = [];
661
- for (const s of t) await e.removeDir(s), r.push(s);
662
- return r;
663
- }, w = e => {
664
- e = normalizePath(e), t.forEach(((t, r) => {
665
- const s = path$2.relative(e, r).split("/")[0];
666
- s.startsWith(".") || s.startsWith("/") || _(r);
667
- }));
668
- }, _ = e => {
669
- e = normalizePath(e);
670
- const r = t.get(e);
671
- null == r || r.queueWriteToDisk || t.delete(e);
672
- }, E = e => {
673
- e = normalizePath(e);
674
- let r = t.get(e);
675
- return null != r || t.set(e, r = {
676
- exists: null,
677
- fileText: null,
678
- size: null,
679
- mtimeMs: null,
680
- isDirectory: null,
681
- isFile: null,
682
- queueCopyFileToDest: null,
683
- queueDeleteFromDisk: null,
684
- queueWriteToDisk: null,
685
- useCache: null
686
- }), r;
687
- }, v = 5242880;
688
- return {
689
- access: async e => {
690
- const t = E(e);
691
- return "boolean" != typeof t.exists ? (await l(e)).exists : t.exists;
692
- },
693
- accessSync: e => {
694
- const t = E(e);
695
- return "boolean" != typeof t.exists ? c(e).exists : t.exists;
696
- },
697
- cancelDeleteDirectoriesFromDisk: e => {
698
- for (const t of e) {
699
- const e = E(t);
700
- !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
701
- }
702
- },
703
- cancelDeleteFilesFromDisk: e => {
704
- for (const t of e) {
705
- const e = E(t);
706
- !0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
707
- }
708
- },
709
- clearCache: () => {
710
- t.clear();
711
- },
712
- clearDirCache: w,
713
- clearFileCache: _,
714
- commit: async () => {
715
- const e = getCommitInstructions(t), r = await h(e.dirsToEnsure, !1), s = await f(e.filesToWrite), n = await p(e.filesToCopy), o = await g(e.filesToDelete), i = await y(e.dirsToDelete);
716
- return e.filesToDelete.forEach(_), e.dirsToDelete.forEach(w), {
717
- filesCopied: n,
718
- filesWritten: s,
719
- filesDeleted: o,
720
- dirsDeleted: i,
721
- dirsAdded: r
722
- };
723
- },
724
- copyFile: async (e, t) => {
725
- E(e).queueCopyFileToDest = t;
726
- },
727
- emptyDirs: async e => {
728
- e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
729
- e)), []);
730
- const t = await Promise.all(e.map((e => s(e, {
731
- recursive: !0
732
- })))), r = [];
733
- for (const e of t) for (const t of e) r.includes(t.absPath) || r.push(t.absPath);
734
- r.sort(((e, t) => {
735
- const r = e.split("/").length, s = t.split("/").length;
736
- return r < s ? 1 : r > s ? -1 : 0;
737
- })), await Promise.all(r.map(a)), e.forEach((e => {
738
- const t = E(e);
739
- t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
740
- }));
741
- },
742
- getBuildOutputs: () => {
743
- const e = [];
744
- return r.forEach(((t, r) => {
745
- const s = e.find((e => e.type === t));
746
- s ? s.files.push(r) : e.push({
747
- type: t,
748
- files: [ r ]
749
- });
750
- })), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
751
- },
752
- getItem: E,
753
- getMemoryStats: () => `data length: ${t.size}`,
754
- readFile: async (t, r) => {
755
- if (null == r || !0 === r.useCache || void 0 === r.useCache) {
756
- const e = E(t);
757
- if (e.exists && "string" == typeof e.fileText) return e.fileText;
758
- }
759
- const s = await e.readFile(t), n = E(t);
760
- return "string" == typeof s ? s.length < v && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
761
- n.fileText = s) : n.exists = !1, s;
762
- },
763
- readFileSync: (t, r) => {
764
- if (null == r || !0 === r.useCache || void 0 === r.useCache) {
765
- const e = E(t);
766
- if (e.exists && "string" == typeof e.fileText) return e.fileText;
767
- }
768
- const s = e.readFileSync(t), n = E(t);
769
- return "string" == typeof s ? s.length < v && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
770
- n.fileText = s) : n.exists = !1, s;
771
- },
772
- readdir: s,
773
- remove: async e => {
774
- const t = await l(e);
775
- !0 === t.isDirectory ? await i(e) : !0 === t.isFile && await a(e);
776
- },
777
- stat: l,
778
- statSync: c,
779
- sys: e,
780
- writeFile: u,
781
- writeFiles: (e, t) => {
782
- const r = [];
783
- return isIterable(e) ? e.forEach(((e, s) => {
784
- r.push(u(s, e, t));
785
- })) : Object.keys(e).map((s => {
786
- r.push(u(s, e[s], t));
787
- })), Promise.all(r);
788
- }
789
- };
790
- })(e.sys)), this._fs;
519
+ return null == this._fs && (this._fs = createInMemoryFs(e.sys)), this._fs;
791
520
  }
792
521
  }), Object.defineProperty(t, "cache", {
793
522
  get() {
@@ -1215,7 +944,7 @@ function getAppUrl(e, t, r) {
1215
944
  return t;
1216
945
  }
1217
946
 
1218
- var debug_1, constants$2, re_1, parseOptions_1, identifiers, semver, major_1, posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions, ERROR_MESSAGE, slice, toStr, implementation, functionBind, src, isCoreModule, realpathFS$1, defaultIsFile$1, defaultIsDir$1, defaultRealpath, maybeRealpath, defaultReadPackage, getPackageCandidates$1, async, current, core, mod, core_1, isCore, realpathFS, defaultIsFile, defaultIsDir, defaultRealpathSync, maybeRealpathSync, defaultReadPackageSync, getPackageCandidates, sync, resolve;
947
+ var debug_1, constants$2, re_1, parseOptions_1, identifiers, semver, major_1, posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions, slice, toStr, implementation, functionBind, src, isCoreModule, realpathFS$1, defaultIsFile$1, defaultIsDir$1, defaultRealpath, maybeRealpath, defaultReadPackage, getPackageCandidates$1, async, current, core, mod, core_1, isCore, realpathFS, defaultIsFile, defaultIsDir, defaultRealpathSync, maybeRealpathSync, defaultReadPackageSync, getPackageCandidates, sync, resolve;
1219
948
 
1220
949
  const rindo_js = require("../compiler/rindo.js"), appData = _lazyRequire("@rindo/core/internal/app-data"), testing = _lazyRequire("@rindo/core/internal/testing"), index_cjs = _lazyRequire("../mock-doc/index.cjs"), path$2 = require("path"), crypto$3 = require("crypto"), os$2 = require("os"), process$3 = require("process"), fs$2 = require("fs"), index_js = _lazyRequire("../dev-server/index.js"), child_process$2 = require("child_process"), path__default = _interopDefaultLegacy(path$2), os__namespace = _interopNamespace(os$2), process__namespace = _interopNamespace(process$3), fs__default = _interopDefaultLegacy(fs$2), debug = ("object" == typeof process && process.env,
1221
950
  () => {});
@@ -2160,6 +1889,279 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
2160
1889
  e.length = 0;
2161
1890
  }
2162
1891
  };
1892
+ }, createInMemoryFs = e => {
1893
+ const t = new Map, r = new Map, s = async (e, r = {}) => {
1894
+ e = normalizePath(e);
1895
+ const s = [];
1896
+ if (!0 === r.inMemoryOnly) {
1897
+ let n = e;
1898
+ n.endsWith("/") || (n += "/");
1899
+ const i = e.split("/");
1900
+ t.forEach(((t, n) => {
1901
+ if (!n.startsWith(e)) return;
1902
+ const a = n.split("/");
1903
+ if ((a.length === i.length + 1 || r.recursive && a.length > i.length) && t.exists) {
1904
+ const e = {
1905
+ absPath: n,
1906
+ relPath: a[i.length],
1907
+ isDirectory: t.isDirectory,
1908
+ isFile: t.isFile
1909
+ };
1910
+ o(r, e) || s.push(e);
1911
+ }
1912
+ }));
1913
+ } else await n(e, e, r, s);
1914
+ return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
1915
+ }, n = async (t, r, s, i) => {
1916
+ const l = await e.readDir(r);
1917
+ if (l.length > 0) {
1918
+ const e = m(r);
1919
+ e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(l.map((async e => {
1920
+ const r = normalizePath(e), l = normalizePath(path$2.relative(t, r)), c = await a(r), u = {
1921
+ absPath: r,
1922
+ relPath: l,
1923
+ isDirectory: c.isDirectory,
1924
+ isFile: c.isFile
1925
+ };
1926
+ o(s, u) || (i.push(u), !0 === s.recursive && !0 === c.isDirectory && await n(t, r, s, i));
1927
+ })));
1928
+ }
1929
+ }, o = (e, t) => {
1930
+ if (t.isDirectory) {
1931
+ if (Array.isArray(e.excludeDirNames)) {
1932
+ const r = path$2.basename(t.absPath);
1933
+ if (e.excludeDirNames.some((e => r === e))) return !0;
1934
+ }
1935
+ } else if (Array.isArray(e.excludeExtensions)) {
1936
+ const r = t.relPath.toLowerCase();
1937
+ if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
1938
+ }
1939
+ return !1;
1940
+ }, i = async e => {
1941
+ const t = m(e);
1942
+ t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
1943
+ }, a = async t => {
1944
+ const r = m(t);
1945
+ if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
1946
+ const s = await e.stat(t);
1947
+ s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
1948
+ r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
1949
+ r.isDirectory = !1, r.size = null));
1950
+ }
1951
+ return {
1952
+ exists: !!r.exists,
1953
+ isFile: !!r.isFile,
1954
+ isDirectory: !!r.isDirectory,
1955
+ size: "number" == typeof r.size ? r.size : 0
1956
+ };
1957
+ }, l = t => {
1958
+ const r = m(t);
1959
+ if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
1960
+ const s = e.statSync(t);
1961
+ s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
1962
+ r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
1963
+ r.isDirectory = !1, r.size = null));
1964
+ }
1965
+ return {
1966
+ exists: !!r.exists,
1967
+ isFile: !!r.isFile,
1968
+ isDirectory: !!r.isDirectory,
1969
+ size: r.size
1970
+ };
1971
+ }, c = async (t, s, n) => {
1972
+ if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
1973
+ if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
1974
+ const o = {
1975
+ ignored: !1,
1976
+ changedContent: !1,
1977
+ queuedWrite: !1
1978
+ };
1979
+ if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
1980
+ const i = m(t);
1981
+ if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
1982
+ "string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
1983
+ i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
1984
+ !1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
1985
+ await u(t, !0); else if (null != n && !0 === n.immediateWrite) {
1986
+ if (o.changedContent || !0 !== n.useCache) {
1987
+ const r = await e.readFile(t);
1988
+ "string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
1989
+ o.changedContent && (await u(t, !1), await e.writeFile(t, i.fileText));
1990
+ }
1991
+ } else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
1992
+ o.queuedWrite = !0);
1993
+ return o;
1994
+ }, u = async (e, t) => {
1995
+ const r = [];
1996
+ for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
1997
+ r.reverse(), await d(r, t);
1998
+ }, d = async (t, r) => {
1999
+ const s = [];
2000
+ for (const n of t) {
2001
+ const t = m(n);
2002
+ if (!0 !== t.exists || !0 !== t.isDirectory) try {
2003
+ t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(n), s.push(n);
2004
+ } catch (e) {}
2005
+ }
2006
+ return s;
2007
+ }, h = async t => {
2008
+ const r = m(t);
2009
+ if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
2010
+ return await e.writeFile(t, r.fileText), !1 === r.useCache && f(t), t;
2011
+ }, p = e => {
2012
+ e = normalizePath(e), t.forEach(((t, r) => {
2013
+ const s = path$2.relative(e, r).split("/")[0];
2014
+ s.startsWith(".") || s.startsWith("/") || f(r);
2015
+ }));
2016
+ }, f = e => {
2017
+ e = normalizePath(e);
2018
+ const r = t.get(e);
2019
+ null == r || r.queueWriteToDisk || t.delete(e);
2020
+ }, m = e => {
2021
+ e = normalizePath(e);
2022
+ let r = t.get(e);
2023
+ return null != r || t.set(e, r = {
2024
+ exists: null,
2025
+ fileText: null,
2026
+ size: null,
2027
+ mtimeMs: null,
2028
+ isDirectory: null,
2029
+ isFile: null,
2030
+ queueCopyFileToDest: null,
2031
+ queueDeleteFromDisk: null,
2032
+ queueWriteToDisk: null,
2033
+ useCache: null
2034
+ }), r;
2035
+ }, g = 5242880;
2036
+ return {
2037
+ access: async e => {
2038
+ const t = m(e);
2039
+ return "boolean" != typeof t.exists ? (await a(e)).exists : t.exists;
2040
+ },
2041
+ accessSync: e => {
2042
+ const t = m(e);
2043
+ return "boolean" != typeof t.exists ? l(e).exists : t.exists;
2044
+ },
2045
+ cancelDeleteDirectoriesFromDisk: e => {
2046
+ for (const t of e) {
2047
+ const e = m(t);
2048
+ !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
2049
+ }
2050
+ },
2051
+ cancelDeleteFilesFromDisk: e => {
2052
+ for (const t of e) {
2053
+ const e = m(t);
2054
+ !0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
2055
+ }
2056
+ },
2057
+ clearCache: () => {
2058
+ t.clear();
2059
+ },
2060
+ clearDirCache: p,
2061
+ clearFileCache: f,
2062
+ commit: async () => {
2063
+ const r = getCommitInstructions(t), s = await d(r.dirsToEnsure, !1), n = await (l = r.filesToWrite,
2064
+ Promise.all(l.map((async e => {
2065
+ if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
2066
+ return h(e);
2067
+ })))), o = await (t => {
2068
+ const r = Promise.all(t.map((async t => {
2069
+ const [r, s] = t;
2070
+ return await e.copyFile(r, s), [ r, s ];
2071
+ })));
2072
+ return r;
2073
+ })(r.filesToCopy), i = await (async t => await Promise.all(t.map((async t => {
2074
+ if ("string" != typeof t) throw new Error("unable to unlink without filePath");
2075
+ return await e.removeFile(t), t;
2076
+ }))))(r.filesToDelete), a = await (async t => {
2077
+ const r = [];
2078
+ for (const s of t) await e.removeDir(s), r.push(s);
2079
+ return r;
2080
+ })(r.dirsToDelete);
2081
+ var l;
2082
+ return r.filesToDelete.forEach(f), r.dirsToDelete.forEach(p), {
2083
+ filesCopied: o,
2084
+ filesWritten: n,
2085
+ filesDeleted: i,
2086
+ dirsDeleted: a,
2087
+ dirsAdded: s
2088
+ };
2089
+ },
2090
+ copyFile: async (e, t) => {
2091
+ m(e).queueCopyFileToDest = t;
2092
+ },
2093
+ emptyDirs: async e => {
2094
+ e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
2095
+ e)), []);
2096
+ const t = await Promise.all(e.map((e => s(e, {
2097
+ recursive: !0
2098
+ })))), r = [];
2099
+ for (const e of t) for (const t of e) r.includes(t.absPath) || r.push(t.absPath);
2100
+ r.sort(((e, t) => {
2101
+ const r = e.split("/").length, s = t.split("/").length;
2102
+ return r < s ? 1 : r > s ? -1 : 0;
2103
+ })), await Promise.all(r.map(i)), e.forEach((e => {
2104
+ const t = m(e);
2105
+ t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
2106
+ }));
2107
+ },
2108
+ getBuildOutputs: () => {
2109
+ const e = [];
2110
+ return r.forEach(((t, r) => {
2111
+ const s = e.find((e => e.type === t));
2112
+ s ? s.files.push(r) : e.push({
2113
+ type: t,
2114
+ files: [ r ]
2115
+ });
2116
+ })), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
2117
+ },
2118
+ getItem: m,
2119
+ getMemoryStats: () => `data length: ${t.size}`,
2120
+ readFile: async (t, r) => {
2121
+ if (null == r || !0 === r.useCache || void 0 === r.useCache) {
2122
+ const e = m(t);
2123
+ if (e.exists && "string" == typeof e.fileText) return e.fileText;
2124
+ }
2125
+ const s = await e.readFile(t), n = m(t);
2126
+ return "string" == typeof s ? s.length < g && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
2127
+ n.fileText = s) : n.exists = !1, s;
2128
+ },
2129
+ readFileSync: (t, r) => {
2130
+ if (null == r || !0 === r.useCache || void 0 === r.useCache) {
2131
+ const e = m(t);
2132
+ if (e.exists && "string" == typeof e.fileText) return e.fileText;
2133
+ }
2134
+ const s = e.readFileSync(t), n = m(t);
2135
+ return "string" == typeof s ? s.length < g && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
2136
+ n.fileText = s) : n.exists = !1, s;
2137
+ },
2138
+ readdir: s,
2139
+ remove: async e => {
2140
+ const t = await a(e);
2141
+ !0 === t.isDirectory ? await (async e => {
2142
+ const t = m(e);
2143
+ t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
2144
+ try {
2145
+ const t = await s(e, {
2146
+ recursive: !0
2147
+ });
2148
+ await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : i(e.absPath))));
2149
+ } catch (e) {}
2150
+ })(e) : !0 === t.isFile && await i(e);
2151
+ },
2152
+ stat: a,
2153
+ statSync: l,
2154
+ sys: e,
2155
+ writeFile: c,
2156
+ writeFiles: (e, t) => {
2157
+ const r = [];
2158
+ return isIterable(e) ? e.forEach(((e, s) => {
2159
+ r.push(c(s, e, t));
2160
+ })) : Object.keys(e).map((s => {
2161
+ r.push(c(s, e[s], t));
2162
+ })), Promise.all(r);
2163
+ }
2164
+ };
2163
2165
  }, getCommitInstructions = e => {
2164
2166
  const t = {
2165
2167
  filesToDelete: [],
@@ -2466,10 +2468,9 @@ caller = function() {
2466
2468
  }), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
2467
2469
  }, normalizeOptions = function(e, t) {
2468
2470
  return t || {};
2469
- }, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
2470
- toStr = Object.prototype.toString, implementation = function e(t) {
2471
+ }, slice = Array.prototype.slice, toStr = Object.prototype.toString, implementation = function e(t) {
2471
2472
  var r, s, n, o, i, a, l, c = this;
2472
- if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
2473
+ if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError("Function.prototype.bind called on incompatible " + c);
2473
2474
  for (r = slice.call(arguments, 1), n = function() {
2474
2475
  if (this instanceof s) {
2475
2476
  var e = c.apply(this, r.concat(slice.call(arguments)));
@@ -3154,7 +3155,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
3154
3155
  d("/");
3155
3156
  const D = {
3156
3157
  name: "in-memory",
3157
- version: "3.2.1",
3158
+ version: "3.2.2",
3158
3159
  events: a,
3159
3160
  access: async e => u(e),
3160
3161
  accessSync: u,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/testing",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Rindo testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",