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

css-doodle

Package Overview
Dependencies
Maintainers
0
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-doodle - npm Package Compare versions

Comparing version 0.40.8 to 0.41.0

2

package.json
{
"name": "css-doodle",
"version": "0.40.8",
"version": "0.41.0",
"description": "A web component for drawing patterns with CSS",

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

@@ -84,8 +84,12 @@ import parse_value_group from './parser/parse-value-group.js';

result.flex = item === '|' ? 'column' : 'row';
temp.push('§');
} else if (/border:?/i.test(item)) {
result.border = item.split(':')[1] || '';
temp.push('§');
} else if (/^no\-*clip$/i.test(item)) {
result.clip = false;
temp.push('§');
} else if (/^p3d$/i.test(item)) {
result.p3d = true;
temp.push('§');
} else if (!result.grid) {

@@ -100,3 +104,3 @@ result.grid = parse_grid(item, options.max_grid);

let groups = parse_value_group(temp.join(' '), {
symbol: ['/', '+', '^', '*', '~', '∆', '_'],
symbol: ['/', '+', '^', '*', '~', '∆', '_', '§'],
noSpace: true,

@@ -103,0 +107,0 @@ verbose: true

@@ -27,21 +27,23 @@ import calc from './calc.js';

function compare(rule, value) {
function compare(rule, value, x, y) {
if (rule === 'even') {
return even(value);
return { value: odd(x + y) }
}
if (rule === 'odd') {
return odd(value);
return { value: even(x + y) }
}
if (rule == 'n') {
return true;
if (rule === 'n') {
return { value: true }
}
let { a, b, error } = parse_linear_expr(rule);
if (error) {
return false;
return { value: false, error }
}
if (a === 0) {
return value === b;
return { value: value === b }
} else {
let result = (value - b) / a;
return result >= 0 && Number.isInteger(result);
return {
value: result >= 0 && Number.isInteger(result),
}
}

@@ -59,3 +61,3 @@ }

for (let expr of exprs) {
if (compare(expr, count)) return true;
if (compare(expr, count).value) return true;
}

@@ -68,3 +70,3 @@ }

for (let expr of exprs) {
if (compare(expr, y)) return true;
if (compare(expr, y).value) return true;
}

@@ -77,3 +79,3 @@ };

for (let expr of exprs) {
if (compare(expr, x)) return true;
if (compare(expr, x).value) return true;
}

@@ -116,2 +118,23 @@ };

cell({ count, grid, x, y, random }) {
return (...args) => {
if (!args.length) {
return true;
}
let result = args.map(arg => {
let { value, error } = compare(arg, count, x, y);
if (!error) {
return value;
}
return !!calc('(' + arg + ')', {
x, X: grid.x,
y, Y: grid.y,
i: count, I: grid.count,
random,
});
});
return result.some(Boolean);
}
},
hover({ count, x, y, grid, random }) {

@@ -118,0 +141,0 @@ return (...args) => {

Sorry, the diff of this file is too big to display

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