question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add custom serializer option

See original GitHub issue

Currently JSONB.stringify/JSONB.parse is used for serializing/deserializing to support a wide range JavaScript Types.

Allowing users to set a custom a custom serializer function will allow for cleaner usage with custom data structures and enable performance improvements for people who don’t need all the type support JSONB provides.

Syntax should look something like:

const Keyv = require('keyv');
const { serialize, deserialize } = require('my-serializer');

const keyv = new Keyv({ serialize, deserialize });

Previous discussion in #22

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
lukechildscommented, Oct 3, 2017

Or to a rabbit on the internet.

0reactions
lukechildscommented, Nov 27, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to write custom converters for JSON serialization - .NET
This article shows how to create custom converters for the JSON serialization classes that are provided in the System.Text.Json namespace.
Read more >
Custom JSON serializer for optional property with System.Text ...
Json , your only option to conditionally omit optional properties without a value is to ... Here is one attempt to create such...
Read more >
Custom JSON Serialisation with System.Text.Json Converters
We first get the actual type of the object. With this in hand, we can call an overload of Serialize which accepts the...
Read more >
System.Text.Json - How to customize serialization with ...
To use this custom converter, you add it to JsonSerializarOptions.Converters, then pass the options in when you're using JsonSerializer, ...
Read more >
Serializers - Django REST framework
You can specify custom field-level validation by adding .validate_<field_name> methods to your Serializer subclass.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found