
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
rescript-funicular
Advanced tools
npm i rescript-funicular -S # yarn add rescript-funicular
bsconfig.json "bs-dependencies": [
...
"rescript-funicular",
]
Define your type:
type customer = {
customerNo: int,
name: string,
orders: array<order>,
}
And write a decoder function:
// Write decoder functions that translate the JSON structure into your fields
let decodeCustomer = value => {
open Funicular.Decode
// first decode the value as an object
let o = value->object_
// extract and parse each field of the object using the relevant decoder
let customerNo = o->field("customerNo", integer)
let name = o->field("name", string)
// `decodeOrder` is a custom decoder for the `order` type
let orders = o->field("orders", array(decodeOrder))
// Use `rmap()` to wrap your builder function, and then feed in each parameter with `v()`
rmap((customerNo, name, orders) => {customerNo: customerNo, name: name, orders: orders})
->v(customerNo)
->v(name)
->v(orders)
}
Use the Funicular.Decode.parse function to parse your string, passing in your decoder:
// Parse with your custom decoder function for the root object
let customerString = `{"customerNo": 20, "name": "Chris", "orders": [] }`
let myCustomer = Funicular.Decode.parse(customerString, decodeCustomer);
Encoding is simpler - a straight type conversion without the error-handling overhead:
let encodeCustomer = val => {
open Funicular.Encode
object_([
("customerNo", integer(val.customerNo)),
("name", string(val.name)),
("orders", array(val.orders, encodeOrder)),
])
}
FAQs
composable JSON parsing for ReScript
We found that rescript-funicular 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.