@file-services/memory
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -121,3 +121,9 @@ "use strict"; | ||
function writeFileSync(filePath, fileContent) { | ||
if (filePath === '') { | ||
throw createFsError(filePath, error_codes_1.FsErrorCodes.NO_FILE_OR_DIRECTORY, 'ENOENT'); | ||
} | ||
const resolvedPath = resolvePath(filePath); | ||
if (resolvedPath === '/') { | ||
throw createFsError(filePath, error_codes_1.FsErrorCodes.PATH_IS_DIRECTORY, 'EISDIR'); | ||
} | ||
const parentPath = posixPath.dirname(resolvedPath); | ||
@@ -124,0 +130,0 @@ const parentNode = getNode(parentPath); |
@@ -113,3 +113,9 @@ import { createFileSystem, syncToAsyncFs, SetMultiMap } from '@file-services/utils'; | ||
function writeFileSync(filePath, fileContent) { | ||
if (filePath === '') { | ||
throw createFsError(filePath, FsErrorCodes.NO_FILE_OR_DIRECTORY, 'ENOENT'); | ||
} | ||
const resolvedPath = resolvePath(filePath); | ||
if (resolvedPath === '/') { | ||
throw createFsError(filePath, FsErrorCodes.PATH_IS_DIRECTORY, 'EISDIR'); | ||
} | ||
const parentPath = posixPath.dirname(resolvedPath); | ||
@@ -116,0 +122,0 @@ const parentNode = getNode(parentPath); |
{ | ||
"name": "@file-services/memory", | ||
"description": "An in-memory, sync/async, file system implementation.", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"main": "cjs/index.js", | ||
@@ -6,0 +6,0 @@ "module": "esm/index.js", |
@@ -141,3 +141,11 @@ import { createFileSystem, syncToAsyncFs, SetMultiMap } from '@file-services/utils'; | ||
function writeFileSync(filePath: string, fileContent: string): void { | ||
if (filePath === '') { | ||
throw createFsError(filePath, FsErrorCodes.NO_FILE_OR_DIRECTORY, 'ENOENT'); | ||
} | ||
const resolvedPath = resolvePath(filePath); | ||
if (resolvedPath === '/') { | ||
throw createFsError(filePath, FsErrorCodes.PATH_IS_DIRECTORY, 'EISDIR'); | ||
} | ||
const parentPath = posixPath.dirname(resolvedPath); | ||
@@ -144,0 +152,0 @@ const parentNode = getNode(parentPath); |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91460
1361