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

@cobalt-ui/plugin-css

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cobalt-ui/plugin-css - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

dist/wildcard-match.d.ts

6

CHANGELOG.md
# @cobalt-ui/plugin-css
## 1.4.1
### Patch Changes
- [`adfe228`](https://github.com/drwpow/cobalt-ui/commit/adfe2280718244a3a25086e3f3b47e963993bca2) Thanks [@drwpow](https://github.com/drwpow)! - Replace micromatch with wildcard-match
## 1.4.0

@@ -4,0 +10,0 @@

5

dist/index.js

@@ -27,4 +27,3 @@ /**

import { converter, formatCss } from 'culori';
import micromatch from 'micromatch';
import { encode, formatFontNames } from './util.js';
import { encode, formatFontNames, isTokenMatch } from './util.js';
const CSS_VAR_RE = /^var\(--[^)]+\)$/;

@@ -141,3 +140,3 @@ const DASH_PREFIX_RE = /^-+/;

for (const modeSelector of modeSelectors) {
if (!token.$extensions.mode[modeSelector.mode] || (modeSelector.tokens?.length && !micromatch.isMatch(token.id, modeSelector.tokens))) {
if (!token.$extensions.mode[modeSelector.mode] || (modeSelector.tokens && !isTokenMatch(token.id, modeSelector.tokens))) {
continue;

@@ -144,0 +143,0 @@ }

2

dist/util.d.ts

@@ -7,1 +7,3 @@ /// <reference types="node" resolution-mode="require"/>

export declare function formatFontNames(fontNames: string[]): string;
/** match token against globs */
export declare function isTokenMatch(tokenID: string, globPatterns: string[]): boolean;

@@ -5,2 +5,3 @@ import mime from 'mime';

import svgo from 'svgo';
import wcmatch from './wildcard-match.js';
const LEADING_SLASH_RE = /^\//;

@@ -25,2 +26,13 @@ const URL_PREFIX = /^\s*url\(['"]?/;

}
/** match token against globs */
export function isTokenMatch(tokenID, globPatterns) {
let isMatch = false;
for (const tokenMatch of globPatterns) {
if (wcmatch(tokenMatch)(tokenID)) {
isMatch = true;
break;
}
}
return isMatch;
}
//# sourceMappingURL=util.js.map
{
"name": "@cobalt-ui/plugin-css",
"description": "Generate CSS from your design tokens schema (requires @cobalt-ui/cli)",
"version": "1.4.0",
"version": "1.4.1",
"author": {

@@ -30,3 +30,2 @@ "name": "Drew Powers",

"culori": "^3.2.0",
"micromatch": "^4.0.5",
"mime": "^3.0.0",

@@ -38,3 +37,2 @@ "svgo": "^3.0.2"

"@cobalt-ui/core": "^1.4.3",
"@types/micromatch": "^4.0.2",
"@types/node": "^20.5.7",

@@ -41,0 +39,0 @@ "npm-run-all": "^4.1.5",

@@ -24,4 +24,3 @@ import type {

import {converter, formatCss} from 'culori';
import micromatch from 'micromatch';
import {encode, formatFontNames} from './util.js';
import {encode, formatFontNames, isTokenMatch} from './util.js';

@@ -168,5 +167,6 @@ const CSS_VAR_RE = /^var\(--[^)]+\)$/;

for (const modeSelector of modeSelectors) {
if (!token.$extensions.mode[modeSelector.mode] || (modeSelector.tokens?.length && !micromatch.isMatch(token.id, modeSelector.tokens))) {
if (!token.$extensions.mode[modeSelector.mode] || (modeSelector.tokens && !isTokenMatch(token.id, modeSelector.tokens))) {
continue;
}
for (const selector of modeSelector.selectors) {

@@ -173,0 +173,0 @@ if (!selectors.includes(selector)) selectors.push(selector);

@@ -5,2 +5,3 @@ import mime from 'mime';

import svgo from 'svgo';
import wcmatch from './wildcard-match.js';

@@ -29,1 +30,13 @@ const LEADING_SLASH_RE = /^\//;

}
/** match token against globs */
export function isTokenMatch(tokenID: string, globPatterns: string[]): boolean {
let isMatch = false;
for (const tokenMatch of globPatterns) {
if (wcmatch(tokenMatch)(tokenID)) {
isMatch = true;
break;
}
}
return isMatch;
}

Sorry, the diff of this file is not supported yet

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