Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memfs

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memfs - npm Package Compare versions

Comparing version 4.9.3 to 4.9.4

1

lib/encoding.d.ts

@@ -1,2 +0,1 @@

/// <reference types="node" />
export type TDataOut = string | Buffer;

@@ -3,0 +2,0 @@ export type TEncodingExtended = BufferEncoding | 'buffer';

6

lib/encoding.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.strToEncoding = exports.assertEncoding = exports.ENCODING_UTF8 = void 0;
exports.ENCODING_UTF8 = void 0;
exports.assertEncoding = assertEncoding;
exports.strToEncoding = strToEncoding;
const buffer_1 = require("./internal/buffer");

@@ -11,3 +13,2 @@ const errors = require("./internal/errors");

}
exports.assertEncoding = assertEncoding;
function strToEncoding(str, encoding) {

@@ -20,3 +21,2 @@ if (!encoding || encoding === exports.ENCODING_UTF8)

}
exports.strToEncoding = strToEncoding;
//# sourceMappingURL=encoding.js.map

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Readable } from 'stream';

@@ -3,0 +2,0 @@ import { Defer } from '../thingies/Defer';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Writable } from 'stream';

@@ -3,0 +2,0 @@ import { FsaNodeFsOpenFile } from './FsaNodeFsOpenFile';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.memfs = exports.fs = exports.createFsFromVolume = exports.vol = exports.Volume = void 0;
exports.memfs = exports.fs = exports.vol = exports.Volume = void 0;
exports.createFsFromVolume = createFsFromVolume;
const Stats_1 = require("./Stats");

@@ -32,3 +33,2 @@ const Dirent_1 = require("./Dirent");

}
exports.createFsFromVolume = createFsFromVolume;
exports.fs = createFsFromVolume(exports.vol);

@@ -35,0 +35,0 @@ /**

@@ -1,8 +0,6 @@

/// <reference types="node" />
/// <reference types="node" />
import { Buffer } from 'buffer';
declare const bufferAllocUnsafe: (size: number) => Buffer;
declare const bufferFrom: {
(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number | undefined, length?: number | undefined): Buffer;
(data: readonly any[]): Buffer;
(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
(data: ReadonlyArray<any>): Buffer;
(data: Uint8Array): Buffer;

@@ -13,5 +11,5 @@ (obj: {

[Symbol.toPrimitive](hint: "string"): string;
}, byteOffset?: number | undefined, length?: number | undefined): Buffer;
(str: string, encoding?: string | undefined): Buffer;
}, byteOffset?: number, length?: number): Buffer;
(str: string, encoding?: string): Buffer;
};
export { Buffer, bufferAllocUnsafe, bufferFrom };

@@ -1,2 +0,1 @@

/// <reference types="node" />
declare const g: typeof globalThis | NodeJS.Global;

@@ -3,0 +2,0 @@ declare class AssertionError extends g.Error {

@@ -8,3 +8,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.E = exports.AssertionError = exports.message = exports.RangeError = exports.TypeError = exports.Error = void 0;
exports.AssertionError = exports.RangeError = exports.TypeError = exports.Error = void 0;
exports.message = message;
exports.E = E;
const assert = require("assert");

@@ -64,3 +66,2 @@ const util = require("util");

}
exports.message = message;
// Utility function for registering the error codes. Only used here. Exported

@@ -71,3 +72,2 @@ // *only* to allow for testing.

}
exports.E = E;
exports.Error = makeNodeError(g.Error);

@@ -74,0 +74,0 @@ exports.TypeError = makeNodeError(g.TypeError);

@@ -8,5 +8,5 @@ import type { NodeFsaContext } from './types';

export declare const assertName: (name: string, method: string, klass: string) => void;
export declare const assertCanWrite: (mode: 'read' | 'readwrite') => void;
export declare const assertCanWrite: (mode: "read" | "readwrite") => void;
export declare const newNotFoundError: () => DOMException;
export declare const newTypeMismatchError: () => DOMException;
export declare const newNotAllowedError: () => DOMException;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { Volume } from './volume';

@@ -4,0 +2,0 @@ import { EventEmitter } from 'events';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import type * as opts from './types/options';

@@ -3,0 +2,0 @@ import type { IFileHandle, IStats, TData, TDataOut, TMode, TTime } from './types/misc';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWriteFileOptions = exports.writeFileDefaults = exports.getRealpathOptsAndCb = exports.getRealpathOptions = exports.getStatOptsAndCb = exports.getStatOptions = exports.getAppendFileOptsAndCb = exports.getAppendFileOpts = exports.getReaddirOptsAndCb = exports.getReaddirOptions = exports.getReadFileOptions = exports.getRmOptsAndCb = exports.getRmdirOptions = exports.getDefaultOptsAndCb = exports.getDefaultOpts = exports.optsDefaults = exports.optsAndCbGenerator = exports.optsGenerator = exports.getOptions = exports.getMkdirOptions = void 0;
exports.getWriteFileOptions = exports.writeFileDefaults = exports.getRealpathOptsAndCb = exports.getRealpathOptions = exports.getStatOptsAndCb = exports.getStatOptions = exports.getAppendFileOptsAndCb = exports.getAppendFileOpts = exports.getReaddirOptsAndCb = exports.getReaddirOptions = exports.getReadFileOptions = exports.getRmOptsAndCb = exports.getRmdirOptions = exports.getDefaultOptsAndCb = exports.getDefaultOpts = exports.optsDefaults = exports.getMkdirOptions = void 0;
exports.getOptions = getOptions;
exports.optsGenerator = optsGenerator;
exports.optsAndCbGenerator = optsAndCbGenerator;
const constants_1 = require("./constants");

@@ -39,11 +42,8 @@ const encoding_1 = require("../encoding");

}
exports.getOptions = getOptions;
function optsGenerator(defaults) {
return options => getOptions(defaults, options);
}
exports.optsGenerator = optsGenerator;
function optsAndCbGenerator(getOpts) {
return (options, callback) => typeof options === 'function' ? [getOpts(), options] : [getOpts(options), (0, util_1.validateCallback)(callback)];
}
exports.optsAndCbGenerator = optsAndCbGenerator;
exports.optsDefaults = {

@@ -50,0 +50,0 @@ encoding: 'utf8',

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import type * as misc from './misc';

@@ -4,0 +2,0 @@ import type * as opts from './options';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import type { constants } from '../../constants';

@@ -4,0 +2,0 @@ import * as misc from './misc';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import type * as misc from './misc';

@@ -4,0 +2,0 @@ import type * as opts from './options';

@@ -1,5 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import type { PathLike, symlink } from 'fs';

@@ -6,0 +2,0 @@ import type { constants } from '../../constants';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import type { IFileHandle, TEncodingExtended, TFlags, TMode } from './misc';

@@ -3,0 +2,0 @@ export interface IOptions {

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import type { FsCallbackApi } from './types';

@@ -19,13 +17,5 @@ import type * as misc from './types/misc';

export declare const bufToUint8: (buf: Buffer) => Uint8Array;
export declare const getWriteArgs: (fd: number, a?: unknown, b?: unknown, c?: unknown, d?: unknown, e?: unknown) => [
fd: number,
dataAsStr: boolean,
buf: Buffer,
offset: number,
length: number,
position: number | null,
callback: (...args) => void
];
export declare const getWriteArgs: (fd: number, a?: unknown, b?: unknown, c?: unknown, d?: unknown, e?: unknown) => [fd: number, dataAsStr: boolean, buf: Buffer, offset: number, length: number, position: number | null, callback: (...args: any) => void];
export declare const getWriteSyncArgs: (fd: number, a: string | Buffer | ArrayBufferView | DataView, b?: number, c?: number | BufferEncoding, d?: number | null) => [fd: number, buf: Buffer, offset: number, length?: number, position?: number | null];
export declare function bufferToEncoding(buffer: Buffer, encoding?: TEncodingExtended): misc.TDataOut;
export declare const unixify: (filepath: string, stripTrailing?: boolean) => string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unixify = exports.bufferToEncoding = exports.getWriteSyncArgs = exports.getWriteArgs = exports.bufToUint8 = exports.dataToBuffer = exports.validateFd = exports.isFd = exports.flagsToNumber = exports.genRndStr6 = exports.createError = exports.pathToFilename = exports.nullCheck = exports.modeToNumber = exports.validateCallback = exports.promisify = exports.isWin = void 0;
exports.unixify = exports.getWriteSyncArgs = exports.getWriteArgs = exports.bufToUint8 = exports.isWin = void 0;
exports.promisify = promisify;
exports.validateCallback = validateCallback;
exports.modeToNumber = modeToNumber;
exports.nullCheck = nullCheck;
exports.pathToFilename = pathToFilename;
exports.createError = createError;
exports.genRndStr6 = genRndStr6;
exports.flagsToNumber = flagsToNumber;
exports.isFd = isFd;
exports.validateFd = validateFd;
exports.dataToBuffer = dataToBuffer;
exports.bufferToEncoding = bufferToEncoding;
const constants_1 = require("./constants");

@@ -20,3 +32,2 @@ const errors = require("../internal/errors");

}
exports.promisify = promisify;
function validateCallback(callback) {

@@ -27,3 +38,2 @@ if (typeof callback !== 'function')

}
exports.validateCallback = validateCallback;
function _modeToNumber(mode, def) {

@@ -44,3 +54,2 @@ if (typeof mode === 'number')

}
exports.modeToNumber = modeToNumber;
function nullCheck(path, callback) {

@@ -59,3 +68,2 @@ if (('' + path).indexOf('\u0000') !== -1) {

}
exports.nullCheck = nullCheck;
function getPathFromURLPosix(url) {

@@ -92,3 +100,2 @@ if (url.hostname !== '') {

}
exports.pathToFilename = pathToFilename;
const ENOENT = 'ENOENT';

@@ -155,3 +162,2 @@ const EBADF = 'EBADF';

}
exports.createError = createError;
function genRndStr6() {

@@ -164,3 +170,2 @@ const str = (Math.random() + 1).toString(36).substring(2, 8);

}
exports.genRndStr6 = genRndStr6;
function flagsToNumber(flags) {

@@ -177,7 +182,5 @@ if (typeof flags === 'number')

}
exports.flagsToNumber = flagsToNumber;
function isFd(path) {
return path >>> 0 === path;
}
exports.isFd = isFd;
function validateFd(fd) {

@@ -187,3 +190,2 @@ if (!isFd(fd))

}
exports.validateFd = validateFd;
function dataToBuffer(data, encoding = encoding_1.ENCODING_UTF8) {

@@ -197,3 +199,2 @@ if (buffer_1.Buffer.isBuffer(data))

}
exports.dataToBuffer = dataToBuffer;
const bufToUint8 = (buf) => new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);

@@ -294,3 +295,2 @@ exports.bufToUint8 = bufToUint8;

}
exports.bufferToEncoding = bufferToEncoding;
const isSeparator = (str, i) => {

@@ -297,0 +297,0 @@ let char = str[i];

"use strict";
// Here we mock the global `process` variable in case we are not in Node's environment.
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProcess = void 0;
exports.createProcess = createProcess;
/**

@@ -39,4 +39,3 @@ * Looks to return a `process` object, if one is available.

}
exports.createProcess = createProcess;
exports.default = createProcess();
//# sourceMappingURL=process.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createVolume = exports.ObjectStore = void 0;
exports.ObjectStore = void 0;
exports.createVolume = createVolume;
const volume_1 = require("./volume");

@@ -73,3 +74,2 @@ const node_1 = require("./node");

}
exports.createVolume = createVolume;
//# sourceMappingURL=volume-localstorage.js.map

@@ -1,5 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { Node, Link, File } from './node';

@@ -6,0 +2,0 @@ import Stats from './Stats';

{
"name": "memfs",
"version": "4.9.3",
"version": "4.9.4",
"description": "In-memory file-system with Node's fs API.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc