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

ast-kit

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-kit - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

14

./dist/index.js

@@ -227,11 +227,15 @@ // src/check.ts

return [resolveString(node)];
if (isTypeOf(node.object, [
const left = node.type === "TSQualifiedName" ? node.left : node.object;
const right = node.type === "TSQualifiedName" ? node.right : node.property;
const computed = node.type === "TSQualifiedName" ? false : node.computed;
if (isTypeOf(left, [
"Identifier",
"MemberExpression",
"ThisExpression",
"Super"
"Super",
"TSQualifiedName"
])) {
const keys = resolveIdentifier(node.object);
if (isTypeOf(node.property, ["Identifier", "PrivateName", "Literal"])) {
keys.push(resolveString(node.property, node.computed));
const keys = resolveIdentifier(left);
if (isTypeOf(right, ["Identifier", "PrivateName", "Literal"])) {
keys.push(resolveString(right, computed));
} else {

@@ -238,0 +242,0 @@ throw new TypeError("Invalid Identifier");

@@ -40,3 +40,3 @@ import * as t from '@babel/types';

declare function resolveTemplateLiteral(node: t.TemplateLiteral): string;
declare function resolveIdentifier(node: t.Identifier | t.PrivateName | t.MemberExpression | t.ThisExpression | t.Super): string[];
declare function resolveIdentifier(node: t.Identifier | t.PrivateName | t.MemberExpression | t.ThisExpression | t.Super | t.TSEntityName): string[];
type ObjectPropertyLike = t.ObjectMethod | t.ObjectProperty | t.TSMethodSignature | t.TSPropertySignature;

@@ -43,0 +43,0 @@ declare function resolveObjectKey(node: ObjectPropertyLike, raw?: false): string | number;

@@ -227,11 +227,15 @@ // src/check.ts

return [resolveString(node)];
if (isTypeOf(node.object, [
const left = node.type === "TSQualifiedName" ? node.left : node.object;
const right = node.type === "TSQualifiedName" ? node.right : node.property;
const computed = node.type === "TSQualifiedName" ? false : node.computed;
if (isTypeOf(left, [
"Identifier",
"MemberExpression",
"ThisExpression",
"Super"
"Super",
"TSQualifiedName"
])) {
const keys = resolveIdentifier(node.object);
if (isTypeOf(node.property, ["Identifier", "PrivateName", "Literal"])) {
keys.push(resolveString(node.property, node.computed));
const keys = resolveIdentifier(left);
if (isTypeOf(right, ["Identifier", "PrivateName", "Literal"])) {
keys.push(resolveString(right, computed));
} else {

@@ -238,0 +242,0 @@ throw new TypeError("Invalid Identifier");

{
"name": "ast-kit",
"version": "0.7.0",
"version": "0.8.0",
"packageManager": "pnpm@8.6.0",

@@ -5,0 +5,0 @@ "description": "AST Toolkit.",

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