-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: inline
json-joy
dependency (#999)
* feat: inline `json-joy` * feat: remove unneeded files * feat: remove even more unneeded files * chore: don't apply prettier to `json-joy` code
- Loading branch information
Showing
41 changed files
with
3,193 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/json-joy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { CborEncoder } from 'json-joy/es6/json-pack/cbor/CborEncoder'; | ||
import { CborDecoder } from 'json-joy/es6/json-pack/cbor/CborDecoder'; | ||
import { CborEncoder } from '../json-joy/json-pack/cbor/CborEncoder'; | ||
import { CborDecoder } from '../json-joy/json-pack/cbor/CborDecoder'; | ||
|
||
export const encoder = new CborEncoder(); | ||
export const decoder = new CborDecoder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* A wrapping for MessagePack extension or CBOR tag value. When encoder | ||
* encounters {@link JsonPackExtension} it will encode it as a MessagePack | ||
* extension or CBOR tag. Likewise, the decoder will | ||
* decode extensions into {@link JsonPackExtension}. | ||
* | ||
* @category Value | ||
*/ | ||
export class JsonPackExtension<T = Uint8Array> { | ||
constructor(public readonly tag: number, public readonly val: T) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Use this wrapper is you have a pre-encoded MessagePack or CBOR value and you would | ||
* like to dump it into a the document as-is. The contents of `buf` will | ||
* be written as is to the document. | ||
* | ||
* It also serves as CBOR simple value container. In which case the type of value | ||
* `val` field is "number". | ||
* | ||
* @category Value | ||
*/ | ||
export class JsonPackValue<T = Uint8Array> { | ||
constructor(public readonly val: T) {} | ||
} |
Oops, something went wrong.