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

astoptech

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astoptech - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

src/typeofOperatorReduction.js

4

CHANGELOG.md
# CHANGELOG
## 1.0.4
- new method: typeofOperatorReduction
## 1.0.3

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

4

index.js

@@ -6,2 +6,3 @@ const binaryExpressionReduction = require('./src/binaryExpressionReduction')

const ternaryOperatorReduction = require('./src/ternaryOperatorReduction')
const typeofOperatorReduction = require('./src/typeofOperatorReduction')

@@ -13,3 +14,4 @@ module.exports = {

logicalExpressionReduction,
ternaryOperatorReduction
ternaryOperatorReduction,
typeofOperatorReduction
}
{
"name": "astoptech",
"version": "1.0.3",
"version": "1.0.4",
"description": "abstract syntax tree optimization techniques",
"main": "index.js",
"scripts": {
"test": "node src/binaryExpressionReduction.spec.js && node src/ifStatementRemoval.spec.js && node src/negationOperatorRemoval.spec.js && node src/logicalExpressionReduction.spec.js && node src/ternaryOperatorReduction.spec.js",
"test": "node src/binaryExpressionReduction.spec.js && node src/ifStatementRemoval.spec.js && node src/negationOperatorRemoval.spec.js && node src/logicalExpressionReduction.spec.js && node src/ternaryOperatorReduction.spec.js && node src/typeofOperatorReduction.spec.js",
"lint": "standard"

@@ -9,0 +9,0 @@ },

@@ -296,1 +296,36 @@ # astoptech

```
### typeofOperatorReduction
```js
const foo = typeof "bar"
```
It's possible to determine the type of some variables during analysis.
```js
const foo = "string"
```
The tree would be translated from:
```json
{
"type": "UnaryExpression",
"operator": "typeof",
"prefix": true,
"argument": {
"type": "Literal",
"value": "foo"
}
}
```
To:
```json
{
"type": "Literal",
"value": "string"
}
```
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