
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Converts Flow declarations to TypeScript.
It is focused to work with code specially written for Flowest, not some random Flow code.
You can install js_of_ocaml version via npm:
$ npm install -D flowest
# Or: $ npm install --global flowest
Flowest can also be compiled to native code.
You can manually build it from the source code (it should work much faster).
$ flowest <input-file> <output-file>
# Or: $ npx flowest <input-file> <output-file>
It supports raw TypeScript via /*$$ ... */
:
type A = string
/*$$
type B = Partial<{ a: A, b: number }>
*/
/*::
type C = 3
*/
Output:
type A = string
type B = Partial<{ a: A, b: number }>
type C = 3
flowest-remove-next-line
and flowest-remove-line
:
/*$$ type D = Partial<{ a: A, b: number }> */
// flowest-remove-next-line
type D = $Shape<{ a: A, b: number }>
Output:
type D = Partial<{ a: A, b: number }>
Status | Name | Flow | TypeScript |
---|---|---|---|
✅ | Maybe | ?T | T | null | undefined |
✅ | Null | null | null |
✅ | Mixed | mixed | unknown |
✅ | Void | void | void 🚩 |
BigInt | type A = 2n | type A = 2n | |
✅ | Union | `A | B |
✅ | Intersection | A & B & C | A & B & C |
✅ | Typeof | typeof T | typeof T |
✅ | Tuples | [T, U] | [T, U] |
✅ | Functions | (A, B) => C | (a: A, b: B) => C |
✅ | Predicates | (A, B) => C %checks | (a: A, b: B) => C 🚩 |
✅ | Inexact types | { a: A, ... } or { a: A } | { a: A } 🚩 |
✅ | Exact types | {| a: A |} | { a: A } 🚩 |
✅ | Existential types | * | any (not expressible) 🚩 |
✅ | Indexers | { [K]: T } | { [key: K]: T } |
✅ | Bounds | <T: string> | <T extends string> |
✅ | Read-only fields | interface A { +b: B } | interface A { readonly b: B } |
✅ | Write-only fields | interface A { -c: C } | interface A { c: C } 🚩 |
Inline interfaces | type T = interface { a: A } | - | |
Spread properties | { a: A, ...O } | - | |
Internal slots | { [[call]]: T => U } | - | |
Generator | - | - | |
AsyncGenerator | - | - | |
✅ | Partial | $Rest<T, {}> | Partial<T> |
$Shape | $Shape<T> | - (not expressible) | |
✅ | $ReadOnly | $ReadOnly<T> | Readonly<T> |
✅ | $ReadOnlyArray | $ReadOnlyArray<T> | ReadonlyArray<T> |
✅ | $Keys | $Keys<T> | keyof T |
✅ | $Values | $Values<T> | T[keyof T] |
✅ | $Exact | $Exact<T> | T 🚩 |
✅ | Class | Class<T> | typeof T |
✅ | Property type | $PropertyType<O, k> | O[k] |
✅ | Element type | $ElementType<T, K> | T[K] |
✅ | Return type | $Call<F> | ReturnType<F> |
$Call | $Call<F, A1, A2, ..., Ak> | - (not expressible) | |
$Rest | $Rest<O1, O2> | - | |
$Diff | $Diff<O1, O2> | - | |
$ObjMap | $ObjMap<{ a: A }, <X>(X) => X> | - | |
$ObjMapi | $ObjMapi<{ a: A }, <I>(I) => I> | - | |
$TupleMap | $TupleMap<[1, 2, 3], <X>(X) => X> | - | |
✅ | $NonMaybeType | $NonMaybeType<T> | NonNullable<T> 🚩 |
$CharSet | $CharSet<"abc"> | - (not expressible) | |
$Trusted | $Trusted<T> | - (not expressible) | |
$Private | $Private<T> | - (not expressible) |
Status | Name | Flow | TypeScript |
---|---|---|---|
✅ | Import default type | import type T from './b' | import T from './b' |
✅ | Import named type | import type { T } from './b' | import { T } from './b' |
✅ | Export type | export type { T } | export { T } |
✅ | Declare export | declare export class Cl {} | export declare class Cl {} |
Declare export default | declare export default string | - | |
Declare module | declare module 'm' { } | - | |
Declare module exports | declare module.exports: T | - | |
✅ | Type alias | type T = string | type T = string |
✅ | Declare type alias | declare type T = string | declare type T = string |
✅ | Interface | interface I extends A, B {} | interface I extends A, B {} |
✅ | Declare interface | declare interface I {} | declare interface I {} |
Opaque type | opaque type T = string | - | |
Declare opaque type | declare opaque type T = string | - | |
✅ | Declare variable | declare var a: number | declare var a: number |
✅ | Declare function | declare function f(string): number | declare function f(a: string): number |
✅ | Declare class | declare class B<T, U = D> extends A implements I1, I2 {} | the same |
mixins in declare class | declare class B mixins A {} | - |
You can manually write TS code inside /*$$ ... */
for a feature that is not supported.
Supported version of Flow parser: 0.96.1
FAQs
Convert Flow to TypeScript
The npm package flowest receives a total of 0 weekly downloads. As such, flowest popularity was classified as not popular.
We found that flowest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.