Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
json-schema-strictly-typed
Advanced tools
[![CircleCI](https://circleci.com/gh/unmock/json-schema-fast-check.svg?style=svg)](https://circleci.com/gh/unmock/json-schema-fast-check) [![codecov](https://codecov.io/gh/unmock/json-schema-fast-check/branch/master/graph/badge.svg)](https://codecov.io/g
JSON Schema is a useful way to define input and output schemas.
Typescript is a useful way to verify the types of JavaScript objects.
json-schema-strictly-typed
implements a strict flavor of the JSON Schema 7 specification for typing. By strict, we mean that it is organized into logical types that represent real usage, disallowing certain "nonsense" combinations of fields.
import { JSSTInteger } from "json-schema-strictly-typed";
test("my schema is an integer", () => {
JSSTInteger.is({ type: "integer" });
});
Here are all of the types in the API. Some of them also have sub-types for useful validation. In addition to canonical JSON Schema 6, we have added an optional faker
field to the string
type to use faker-like packages.
JSSTEmpty
JSSTConst
JSSTRefer
enceJSSTNull
JSSTBoolean
JSSTInteger
JSSTSimpleInteger
JSSTIntegerWithMinimum
JSSTIntegerWithMaximum
JSSTIntegerWithBounds
JSSTIntegerWithNumericExclusiveBounds
JSSTIntegerWithNumericExclusiveMaximum
JSSTIntegerWithNumericExclusiveMinimum
JSSTIntegerEnum
JSSTNumber
JSSTSimpleNumber
JSSTNumberEnum
JSSTString
JSSTSimpleString
JSSTRegex
JSSTStringEnum
JSSTArray
JSSTList
JSSTTuple
JSSTObject
JSSTOneOf
JSSTAnyOf
JSSTAllOf
JSSTNot
Additionally, top-level versions of all of these are available by adding TopLevel
to the definition. Top-level JSON Schema objects contain optional fields like $id
, $schema
and definitions
.
There is plenty of stuff that is not implemented yet. I'd really appreciate your help!
|
for types to avoid nonsense unoinsFAQs
[![CircleCI](https://circleci.com/gh/unmock/json-schema-fast-check.svg?style=svg)](https://circleci.com/gh/unmock/json-schema-fast-check) [![codecov](https://codecov.io/gh/unmock/json-schema-fast-check/branch/master/graph/badge.svg)](https://codecov.io/g
The npm package json-schema-strictly-typed receives a total of 43,288 weekly downloads. As such, json-schema-strictly-typed popularity was classified as popular.
We found that json-schema-strictly-typed 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.