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

@warp-ds/tokenizer

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@warp-ds/tokenizer - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"name": "@warp-ds/tokenizer",
"version": "0.0.3",
"version": "0.0.4",
"exports": {

@@ -5,0 +5,0 @@ ".": "./index.js"

@@ -73,7 +73,14 @@ import fs from 'node:fs';

export const toCSSMap = ([k, v], duplicateAsRgb) => {
let css = `${tokenKey(k)} var(--w-${v});`;
if (duplicateAsRgb) {
const rgbTokenKey = tokenKey(k.replace(/^(s-)?(color-)?(.*)/, '$1rgb-$3'));
const rgbTokenValue = `var(--w-${v.replace(/^(s-)?(color-)?(.*)/, '$1rgb-$3')});`;
css = css.concat(rgbTokenKey, rgbTokenValue);
let css = `${tokenKey(k)}`;
const alpha = v.match(/([^\/]+)\/(0|[1-9][0-9]?|100)$/);
if (alpha) {
const decimalAlpha = (parseFloat(alpha[2]) / 100).toString().replace(/^0\./, '.');
css += `rgba(var(--w-${alpha[1].replace(/^(s-)?(color-)?(.*)/, '$1rgb-$3')}),${decimalAlpha});`;
} else {
css += `var(--w-${v});`;
if (duplicateAsRgb) {
const rgbTokenKey = tokenKey(k.replace(/^(s-)?(color-)?(.*)/, '$1rgb-$3'));
const rgbTokenValue = `var(--w-${v.replace(/^(s-)?(color-)?(.*)/, '$1rgb-$3')});`;
css = css.concat(rgbTokenKey, rgbTokenValue);
}
}

@@ -80,0 +87,0 @@ return css;

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