3.5.104 • Published 10 months ago

@erboladaiorg/earum-sequi v3.5.104

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

XtraJson

XtraJson offers a flexible solution to transform objects into JSON-serializable representations and back. Unlike other solutions, such as superjson, XtraJson efficiently handles transformations without unnecessarily duplicating objects.

Features

  • Out-of-the-box support for undefined, Buffer, Date, BigInt.
  • Ability to handle any other type using custom transformers.
  • Faster and more efficient than superjson.

Why XtraJson?

While libraries like SuperJSON create a copy of any object, even if it doesn't need to be transformed, XtraJson ensures optimized and efficient transformations.

Usage

Basic Setup

import XtraJson from '@erboladaiorg/earum-sequi';

const xjs = new XtraJson();

Registering Custom Transformers

xjs.register({
    name: "my custom transformer",
    key: "c", // key should be unique and as short as possible
    isApplicable(value: unknown): value is MyClass {
        // Define when this transformer should be used
    },
    serialize(value) {
        // Convert your custom type to a JSON-serializable format
    },
    deserialize(value) {
        // Convert the JSON-serializable format back to your custom type
    }
});

Serialization & Deserialization

const data = xjs.serialize(payload); // Convert to a JSON-serializable object
const json = xjs.stringify(payload); // Convert to a JSON string

// Alternate methods using built-in JSON methods
const jsonAlt = JSON.stringify(payload, xjs.replacer); // Using XtraJson as a replacer
const resultAlt = JSON.parse(payload, xjs.reviver); // Using XtraJson as a reviver

const result = xjs.deserialize(data); // Convert back from a JSON-serializable object
const resultStr = xjs.parse(json); // Convert back from a JSON string
setterArray.prototype.flatoncecensorutilspushsnsprivatetypedscheme-validationcolumncharacterglobalawesomesauceclassesasterisksweakmapbyteLengthclassnamefunctionalcall-bindescapecommandbuffersmatchregexpframeworkworkspace:*whatwgidlefind-upregular-expressionacorndomMicrosoftoptimistresolvenodemake dirrouteobjectthreea11ydirArray.prototype.containsshellArrayhelperses6positivesortargumentES2020front-endfantasy-landObject.keysspinnersObject.fromEntriesguidpostcss-pluginlogginginstrumentationentriesinspectefficientArray.prototype.flattenmetadatautilitiesextendregexbddshebanggroupByeventDispatcherexecfileglaciernumberbinarytypeECMAScript 2022manipulationformswidthclass-validatorautoscalingreduceperformanceloggerES2022mkdirpgetPrototypeOfreact-hook-formtoolsreadabletakereact-hooks[[Prototype]]npmignorezerostringifymergedefineInt16Arraypromiseutil.inspecttoobjecttypestypedarrayES3ECMAScript 2018hookformrdsjestprotoECMAScript 2016ajvrequestrapideslintconfigformlocalprivate dataoptionES2023.gitignoreletgetintrinsicIteratoratom$.extendcryptoreact animationbinariescheckmapdeep-copytimeawsES2017reducerapollooffsetString.prototype.trimio-tsreversevalidpolyfillreadnamesqueueMicrotaskttystructuredClonermsomelockfiletraversebannerclonekeyssinatraaccessorlistenersmovetrimLeftservicesliceES2016es-shimsbufferinferencekeypatchESnextparserbyteOffsethas-ownSymbol.toStringTagTypeBoxmodulecloudformationprotobufiteratedeterministicemrflatfast-deep-copydeletemanagerrfc4122accessibilitysetPrototypeOfwarningfindcloudfrontinternallocationamazonimportstylingArray.prototype.flatMapsymbolsimpledbyupsymbolsjavascriptcolorrequirefastclonesescloudsearchvalidatorchrometypeofRFC-6455configurablexmldebuggerhashgetterincludesES5multi-packageObject.definePropertytoReversedpruneproptelephoneconcatMapECMAScript 5charactersjson-schemagitignoreagentrm -frprogressvaluearrayhtmlvarCSSReflect.getPrototypeOfArrayBuffer.prototype.sliceglobrangeerrorFloat64ArraydropES2018animationshimjsxECMAScript 2021springreworkdirectorytranspilelanguagecode pointsstringifierJSON-Schemanegative zeroflagsqsdataviewquotees2017react posezodECMAScript 2015environmentsarraybuffermkdirassertimportexportpipeeslintfast-deep-clonerandomdayjsdataES2015fastifymonorepoperformantcopypropertieshigher-ordernativeroute53Array.prototype.findLast@@toStringTagUint32ArrayRxwgetsyntaxerrorsham-0i18nproxypoint-freebundlingstyleguidegetoptObject.isrestful3darraysrecursivefeedpropertydeepcopyfpstslibbusyECMAScript 3rulessetjsdiffjsdommkdirsdateinstallerignoredependenciesextraserializercircularslotStreamdynamodbiamdependency managerWebSocketsspecqueryemojiwhichformatartcommand-lineoutputECMAScript 6rm -rfastURLpnpm9rmdirObject.valuesstreamstrimRights3WeakSetjson-schema-validationmapreducevariablesregular expressionsjQueryexecpackage manageroptimizerparsegdprrgbweb_.extendterminalredactobjformattingloadbalancingchaitypedarraysObject.getPrototypeOfhandlerclassnamesdataViewcreatees8hardlinkslogprettytrimEndcallbackflatMapmockcalleast-asian-widthcollectiontypeerrorutilityrobusthooksfindLastframerstringSetestreeruntimeramdaservermrucompareFloat32ArrayparentsexecuteisObjectdescriptionfunctionsUint8ClampedArrayschemefastArray.prototype.filtercommanderidRegExp.prototype.flagsstyleprocessPromiseES2021look-upString.prototype.matchAllargvswftestsuperstructspawnBigUint64ArraygesturessharedrouterjsoncolumnsregularappglobalsschemaflattensubprocessCSSStyleDeclarationuninstallYAMLboundyamlcontainsbindwaapiECMAScript 2017packagesindicatorredux-toolkitec2TypedArray0full-widthInt32ArrayprototypedeepmockingES2019httpsowneventEmitterisConcatSpreadableECMAScript 2019effect-tswalktypescriptmakesettingsdescriptorReactiveX.envvpcmodulestoSortedcloudwatchkinesisObject.entriesObservablearktypeimmerphoneinrestweaksetBigInt64ArrayassertstsHyBiparentstoragegatewayfast-copytouchconfigworkerforEachWeakMapimmutabletesterforkapifsfnmatchlibphonenumbertransformdeep-cloneeslint-pluginroutingponyfillenderreversedexpresscssfetchgetOwnPropertyDescriptorautoprefixercodesinstallminimalnpmredirectkarmaECMAScript 2020waitviewWebSocketRegExp#flagscoerciblecoverageES7AsyncIteratorfplruxhres2018tddlintmatchAllfindupintrinsicfilterremovecachetoolkiturlcss-in-jsES6fastcopysideenvFunction.prototype.namejshinttc39fromfullwidthbeanstalkhasargsflaglastassertionconsumevestcolorsserializationnopesqsfunction.lengthuuidstyled-componentshasOwnPropertydom-testing-librarypostcssfile systempathvalidatejson-schema-validatortapeelasticachewalkingJSONfunctionbrowserlistwritedotenvharmonyes2015sharedarraybufferES8preprocessorstreamelectronreadablestreambyteArrayBuffer#slicebrowserslisteventstrimendpointcjktoArrayreduxtestinggenericscall-boundutilStreamsInt8ArraytypanionprefixReactiveExtensionscallbindajaxArray.prototype.findLastIndextermelbenumerablesuperagentpopmotiontrimStartavavarsespreenameStyleSheetcompilerbabelconcatpackageiekoreanomitMaptransportiteratorenvironmentchildidentifiershasOwnxtermrsssameValueZeroconsolebabel-coredeepcloneexpressionTypeScriptfast-clonesafezx6to5jsdiffgetESpluginmobilespeedsearchtostringtagbrowser
3.5.104

10 months ago

3.5.103

10 months ago

3.5.102

11 months ago

3.5.101

11 months ago

3.5.100

11 months ago

3.5.99

11 months ago

3.5.98

11 months ago

3.5.97

11 months ago

3.5.96

11 months ago

3.5.95

11 months ago

3.5.94

11 months ago

3.5.93

11 months ago

3.5.92

11 months ago

2.5.92

11 months ago

2.5.91

11 months ago

2.5.90

11 months ago

2.5.89

11 months ago

2.5.88

11 months ago

2.5.87

11 months ago

2.5.86

11 months ago

2.5.85

11 months ago

2.5.84

11 months ago

2.5.83

11 months ago

2.5.82

11 months ago

2.4.82

11 months ago

2.3.82

11 months ago

2.2.82

11 months ago

2.2.81

11 months ago

2.2.80

11 months ago

2.2.79

11 months ago

2.2.78

11 months ago

2.2.77

11 months ago

2.2.76

12 months ago

2.2.75

12 months ago

2.2.74

12 months ago

2.2.73

12 months ago

2.2.72

12 months ago

2.2.71

12 months ago

2.2.70

12 months ago

2.2.69

12 months ago

2.2.68

12 months ago

2.2.67

12 months ago

2.2.66

12 months ago

2.2.65

12 months ago

2.2.64

12 months ago

2.2.63

12 months ago

2.2.62

12 months ago

2.2.61

12 months ago

2.2.60

12 months ago

2.2.59

12 months ago

2.2.58

12 months ago

2.2.57

12 months ago

2.2.56

1 year ago

2.2.55

1 year ago

2.2.54

1 year ago

2.2.53

1 year ago

2.2.52

1 year ago

2.2.51

1 year ago

2.2.50

1 year ago

2.2.49

1 year ago

2.2.48

1 year ago

2.2.47

1 year ago

2.2.46

1 year ago

2.2.45

1 year ago

2.2.44

1 year ago

2.2.43

1 year ago

2.2.42

1 year ago

2.2.41

1 year ago

2.2.40

1 year ago

2.2.39

1 year ago

2.2.38

1 year ago

2.2.37

1 year ago

2.2.36

1 year ago

2.2.35

1 year ago

2.2.34

1 year ago

2.2.33

1 year ago

2.2.32

1 year ago

2.2.31

1 year ago

2.2.30

1 year ago

2.2.29

1 year ago

2.2.28

1 year ago

2.2.27

1 year ago

2.2.26

1 year ago

2.2.25

1 year ago

2.2.24

1 year ago

2.2.23

1 year ago

2.2.22

1 year ago

2.2.21

1 year ago

2.2.20

1 year ago

2.2.19

1 year ago

2.2.18

1 year ago

2.2.17

1 year ago

2.2.16

1 year ago

2.2.15

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago