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

flow-infer-type

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-infer-type - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

__Trash/test.js

17

dist/bin.js

@@ -6,6 +6,19 @@ #!/usr/bin/env node

const parse = str => {
let result;
try {
// good json
result = JSON.parse(str.toString());
} catch (e) {
// plain js object
eval(`result = ${str}`);
}
return result;
};
process.stdin.resume();
process.stdin.on('data', data => {
const obj = JSON.parse(data.toString());
console.log(createFlowType(obj));
console.log(createFlowType(parse(data)));
});

2

package.json
{
"name": "flow-infer-type",
"version": "1.1.2",
"version": "1.1.3",
"description": "Generate flow type description from given object",

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

@@ -5,4 +5,12 @@ # About

# Install
```
npm i -g flow-infer-type
```
# Usage
`echo '{"a": "ssss"}' | node src/bin.js`
## json
```bash
echo \'{"a": "ssss"}\' | node flow-infer-type
```
{

@@ -14,3 +22,3 @@ a: string

## clipboard
```bash

@@ -21,3 +29,8 @@ pbpaste | node flow-infer-type

## js object
```bash
echo \'{a: "ssss"}\' | node flow-infer-type
```
# Test

@@ -24,0 +37,0 @@ ```bash

@@ -5,6 +5,19 @@ #!/usr/bin/env node

const parse = (str) => {
let result
try {
// good json
result = JSON.parse(str.toString())
} catch (e) {
// plain js object
eval(`result = ${str}`)
}
return result
}
process.stdin.resume()
process.stdin.on('data', data => {
const obj = JSON.parse(data.toString())
console.log(createFlowType(obj))
console.log(createFlowType(parse(data)))
})

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