3.5.104 • Published 12 months ago

@erboladaiorg/earum-sequi v3.5.104

Weekly downloads
-
License
MIT
Repository
github
Last release
12 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

12 months ago

3.5.103

12 months ago

3.5.102

12 months ago

3.5.101

12 months ago

3.5.100

12 months ago

3.5.99

12 months ago

3.5.98

12 months ago

3.5.97

1 year ago

3.5.96

1 year ago

3.5.95

1 year ago

3.5.94

1 year ago

3.5.93

1 year ago

3.5.92

1 year ago

2.5.92

1 year ago

2.5.91

1 year ago

2.5.90

1 year ago

2.5.89

1 year ago

2.5.88

1 year ago

2.5.87

1 year ago

2.5.86

1 year ago

2.5.85

1 year ago

2.5.84

1 year ago

2.5.83

1 year ago

2.5.82

1 year ago

2.4.82

1 year ago

2.3.82

1 year ago

2.2.82

1 year ago

2.2.81

1 year ago

2.2.80

1 year ago

2.2.79

1 year ago

2.2.78

1 year ago

2.2.77

1 year ago

2.2.76

1 year ago

2.2.75

1 year ago

2.2.74

1 year ago

2.2.73

1 year ago

2.2.72

1 year ago

2.2.71

1 year ago

2.2.70

1 year ago

2.2.69

1 year ago

2.2.68

1 year ago

2.2.67

1 year ago

2.2.66

1 year ago

2.2.65

1 year ago

2.2.64

1 year ago

2.2.63

1 year ago

2.2.62

1 year ago

2.2.61

1 year ago

2.2.60

1 year ago

2.2.59

1 year ago

2.2.58

1 year ago

2.2.57

1 year 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