You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

glsl-transpiler

Package Overview
Dependencies
Maintainers
12
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-transpiler - npm Package Compare versions

Comparing version

to
1.7.2

23

lib/operators.js

@@ -47,22 +47,3 @@ 'use strict'

/**
* Check if expression is protected by parentheses
*/
function isBraced (exp) {
if (/\s/.test(exp)) {
// a + b
if (exp[0] !== '(') return false;
var level = 1;
var len = exp.length;
for (let i = 1; i < len - 1; i++) {
if (exp[i] === '(') level++;
else if (exp[i] === ')') level--;
// (a + b) * c + d
if (level === 0) return false;
}
}
return true;
}
/**

@@ -310,3 +291,3 @@ * Return rendered operation

if (operator != '+' && operator != '-') {
if (!isBraced(left)) opResult += '(' + left + ')'
if (/\s/.test(left) && !(left[0] == '(' && left[left.length - 1] == ')')) opResult += '(' + left + ')'
else opResult += left

@@ -319,3 +300,3 @@ }

if (operator != '+' && operator != '-') {
if (!isBraced(right)) opResult += '(' + right + ')'
if (/\s/.test(right) && !(right[0] == '(' && right[right.length - 1] == ')')) opResult += '(' + right + ')'
else opResult += right

@@ -322,0 +303,0 @@ }

2

package.json
{
"name": "glsl-transpiler",
"version": "1.7.1",
"version": "1.7.2",
"description": "Transpile GLSL to JS",

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