Socket
Socket
Sign inDemoInstall

@storm-stack/file-system

Package Overview
Dependencies
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storm-stack/file-system - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

11

dist/legacy/index-beta.d.ts

@@ -145,2 +145,13 @@ /// <reference types="node" />

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
declare function findFileExtension(filePath: string): string;
export { findFileExtension }
export { findFileExtension as findFileExtension_alias_1 }
export { findFileExtension as findFileExtension_alias_2 }
/**
* Find the file name from a file path.

@@ -147,0 +158,0 @@ *

@@ -145,2 +145,13 @@ /// <reference types="node" />

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
declare function findFileExtension(filePath: string): string;
export { findFileExtension }
export { findFileExtension as findFileExtension_alias_1 }
export { findFileExtension as findFileExtension_alias_2 }
/**
* Find the file name from a file path.

@@ -147,0 +158,0 @@ *

@@ -145,2 +145,13 @@ /// <reference types="node" />

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
declare function findFileExtension(filePath: string): string;
export { findFileExtension }
export { findFileExtension as findFileExtension_alias_1 }
export { findFileExtension as findFileExtension_alias_2 }
/**
* Find the file name from a file path.

@@ -147,0 +158,0 @@ *

@@ -145,2 +145,13 @@ /// <reference types="node" />

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
declare function findFileExtension(filePath: string): string;
export { findFileExtension }
export { findFileExtension as findFileExtension_alias_1 }
export { findFileExtension as findFileExtension_alias_2 }
/**
* Find the file name from a file path.

@@ -147,0 +158,0 @@ *

@@ -145,2 +145,13 @@ /// <reference types="node" />

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
declare function findFileExtension(filePath: string): string;
export { findFileExtension }
export { findFileExtension as findFileExtension_alias_1 }
export { findFileExtension as findFileExtension_alias_2 }
/**
* Find the file name from a file path.

@@ -147,0 +158,0 @@ *

@@ -145,2 +145,13 @@ /// <reference types="node" />

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
declare function findFileExtension(filePath: string): string;
export { findFileExtension }
export { findFileExtension as findFileExtension_alias_1 }
export { findFileExtension as findFileExtension_alias_2 }
/**
* Find the file name from a file path.

@@ -147,0 +158,0 @@ *

2

package.json
{
"name": "@storm-stack/file-system",
"version": "1.2.1",
"version": "1.3.0",
"private": false,

@@ -5,0 +5,0 @@ "description": "⚡ The storm-stack monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",

@@ -21,4 +21,6 @@ //

import { dirname, isAbsolute, join, parse, relative, sep } from "node:path";
import { EMPTY_STRING } from "@storm-stack/utilities";
import { dirname, isAbsolute, parse, relative, sep } from "node:path";
import { getWorkspaceRoot } from "./get-workspace-root";
import { joinPaths } from "./join-paths";

@@ -51,2 +53,17 @@ /**

/**
* Find the file extension from a file path.
*
* @param filePath - The file path to process
* @returns The file extension
*/
export function findFileExtension(filePath: string): string {
const splits = findFileName(filePath)?.split(".");
if (splits && Array.isArray(splits) && splits.length > 0) {
splits.pop();
}
return splits.join(".") ?? EMPTY_STRING;
}
/**
* Check if a file path has a file name.

@@ -85,5 +102,5 @@ *

} else if (basePath) {
return join(dirname(basePath), filePath);
return joinPaths(dirname(basePath), filePath);
} else {
return join(process.cwd(), filePath);
return joinPaths(process.cwd(), filePath);
}

@@ -112,3 +129,3 @@ }

const file = parse(filePath);
return join(
return joinPaths(
file.dir,

@@ -115,0 +132,0 @@ newFileName.includes(".") ? newFileName : newFileName + file.ext

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 too big to display

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

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 too big to display

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

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