@mui/toolpad-utils
Advanced tools
Comparing version 0.1.29 to 0.1.30
export declare function getExtension(filePath: string): string; | ||
export declare function hasImageExtension(path: string): boolean; | ||
export declare function hasImageExtension(pathName: string): boolean; | ||
export declare function bashResolvePath(pathName: string): string; |
// src/path.ts | ||
import os from "os"; | ||
import path from "path"; | ||
var IMAGE_EXTENSIONS = [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp"]; | ||
@@ -8,7 +10,11 @@ function getExtension(filePath) { | ||
} | ||
function hasImageExtension(path) { | ||
const extension = getExtension(path); | ||
function hasImageExtension(pathName) { | ||
const extension = getExtension(pathName); | ||
return IMAGE_EXTENSIONS.includes(extension); | ||
} | ||
function bashResolvePath(pathName) { | ||
return pathName.startsWith("~/") ? path.resolve(os.homedir(), pathName.slice(2)) : path.resolve(process.cwd(), pathName); | ||
} | ||
export { | ||
bashResolvePath, | ||
getExtension, | ||
@@ -15,0 +21,0 @@ hasImageExtension |
/** | ||
* @jest-environment jsdom | ||
* @vitest-environment jsdom | ||
*/ | ||
import '@testing-library/jest-dom'; | ||
import 'vitest-dom/extend-expect'; |
{ | ||
"name": "@mui/toolpad-utils", | ||
"version": "0.1.29", | ||
"version": "0.1.30", | ||
"description": "Build MUI apps quickly", | ||
@@ -43,3 +43,3 @@ "author": "MUI Toolpad team", | ||
"check-types": "tsup && tsc --noEmit", | ||
"test": "jest" | ||
"test": "vitest run" | ||
}, | ||
@@ -65,6 +65,6 @@ "bugs": { | ||
"@types/prettier": "2.7.3", | ||
"@types/react": "18.2.21", | ||
"@types/react": "18.2.22", | ||
"@types/react-is": "18.2.1" | ||
}, | ||
"gitHead": "8bac56d5fbc6bddc925e2f143863e63cfb07e7c3" | ||
"gitHead": "4057a5514725c4eb709d3db9a0a3720f7901a4ea" | ||
} |
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
236596
2734