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

gl-format-compiler-error

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-format-compiler-error - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

18

index.js

@@ -5,2 +5,3 @@

var shaderName = require('glsl-shader-name');
var addLineNumbers = require('add-line-numbers');

@@ -13,3 +14,3 @@ module.exports = formatCompilerError;

var name = shaderName(src) || 'of unknown name (see npm glsl-shader-name)';
var typeName = 'unknown type';

@@ -20,7 +21,6 @@ if (type !== undefined) {

var longForm = sprintf("Error in %s shader %s:\n", typeName, name);
var longForm = sprintf('Error compiling %s shader %s:\n', typeName, name);
var shortForm = sprintf("%s%s", longForm, errLog);
var errorStrings = errLog.split('\n');
var errors = {};

@@ -30,7 +30,11 @@

var errorString = errorStrings[i];
if (errorString === '') continue;
var lineNo = parseInt(errorString.split(':')[2]);
if (isNaN(lineNo)) {
throw new Error(sprintf('Could not parse error: %s', errorString));
}
errors[lineNo] = errorString;
}
var lines = src.split('\n');
var lines = addLineNumbers(src).split('\n');

@@ -40,3 +44,3 @@ for (var i = 0; i < lines.length; i++) {

var line = lines[i];
longForm += sprintf("%4d: %s\n", i+1, line);
longForm += line + '\n';
if (errors[i+1]) {

@@ -50,6 +54,6 @@ var e = errors[i+1];

return {
long: longForm,
short: shortForm
long: longForm.trim(),
short: shortForm.trim()
};
}
{
"name": "gl-format-compiler-error",
"version": "1.0.0",
"version": "1.0.1",
"description": "Formats a webgl glsl compiler error.",

@@ -25,2 +25,3 @@ "main": "index.js",

"dependencies": {
"add-line-numbers": "^1.0.1",
"gl-constants": "^1.0.0",

@@ -27,0 +28,0 @@ "glsl-shader-name": "^1.0.0",

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