Skip to content

Data Compression #545

Answered by cyrilletuzi
daswass asked this question in Q&A
Feb 11, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

is there any plan to support schemas validation on compressed data

It wouldn't make sense. If a string is stored (no matter what the string is exactly), the JSON schema for strings must be used:

// Somewhere
const compressedData = someCompressionLib.compress(someData); // string
this.storage.set('key', compressedData).subscribe();

// Elsewhere
this.storage.get('key', { type: 'string' }).subscribe((compressedData) => {
  compressedData; // string
});

What you do with the data after that is no more the concern of the lib. So if you need to decompress with some lib, and you need to validate the result of this other lib, you can do so in any way you want.

You should be able to use the JSON…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@daswass
Comment options

Answer selected by cyrilletuzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants