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

ast-ts

Package Overview
Dependencies
Maintainers
13
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-ts - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

2

package.json
{
"name": "ast-ts",
"version": "1.4.0",
"version": "1.5.0",
"description": "ast representation and transform function with typescript definitions",

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

@@ -24,1 +24,8 @@ import { ASTContent, ASTNode } from '@stridespark/model-core';

export declare function retagNodes(node: ASTNode, replace: string, replaceWith: string): ASTNode;
/**
* Returns an array of ASTs, each of which represents a condition sufficient for the expression to evaluate true.
* The array of ASTs comprise the input node, split on "or"s.
* For example, "a and (b or c)" will not be split, but "a or (b or c) or d" will be split into an array of 4 ASTs.
* @param node
*/
export declare function splitOnOr(node: ASTContent): ASTContent[];

@@ -89,2 +89,18 @@ "use strict";

}
/**
* Returns an array of ASTs, each of which represents a condition sufficient for the expression to evaluate true.
* The array of ASTs comprise the input node, split on "or"s.
* For example, "a and (b or c)" will not be split, but "a or (b or c) or d" will be split into an array of 4 ASTs.
* @param node
*/
function splitOnOr(node) {
if (node == undefined) {
throw new Error('Invalid ASTContent passed into function splitOnOr');
}
if (typeof node === 'string' || node.tag !== 'or' || node.content === null) {
return [node];
}
return Array.prototype.concat.apply([], node.content.map(splitOnOr));
}
exports.splitOnOr = splitOnOr;
//# sourceMappingURL=index.js.map
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