
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
A CLI command for converting JSX files into standard JS.
Usage:
npx jsx-to-h <glob> [--write] [--factory='h'] [--flow]
or
node ./node_modules/jsx-to-h/src/cli.mjs <glob> [--write] [--factory='h']
Some examples of what <glob>
can be:
build/**/*.js
build/**/*{.js,.jsx}
file.js
--write
- Causes the files matching the glob to be overwritten by the output, otherwise output goes to stdout.--factory='h'
- By default the factory function is h
. Use this to change it.--flow
- Passes the input through flow-remove-types
before transforming.Input:
// Instances of React are transformed as well
import React from "hyperscript"
const signs = [{ value: "+" }, { value: "-" }]
const renderSign = (props) => {
return (
<span>{props.value}</span>
)
}
const Component = () => (<div></div>)
const test = (
<div style={{color: 'orange'}}>
<Component />
<button
onClick={() => {
const el = <div/>
console?.log(el)
}}
{...passProps}
/>
{signs.map(renderSign)}
</div>
)
Output:
// Instances of h are transformed as well
import h from "hyperscript"
const signs = [{ value: "+" }, { value: "-" }]
const renderSign = (props) => {
return h("span", null, [props.value])
}
const Component = () => h("div", null, [])
const test = h("div", { style: { color: "orange" } }, [
Component({}),
h(
"button",
{
onClick: () => {
const el = h("div", null, [])
console?.log(el)
},
...passProps,
},
[]
),
signs.map(renderSign),
])
Fragments are supported, too:
// input
function renderRow() {
return (
<>
<span/>
<span/>
</>
)
}
// output
function renderRow() {
return (
[
h('span', null, []),
h('span', null, [])
]
)
}
FAQs
A CLI command for converting JSX files into standard JS.
The npm package jsx-to-h receives a total of 0 weekly downloads. As such, jsx-to-h popularity was classified as not popular.
We found that jsx-to-h 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.