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
14
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 4.0.0-revert-119-revert-113-dali-typed.3542 to 4.0.0-uncase.4125

9

lib/src/index.d.ts

@@ -23,10 +23,3 @@ import { ASTContent, ASTNode } from '@stridespark/model-core';

export declare function filter(node: ASTContent, predicate: (node: ASTNode) => boolean): ASTNode[];
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[];
export declare function retagNodes(node: ASTNode, replace: string[], replaceWith: string): ASTNode;
//# sourceMappingURL=index.d.ts.map

@@ -82,3 +82,3 @@ "use strict";

}
if (node.tag === replace) {
if (replace.indexOf(node.tag) !== -1) {
node.tag = replaceWith;

@@ -90,18 +90,2 @@ }

}
/**
* 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

2

package.json
{
"name": "ast-ts",
"version": "4.0.0-revert-119-revert-113-dali-typed.3542",
"version": "4.0.0-uncase.4125",
"description": "ast representation and transform function with typescript definitions",

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

@@ -82,3 +82,3 @@ import { ASTContent, ASTNode } from '@stridespark/model-core';

export function retagNodes(node: ASTNode, replace: string, replaceWith: string): ASTNode {
export function retagNodes(node: ASTNode, replace: string[], replaceWith: string): ASTNode {
const copy = JSON.parse(JSON.stringify(node));

@@ -89,7 +89,7 @@ _retagInner(copy, replace, replaceWith);

function _retagInner(node: ASTContent, replace: string, replaceWith: string) {
function _retagInner(node: ASTContent, replace: string[], replaceWith: string) {
if (typeof node === 'string') {
return;
}
if (node.tag === replace) {
if (replace.indexOf(node.tag) !== -1) {
node.tag = replaceWith;

@@ -101,17 +101,1 @@ }

}
/**
* 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 function splitOnOr(node: ASTContent): ASTContent[] {
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));
}

Sorry, the diff of this file is not supported yet

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