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

clarity-pattern-parser

Package Overview
Dependencies
Maintainers
0
Versions
181
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clarity-pattern-parser - npm Package Compare versions

Comparing version 10.3.0 to 10.3.1

2

package.json
{
"name": "clarity-pattern-parser",
"version": "10.3.0",
"version": "10.3.1",
"description": "Parsing Library for Typescript and Javascript.",

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

@@ -99,2 +99,30 @@ import { Options } from "./Options";

function createTailExpression() {
const a = new Literal("a", "a");
const b = new Literal("b", "b");
const c = new Literal("c", "c");
const variable = new Options("variable", [a, b, c]);
const period = new Literal(".", ".");
const refinement = new Sequence("refinement", [period, variable]);
const refinementExpression = new Sequence("refinement-expression", [
new Reference("expression"),
refinement
]);
const invocation = new Literal("invocation", "()");
const invocationExpression = new Sequence("invocation-expression", [
new Reference("expression"),
invocation
]);
const expression = new ExpressionPattern("expression", [
refinementExpression,
invocationExpression,
variable
]);
return expression;
}
describe("Expression Pattern", () => {

@@ -117,2 +145,12 @@ test("Single Expression", () => {

test("Tail", () => {
const expression = createTailExpression();
let result = expression.exec("a");
result = expression.exec("a.b");
result = expression.exec("a.b.c");
result = expression.exec("a.b.c()()()");
expect(result).toBe(result);
});
test("Options like", () => {

@@ -119,0 +157,0 @@ const expression = createOptionsExpression();

@@ -214,3 +214,2 @@ import { Node } from "../ast/Node";

parse(cursor: Cursor): Node | null {
// This is a cache to help with speed
this._firstIndex = cursor.index;

@@ -334,3 +333,5 @@ depthCache.incrementDepth(this._id, this._firstIndex);

}
break;
onIndex = cursor.index;
i = -1;
continue;
}

@@ -337,0 +338,0 @@ }

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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