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

@mapbox/expression-jamsession

Package Overview
Dependencies
Maintainers
208
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/expression-jamsession - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

4

CHANGELOG.md
# Changelog
## 0.4.0
- **[BREAKING]** Reject unquoted literal strings as passed in as formulas to `formulaToExpression`.
## 0.3.2

@@ -4,0 +8,0 @@

12

dist/index.js

@@ -7,7 +7,9 @@ 'use strict';

function handleSyntaxErrors(error, input) {
function handleSyntaxErrors(error) {
var input = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var newError = new Error('Syntax error');
newError.type = 'SyntaxError';
newError.index = error.index;
newError.description = error.description;
newError.description = error.description || error.message;

@@ -41,3 +43,3 @@ if (/expression/.test(newError.description)) {

default:
throw new Error('Invalid syntax');
throw handleSyntaxErrors(new Error('Invalid syntax'));
}

@@ -47,2 +49,6 @@ }

function astToExpression(input) {
if (input.type === 'Identifier') {
throw handleSyntaxErrors(new Error('Unexpected identifier'));
}
if (input.value !== undefined) return input.value;

@@ -49,0 +55,0 @@ if (input.name !== undefined) return input.name;

{
"name": "@mapbox/expression-jamsession",
"version": "0.3.2",
"version": "0.4.0",
"description": "Write Mapbox GL expressions in a more familiar, handwritable, spreadsheet-like, programming-like syntax.",

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

@@ -16,2 +16,3 @@ # @mapbox/expression-jamsession

So `get("foo") != 4` instead of `!=(get("foo"), 4)`.
- Strings must always be wrapped in quotation marks, e.g. `concat("egg", "s")` not `concat(egg, s)`.
- `&` operator concatenates strings, as in spreadsheet programs.

@@ -70,3 +71,3 @@

- You cannot use JSON object literal arguments to [the `literal` expression](https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-types-literal).
Even though this is allowed in the spec, objects are not supported by jsep and the use case for this type of expression is enough of an edge case that it doesn't seem worth serious work.
This is allowed in the spec; but objects are not supported by jsep and the use case for this type of expression is kind of an edge case — so it's probably not worth trying to adjust the parser to support this edge case.
If you disagree, please consider filing an issue and/or PR.
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