
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
An OData compliant querystring parser and serializer
import { parse } from "odata-qs"
const query = parse(
`(name eq 'Jacob' or name eq 'John') and age gt 18 and age lt 65`,
"and"
)
{
age: {
gt: {
operator: "gt",
subject: "age",
values: [18],
},
lt: {
operator: "lt",
subject: "age",
values: [65],
},
},
name: {
eq: {
operator: "eq",
subject: "name",
values: ["Jacob", "John"],
},
},
}
If you want a type-safe result, you can pass a third argument as an array of allowed subjects. If the query contains a subject that isn't in the array, it will throw an error at runtime, and during development you'll get full intellisense support.
import { parse } from "odata-qs"
const filter = parse(
`(name eq 'Jacob' or name eq 'John') and age gt 18 and age lt 65`,
"and",
["name", "age"]
)
filter.name // ✅
filter.age // ✅
filter.foo // Property 'foo' does not exist on type Record<'name' | 'age', …>
Serializing a filter expects a structured object with subject, operator, and value properties.
import { serialize } from "odata-qs"
serialize({
subject: "name",
operator: "eq",
value: "Jacob",
}) // name eq 'Jacob'
serialize({
subject: {
subject: "name",
operator: "eq",
value: "Jacob",
},
operator: "or",
value: {
subject: "name",
operator: "eq",
value: "John",
},
}) // name eq 'Jacob' or name eq 'John'
FAQs
An OData compliant querystring parser
The npm package odata-qs receives a total of 534 weekly downloads. As such, odata-qs popularity was classified as not popular.
We found that odata-qs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.