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

@iconify/tailwind

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iconify/tailwind - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

51

dist/plugin.js

@@ -10,3 +10,3 @@ /**

* @license MIT
* @version 0.1.0
* @version 0.1.1
*/

@@ -312,15 +312,22 @@ 'use strict';

/**
* Locate icon set
*/
function locateIconSet(prefix, options) {
if (options.files?.[prefix]) {
return options.files?.[prefix];
return {
main: options.files?.[prefix],
};
}
try {
return require.resolve(`@iconify-json/${prefix}/icons.json`);
const main = require.resolve(`@iconify-json/${prefix}/icons.json`);
const info = require.resolve(`@iconify-json/${prefix}/info.json`);
return {
main,
info,
};
}
catch { }
try {
return require.resolve(`@iconify/json/json/${prefix}.json`);
const main = require.resolve(`@iconify/json/json/${prefix}.json`);
return {
main,
};
}

@@ -354,15 +361,21 @@ catch { }

const filename = options.files?.[prefix] || locateIconSet(prefix, options);
if (filename) {
// Check for cache
if (cache[filename]) {
return cache[filename];
if (!filename) {
return;
}
const main = typeof filename === 'string' ? filename : filename.main;
// Check for cache
if (cache[main]) {
return cache[main];
}
// Attempt to load it
try {
const result = JSON.parse(fs.readFileSync(main, 'utf8'));
if (!result.info && typeof filename === 'object' && filename.info) {
// Load info from a separate file
result.info = JSON.parse(fs.readFileSync(filename.info, 'utf8'));
}
// Attempt to load it
try {
const result = JSON.parse(fs.readFileSync(filename, 'utf8'));
cache[filename] = result;
return result;
}
catch { }
cache[main] = result;
return result;
}
catch { }
}

@@ -472,3 +485,3 @@

const [prefix, name] = nameParts;
if (!prefix.match(matchIconName) || !name.match(matchIconName)) {
if (!(prefix.match(matchIconName) && name.match(matchIconName))) {
throw new Error(`Invalid icon name: "${icon}"`);

@@ -475,0 +488,0 @@ }

@@ -5,3 +5,3 @@ {

"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",

@@ -38,3 +38,3 @@ "main": "./dist/plugin.js",

"typescript": "^4.9.4",
"@iconify/utils": "^2.0.12"
"@iconify/utils": "^2.1.0"
},

@@ -41,0 +41,0 @@ "scripts": {

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