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

@unocss/preset-attributify

Package Overview
Dependencies
Maintainers
1
Versions
375
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/preset-attributify - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

43

dist/index.js

@@ -42,23 +42,26 @@ var __create = Object.create;

var valuedAttributeRE = /([?]|[\w:-]+)(?:=(["'])([^\2]+?)\2)?/g;
var extractorAttributify = (options) => (code) => {
const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, _, content]) => {
for (const prefix of strippedPrefixes) {
if (name.startsWith(prefix)) {
name = name.slice(prefix.length);
break;
var extractorAttributify = (options) => ({
name: "attributify",
extract({ code }) {
const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, _, content]) => {
for (const prefix of strippedPrefixes) {
if (name.startsWith(prefix)) {
name = name.slice(prefix.length);
break;
}
}
}
if (!content) {
if ((0, import_core.isValidSelector)(name) && (options == null ? void 0 : options.nonValuedAttribute) !== false)
return [`[${name}=""]`];
return [];
}
if (["class", "className"].includes(name)) {
return content.split(splitterRE).filter(import_core.isValidSelector);
} else {
return content.split(splitterRE).filter(Boolean).map((v) => `[${name}~="${v}"]`);
}
});
return new Set(result);
};
if (!content) {
if ((0, import_core.isValidSelector)(name) && (options == null ? void 0 : options.nonValuedAttribute) !== false)
return [`[${name}=""]`];
return [];
}
if (["class", "className"].includes(name)) {
return content.split(splitterRE).filter(import_core.isValidSelector);
} else {
return content.split(splitterRE).filter(Boolean).map((v) => `[${name}~="${v}"]`);
}
});
return new Set(result);
}
});

@@ -65,0 +68,0 @@ // src/variant.ts

{
"name": "@unocss/preset-attributify",
"version": "0.5.1",
"description": "",
"keywords": [],
"homepage": "https://github.com/antfu/unocss#readme",
"version": "0.6.0",
"description": "Attributify preset for UnoCSS",
"keywords": [
"unocss",
"unocss-preset"
],
"homepage": "https://github.com/antfu/unocss/tree/main/packages/preset-attributify#readme",
"bugs": {

@@ -12,3 +15,4 @@ "url": "https://github.com/antfu/unocss/issues"

"type": "git",
"url": "git+https://github.com/antfu/unocss.git"
"url": "git+https://github.com/antfu/unocss.git",
"directory": "packages/preset-attributify"
},

@@ -32,3 +36,3 @@ "funding": "https://github.com/sponsors/antfu",

"dependencies": {
"@unocss/core": "0.5.1"
"@unocss/core": "0.6.0"
},

@@ -35,0 +39,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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