source: trip-planner-front/node_modules/memfs/lib/index.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.1 KB
Line 
1"use strict";
2var __assign = (this && this.__assign) || function () {
3 __assign = Object.assign || function(t) {
4 for (var s, i = 1, n = arguments.length; i < n; i++) {
5 s = arguments[i];
6 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7 t[p] = s[p];
8 }
9 return t;
10 };
11 return __assign.apply(this, arguments);
12};
13Object.defineProperty(exports, "__esModule", { value: true });
14exports.fs = exports.createFsFromVolume = exports.vol = exports.Volume = void 0;
15var Stats_1 = require("./Stats");
16var Dirent_1 = require("./Dirent");
17var volume_1 = require("./volume");
18var _a = require('fs-monkey/lib/util/lists'), fsSyncMethods = _a.fsSyncMethods, fsAsyncMethods = _a.fsAsyncMethods;
19var constants_1 = require("./constants");
20var F_OK = constants_1.constants.F_OK, R_OK = constants_1.constants.R_OK, W_OK = constants_1.constants.W_OK, X_OK = constants_1.constants.X_OK;
21exports.Volume = volume_1.Volume;
22// Default volume.
23exports.vol = new volume_1.Volume();
24function createFsFromVolume(vol) {
25 var fs = { F_OK: F_OK, R_OK: R_OK, W_OK: W_OK, X_OK: X_OK, constants: constants_1.constants, Stats: Stats_1.default, Dirent: Dirent_1.default };
26 // Bind FS methods.
27 for (var _i = 0, fsSyncMethods_1 = fsSyncMethods; _i < fsSyncMethods_1.length; _i++) {
28 var method = fsSyncMethods_1[_i];
29 if (typeof vol[method] === 'function')
30 fs[method] = vol[method].bind(vol);
31 }
32 for (var _a = 0, fsAsyncMethods_1 = fsAsyncMethods; _a < fsAsyncMethods_1.length; _a++) {
33 var method = fsAsyncMethods_1[_a];
34 if (typeof vol[method] === 'function')
35 fs[method] = vol[method].bind(vol);
36 }
37 fs.StatWatcher = vol.StatWatcher;
38 fs.FSWatcher = vol.FSWatcher;
39 fs.WriteStream = vol.WriteStream;
40 fs.ReadStream = vol.ReadStream;
41 fs.promises = vol.promises;
42 fs._toUnixTimestamp = volume_1.toUnixTimestamp;
43 return fs;
44}
45exports.createFsFromVolume = createFsFromVolume;
46exports.fs = createFsFromVolume(exports.vol);
47module.exports = __assign(__assign({}, module.exports), exports.fs);
48module.exports.semantic = true;
Note: See TracBrowser for help on using the repository browser.