Liking cljdoc? Tell your friends :D

otarta.format


edncljs

Read and write data encoded in edn. write is strict in that it checks whether what it will write is actually readable. This makes writing records impossible.

Read and write data encoded in edn.
`write` is strict in that it checks whether what it will write is actually readable.
This makes writing records impossible.
sourceraw docstring

emptycljs

source

find-payload-formatcljs

(find-payload-format fmt)
source

jsoncljs

Read and write data encoded in json

Read and write data encoded in json
sourceraw docstring

msg-formattercljs

(msg-formatter rw format)
source

payload-formatscljs

source

PayloadFormatcljsprotocol

Implement read and write operation for reading and writing data to Uint8Array.

When implementing these functions keep in mind that:

  • the format is bypassed for messages containing {:empty? true} (ie no need to handle writing/reading "")
  • an error should be thrown when reading/writings fails (or would write non-readable data). This signals to the caller that the formatting failed.
Implement read and write operation for reading and writing data to Uint8Array.

When implementing these functions keep in mind that:
- the format is bypassed for messages containing {:empty? true} (ie no need to handle writing/reading "")
- an error should be thrown when reading/writings fails (or would write non-readable data). This signals to the caller that the formatting failed.

-writecljs

(-write format value)

-readcljs

(-read format arraybuffer)
sourceraw docstring

rawcljs

source

readcljs

(read format)
(read format msg)

Applies format to :payload of msg or yields a reader when no msg given. When msg contains [:empty? true], the empty-format is used instead of format.

format can be one of payload-formats, or a reify of PayloadFormat.

Yields [err msg-with-formatted-payload] Possible err's:

  • :unknown-format
  • :format-error

Examples: (read :json {:payload #js [34,97,34]) ;; => [nil {:payload "a"}]

(read :json {:empty? true :payload #js [34,97,34]) ;; => [nil {:empty? true :payload ""}]

Applies `format` to :payload of `msg` or yields a reader when no `msg` given.
When `msg` contains [:empty? true], the empty-format is used instead of `format`.

`format` can be one of payload-formats, or a reify of PayloadFormat.

Yields [err msg-with-formatted-payload]
Possible err's:
- :unknown-format
- :format-error

Examples:
(read :json {:payload #js [34,97,34])
;; => [nil {:payload "a"}]

(read :json {:empty? true :payload #js [34,97,34])
;; => [nil {:empty? true :payload ""}]
sourceraw docstring

stringcljs

source

transitcljs

Read and write data encoded in transit+json.

Read and write data encoded in transit+json.
sourceraw docstring

writecljs

(write format)
(write format msg)

Applies format to :payload of msg or yields a writer when no msg given. When msg has [:empty? true], the empty-format is used instead of format.

format can be one of payload-formats, or a reify of PayloadFormat.

Yields [err msg-with-formatted-payload] Possible err's:

  • :unknown-format
  • :format-error

Examples: (write :json {:payload "a") ;; => [nil {:payload #object[Uint8Array 34,97,34]}]

(write :json {:empty? true :payload "a"} ;; => [nil {:payload #object[Uint8Array ]}]

Applies `format` to :payload of `msg` or yields a writer when no `msg` given.
When `msg` has [:empty? true], the empty-format is used instead of `format`.

`format` can be one of `payload-formats`, or a reify of PayloadFormat.

Yields [err msg-with-formatted-payload]
Possible err's:
- :unknown-format
- :format-error

Examples:
(write :json {:payload "a")
;; => [nil {:payload #object[Uint8Array 34,97,34]}]

(write :json {:empty? true :payload "a"}
;; => [nil {:payload #object[Uint8Array ]}]
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close