New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-inline-webgl-constants

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-inline-webgl-constants - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0-alpha.1

dist/index.cjs

26

index.js

@@ -1,4 +0,3 @@

/* eslint-disable no-console */
// const GL = require('luma.gl/constants');
const GL = require('@luma.gl/constants').default;
/* eslint-disable no-console, import/no-unresolved */
import {GL} from '@luma.gl/constants';

@@ -9,3 +8,3 @@ const COLOR_RESET = '\x1b[0m';

module.exports = function _(opts) {
export default function _(opts) {
return {

@@ -16,5 +15,8 @@ visitor: {

// source: Literal;
const specifiers = path.get('specifiers');
specifiers.forEach(specifier => {
if (specifier.type === 'ImportDefaultSpecifier') {
let modified = false;
let specifiers = path.get('specifiers');
specifiers.forEach((specifier) => {
if (specifier.type === 'ImportDefaultSpecifier' || specifier.type === 'ImportSpecifier') {
const local = specifier.node.local;

@@ -29,6 +31,14 @@ if (local.type === 'Identifier' && local.name === 'GL') {

}
path.remove();
specifier.remove();
modified = true;
}
}
});
specifiers = path.get('specifiers');
// If the last imported specifier was removed, remove the entire import.
if (modified && specifiers.length === 0) {
path.remove();
}
},

@@ -35,0 +45,0 @@

{
"name": "babel-plugin-inline-webgl-constants",
"version": "1.0.3",
"version": "2.0.0-alpha.1",
"description": "Babel plugin for replacing long gl constants with the shorter corresponding numbers",
"type": "module",
"license": "MIT",

@@ -16,6 +17,15 @@ "author": "Ib Green",

],
"main": "index.js",
"scripts": {
"build": "babel index.js --presets @babel/env --out-file dist/index.cjs",
"prepublishOnly": "npm run build"
},
"main": "dist/index.cjs",
"exports": {
"import": "./index.js",
"require": "./dist/index.cjs"
},
"dependencies": {
"@luma.gl/constants": "^8.4.0"
}
"@luma.gl/constants": "9.0.0-alpha.45"
},
"gitHead": "c636c34b8f1581eed163e94543a8eb1f4382ba8e"
}

@@ -11,3 +11,3 @@ # babel-plugin-inline-webgl-constants

```js
```typescript
const max = gl.MAX_VERTEX_ATTRIBS;

@@ -18,3 +18,3 @@ ```

```js
```typescript
const max = 34921;

@@ -25,4 +25,4 @@ ```

```js
import GL from '@luma.gl/constants';
```typescript
import {GL} from '@luma.gl/constants';
...

@@ -34,3 +34,3 @@ const max = GL.MAX_VERTEX_ATTRIBS;

```js
```typescript
...

@@ -66,3 +66,3 @@ const max = 34921;

```js
```typescript
require('babel-core').transform('code', {

@@ -69,0 +69,0 @@ plugins: ['inline-webgl-constants']

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