unplugin-icons
Advanced tools
Comparing version 0.12.21 to 0.12.22
@@ -0,6 +1,6 @@ | ||
import { Awaitable } from '@antfu/utils'; | ||
import { CustomIconLoader } from './types'; | ||
import '@antfu/utils'; | ||
declare function FileSystemIconLoader(dir: string): CustomIconLoader; | ||
declare function FileSystemIconLoader(dir: string, transform?: (svg: string) => Awaitable<string>): CustomIconLoader; | ||
export { FileSystemIconLoader }; |
@@ -9,4 +9,4 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _fs = require('fs'); | ||
function FileSystemIconLoader(dir) { | ||
return (name) => { | ||
function FileSystemIconLoader(dir, transform) { | ||
return async (name) => { | ||
const pathes = [ | ||
@@ -18,4 +18,6 @@ `${dir}/${name}.svg`, | ||
for (const path of pathes) { | ||
if (_fs.existsSync.call(void 0, path)) | ||
return _fs.promises.readFile(path, "utf-8"); | ||
if (_fs.existsSync.call(void 0, path)) { | ||
const svg = await _fs.promises.readFile(path, "utf-8"); | ||
return typeof transform === "function" ? await transform(svg) : svg; | ||
} | ||
} | ||
@@ -22,0 +24,0 @@ }; |
{ | ||
"name": "unplugin-icons", | ||
"version": "0.12.21", | ||
"version": "0.12.22", | ||
"description": "Access thousands of icons as components on-demand universally", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/antfu/unplugin-icons", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
66923
1409
0