Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: downstream dts parse-json-string types #314

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/schemata/ParseJsonString.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,27 @@ Added in v2.0.0

<h2 class="text-delta">Table of contents</h2>

- [Model](#model)
- [JsonString (type alias)](#jsonstring-type-alias)
- [Printer Parsers](#printer-parsers)
- [ParseJsonString](#parsejsonstring)

---

# Model

## JsonString (type alias)

A branded string representing a parsable JSON string

**Signature**

```ts
export type JsonString = _.JsonString
```

Added in v2.2.3

# Printer Parsers

## ParseJsonString
Expand Down
30 changes: 15 additions & 15 deletions docs/schemata/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ has_children: true

### String (17)

* Ascii ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Ascii.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Ascii.ts)) (e.g: `U/%dL*`, `w0kXhQk`, `qMU6/kj$`)
* Base64 ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64.ts)) (e.g: `/3+Oif4L+++71dY=`, `Dd//F8==`, `xL9//+D+CpbB//+sEakb28/UT12z/Bk1vER/`)
* Base64Url ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64Url.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64Url.ts)) (e.g: `C--t_--h-`, `A4V-H8`, `k-N-_Pbj_o`)
* BitcoinAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/BitcoinAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/BitcoinAddress.ts)) (e.g: `bc1kcy66x86g607p30l81a2uuu84`, `1F8RM7QYELRSHQLHjCWNQ4tL5JJ1`, `2K4B79LsUcQqPqHSVF4XrPpMLWaLkpsMK4PzKn`)
* Ascii ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Ascii.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Ascii.ts)) (e.g: `H.*Gsx`, `F+{y`, `0tE'?j}dQy`)
* Base64 ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64.ts)) (e.g: `1I95+//7+51M++n5+h/C9/P++0i+PHw+`, `5+2/++k83a5//+++`, `7E/1+017HXGT`)
* Base64Url ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64Url.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64Url.ts)) (e.g: `7FLto--`, `3t_-A94`, `C--d3___`)
* BitcoinAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/BitcoinAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/BitcoinAddress.ts)) (e.g: `1d9LBJjPnRCLFpxMNmxYcCncAR11J`, `bc1132b3d00ce5ecb221x3azt78y6bd`, `1Gd8By3Sx8UemNY2hF7NFL4J9LwouCNkB3M`)
* CamelCaseString ([docs](https://jacob-alford.github.io/schemata-ts/schemata/CamelCaseString.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/CamelCaseString.ts)) (e.g: `Camel_case-string` → `camelCaseString`)
* CreditCard ([docs](https://jacob-alford.github.io/schemata-ts/schemata/CreditCard.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/CreditCard.ts)) (e.g: `6229236020562382716`, `35286124590113741`, `50819672519200226`)
* EmailAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EmailAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EmailAddress.ts)) (e.g: `"ꙵ︘ꈶ펴홙Ӈ쎶獙鼫"@[8.7.3.973]`, `~K~_'!*+!+?P@[0.13.2.06]`, `"謁"@6Y.--0-02Zp.oC-..rIvj`)
* EthereumAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EthereumAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EthereumAddress.ts)) (e.g: `0xEC6Efcbb09dfb09EeCCe0C4bC1104dfCcdAdAc9E`, `0xAfFF2ecE0ac2a6c80B0AEC3EEECd7Ee1f1d2D060`, `0xcFcD6fBCb2A8Ab2fbcC4ea72BB1f8Aebb8B63D2C`)
* HexColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HexColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HexColor.ts)) (e.g: `5aFCa33b`, `#a6de6cAb`, `AE88a9`)
* Hexadecimal ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Hexadecimal.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Hexadecimal.ts)) (e.g: `0HB311cAfADd`, `bc0AF1`, `ce1Cef8`)
* HslColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HslColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HslColor.ts)) (e.g: `hsla(+334831139turn,+00000.462796354%,+000000.01302e57509%)`, `hsl(103026e-570028333020,000000000.06488404874%,+0000000.24%,814772300%)`, `hsla(.960226,00.1071%,+0016.091933309e+39598640%,.0)`)
* Jwt ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Jwt.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Jwt.ts)) (e.g: `_._u0P_a--06.CPaK-k_X`, `-z--0NX.`, `G_V__d8-.-._`)
* LatLong ([docs](https://jacob-alford.github.io/schemata-ts/schemata/LatLong.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/LatLong.ts)) (e.g: `(90.000000000,180.0)`, `89.575329827,180`, `90.0000,+91.83121`)
* NonEmptyString ([docs](https://jacob-alford.github.io/schemata-ts/schemata/NonEmptyString.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/NonEmptyString.ts)) (e.g: `e1450d`, `n*%=88{8`, `>M@zv`)
* RGB ([docs](https://jacob-alford.github.io/schemata-ts/schemata/RGB.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/RGB.ts)) (e.g: `rgba(100%,2%,100%,0.182734573211)`, `rgba(30,94,99,1.0)`, `rgba(100%,2%,50%,.9899791962)`)
* CreditCard ([docs](https://jacob-alford.github.io/schemata-ts/schemata/CreditCard.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/CreditCard.ts)) (e.g: `50801313963963700`, `6283198967192904`, `3028258966393379`)
* EmailAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EmailAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EmailAddress.ts)) (e.g: `_-&~V/-@9Uq6ED1.7---t-j.6p4O.i--.t2415i.-o-3n8-lK.-.-T9I71B-.39C3o5F96.-H51HRZRT-.9l-O-1cS-2.lchEPqZ`, `"燵䐜侑趢╿⒡"@[7.2.97.9]`, `--_-'@.ub3LH.0-.-hMD-Fw-i-.9..i-..1Y-337v.0L-0--W.CAyzcracDE`)
* EthereumAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EthereumAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EthereumAddress.ts)) (e.g: `0x3A628BFA1aFd2B8dcBBEb99BB436a6eB1BbefBcf`, `0xcBAbaDbAeD4bcDC13EccAba59F1FDdeFBDaa92EE`, `0xF105EcacFaeB0A70969baD9dEbCCb56DEEabBdce`)
* HexColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HexColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HexColor.ts)) (e.g: `#DbcFDfCC`, `1eaDfA`, `#fBb53C`)
* Hexadecimal ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Hexadecimal.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Hexadecimal.ts)) (e.g: `CE4eB0E`, `0HfCFcba`, `0H887dbf`)
* HslColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HslColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HslColor.ts)) (e.g: `hsl(.26881612562e42,000000000.978032341e423434320%,+0000000000.098184945347%,20e32894)`, `hsla(.9152574174+00062.2e235%+00.7%)`, `hsla(-.88908turn00000000.8319%000100%/7238096.8e78)`)
* Jwt ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Jwt.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Jwt.ts)) (e.g: `-829z.`, `m-f-Q_I.`, `.-_c2_.`)
* LatLong ([docs](https://jacob-alford.github.io/schemata-ts/schemata/LatLong.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/LatLong.ts)) (e.g: `(-82,106.44052800176)`, `(-90.000000,180)`, `82.823803,+180.0`)
* NonEmptyString ([docs](https://jacob-alford.github.io/schemata-ts/schemata/NonEmptyString.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/NonEmptyString.ts)) (e.g: `aa10e2be`, `931155df0be`, `!EVr`)
* RGB ([docs](https://jacob-alford.github.io/schemata-ts/schemata/RGB.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/RGB.ts)) (e.g: `rgb(37%,100%,92%)`, `rgba(96%,95%,98%,0.5789994179)`, `rgba(3%,100%,100%,.7)`)
* String ([docs](https://jacob-alford.github.io/schemata-ts/schemata/String.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/String.ts))
* UUID ([docs](https://jacob-alford.github.io/schemata-ts/schemata/UUID.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/UUID.ts)) (e.g: `Ac9eA23B-D14f-35bA-93Dd-bAcFbfbfd1Ee`, `24D4FaC9-dE13-E6AB-1aEF-61aAecaAAD61`, `1cBBA1FD-1EF8-91eB-aca7-2b82C02FdC2C`)
* UUID ([docs](https://jacob-alford.github.io/schemata-ts/schemata/UUID.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/UUID.ts)) (e.g: `ab3FDCc1-aBfd-8D66-2396-bf6Babaa2182`, `CADfa2ad-0Bd1-7cDc-8f2C-b9EAdc3E6ceA`, `9FBBCAfC-3Ae1-D87e-ba8d-aa13D73C25d2`)

### Unit (1)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "schemata-ts",
"version": "2.2.2",
"version": "2.2.3",
"description": "An all-inclusive schema engine featuring schemata inspired by io-ts and validators.js. Written for TypeScript with fp-ts",
"homepage": "https://jacob-alford.github.io/schemata-ts/",
"repository": {
Expand Down
10 changes: 9 additions & 1 deletion src/schemata/ParseJsonString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
import { type Const } from 'fp-ts/Const'
import * as E from 'fp-ts/Either'
import { type Schema } from 'schemata-ts/Schema'
import { type JsonString } from 'schemata-ts/schemables/parser/definition'
import type * as _ from 'schemata-ts/schemables/parser/definition'
import { ParseEncodedJsonString } from 'schemata-ts/schemata/ParseEncodedJson'

/**
* A branded string representing a parsable JSON string
*
* @since 2.2.3
* @category Model
*/
export type JsonString = _.JsonString

/**
* Parses a Json string using supplied schema
*
Expand Down
Loading