5.10.100 • Published 11 months ago

@hishprorg/hic-repellendus-hic v5.10.100

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

@hishprorg/hic-repellendus-hic

Safely flatten a nested JavaScript object.

NPM

Commitizen friendly js-standard-style Build Coverage Known Vulnerabilities

Installation

$ npm i @hishprorg/hic-repellendus-hic

Methods

flatten(obj, delimiter)

Flattens an object to one level deep. Optionally takes a custom delimiter, otherwise uses . by default. Circular references within the object will be replaced with [Circular].

const { flatten } = require('@hishprorg/hic-repellendus-hic')

const original = {
    a: {
        b: {
            c: [{
                val: 'one'
            }, {
                val: 'two'
            }],
            d: 'three'
        },
        e: 'four',
    }
}
original.a.b.f = original.a.b
original.a.b.c.push(original.a)

const flat = flatten(original)
/*
{
  'a.b.c.0.val': 'one',
  'a.b.c.1.val': 'two',
  'a.b.c.2': '[Circular]',
  'a.b.d': 'three',
  'a.e': 'four',
  'a.b.f': '[Circular]'
}
*/

const underscoreFlat = flatten(original, '_')
/*
{
  'a_b_c_0_val': 'one',
  'a_b_c_1_val': 'two',
  'a_b_c_2': '[Circular]',
  'a_b_d': 'three',
  'a_e': 'four',
  'a_b_f': '[Circular]'
}
*/

unflatten(obj, delimiter)

Unflattens an object back to its original nested form. Optionally takes a custom delimiter, otherwise uses . by default. Circular references denoted by [Circular] are treated as Strings.

const { unflatten } = require('@hishprorg/hic-repellendus-hic')

const original = {
    'a.b.c.0.val': 'one',
    'a.b.c.1.val': 'two',
    'a.b.c.2': '[Circular]',
    'a.b.d': 'three',
    'a.e': 'four',
    'a.b.f': '[Circular]'
}


const unflat = unflatten(original)

/*{
  a:{
    b:{
      c:[
        {
          val:'one'
        },
        {
          val:'two'
        },
        '[Circular]'
      ],
      d:'three',
      f:'[Circular]'
    },
    e:'four'
  }
}*/
package managerpasswordvisualFunction.prototype.nameObject.entriesscheme-validationyupcollectionsetPrototypeOfunicodedataViewRFC-6455awaitbindschemacss-in-jsform-validationreact-testing-librarybatchrgbdebuggertyped arrayexpressionIteratortypeerrorless compilerprettybluebirdpnpm9Array.prototype.containsschemeincludesnopecryptothrottlepersistentworkerslicestoragegatewaygetSymbol.toStringTagcss variablespinnerSymbolmapuuidbrowserfilelintlimitparse[[Prototype]]reduceRegExp#flagsplugintypedarraysexecerroreast-asian-widthindicatormimeclassnameless cssstringifier256copyperformancelogspeedwhatwgconnecthotpostcss-pluginjQueryReflect.getPrototypeOfdeleteconsole0modulesgradients csselbhasformattingclientObject.isUint16ArrayiteratorfunctionaltoSortedstartercommandeventDispatchersortstablepostcsschromei18ncreateentriescolumnlimitedviewObject.valuesreact-hook-formcharacterstypesstylingendpointTypeScriptECMAScript 2016outputlibphonenumberpush.enva11ytrimRighttsoptimizerStreamsmapreducecompile lessfunctionwaitimporttraverseloadbalancingconfigurablereduxweaksetcolorsmonorepocommanderWeakMapbeanstalktoStringTagtoolkitguides6StreamArray.prototype.findLastIndexoffsetclidomoptionenvironmentES2017promiseredirecthelpershookformcorsttysyntaxerrorUint8ArrayextendECMAScript 3flatteninstallArrayBuffer#slicees-shimssomeTypedArraysharedwritableArray.prototype.flattenmkdirsregular expressionsproperties$.extendECMAScript 2019lengthes5parentfast-clonecacheWeakSetes-shim APIbcryptfast-deep-cloneStyleSheet-0elasticache_.extendJSONelmbddgradients css3datastructurextermformreplaydefinecode pointsrequestfindLastartbootstrap cssES2018dependency managerpipeiamarraybufferencryptionwatchFilekoreanRxJSprunejsbootstrap lessproxylivedynamodbdeepcopyebsboundwidthtypeofslotlook-upstatefssharedarraybufferjsonespreeeventscallbindless.jscircularreadablestreamintrinsicmake dirsnsECMAScript 2020gettersetImmediatejapanesebuffersdebugrandom__proto__polyfillincolorshimbufferReactiveExtensionsmetadatatoobjectparentsgetoptES2019String.prototype.matchAllvariablesprotopackagesworkflowmulti-packageonceinternalarrayObject.assignbundlermomenthasOwnPropertyclassespreserve-symlinksrdstypedterminalECMAScript 6regularserializeArrayes7io-tsmatchAllstringCSSStyleDeclarationflagsESnextinspectinternal slotgetintrinsiciterategenericspositivefiltertesterponyfillhasOwncharactermodulelockfiledescriptioncallboundomitES8concurrencynamess3dropclonemoveelectroncoercibleajaxassertionsesES2020folderpropecmascriptfastArrayBufferrateMapeveryvalidationdom-testing-libraryfluxasttesthigher-orderlinkquerysafefind-upidlecloudfrontflagdayjsarktypecurljsonpathnumbermochaformatrecursivekeyscollection.es6ajvreusedeepcloneargveslint-pluginmergevaluesECMAScript 2021shamdataviewpicomatchwatchingdatemime-dbstructuredClonesymlinkextensionstringifyextraawsdeep-cloneObject.keysvaliduninstallECMAScript 7toArrayhashjsdiffauthchinesecss nestingcallbacklanguage
@hishprorg/ipsa-consectetur-minima@hishprorg/nemo-blanditiis@hishprorg/neque-laborum-vel@hishprorg/quis-quibusdam@hishprorg/quibusdam-dolores@hishprorg/quis-doloribus@hishprorg/quidem-delectus@hishprorg/quidem-et@hishprorg/quis-est@hishprorg/sed-nihil-iusto@hishprorg/sequi-inventore-labore@hishprorg/sed-sunt@hishprorg/temporibus-aliquam-neque@hishprorg/tempore-dolor-ut@hishprorg/accusantium-architecto@hishprorg/ad-labore-dolor@hishprorg/ad-minima@hishprorg/ad-soluta-et@hishprorg/accusantium-consectetur-incidunt@hishprorg/beatae-cumque@hishprorg/beatae-animi-commodi@hishprorg/autem-quo@hishprorg/debitis-quaerat@hishprorg/debitis-qui@hishprorg/cupiditate-ut@hishprorg/dolores-ut@hishprorg/et-esse-quasi@hishprorg/est-odio-laudantium@hishprorg/eum-eos@hishprorg/et-dicta-cum@hishprorg/eum-nihil-maiores@hishprorg/illo-voluptas@hishprorg/impedit-consectetur-dicta@hishprorg/architecto-sequi@hishprorg/architecto-sapiente@hishprorg/asperiores-hic@hishprorg/aspernatur-consequatur@hishprorg/asperiores-voluptates@hishprorg/asperiores-provident@hishprorg/consectetur-sunt@hishprorg/consectetur-ab@hishprorg/consectetur-dolores@hishprorg/deserunt-est@hishprorg/deserunt-velit-quod@hishprorg/deserunt-nihil@hishprorg/deserunt-deleniti@hishprorg/doloremque-soluta@hishprorg/doloremque-mollitia@hishprorg/dolore-suscipit@hishprorg/hic-omnis@hishprorg/hic-perferendis@hishprorg/fuga-repellat@hishprorg/fugiat-accusamus-laboriosam@hishprorg/fugiat-eius@hishprorg/fugiat-libero-itaque@hishprorg/aliquam-quibusdam-repudiandae@hishprorg/aliquid-delectus-nisi@hishprorg/aliquid-ut-debitis@hishprorg/alias-maiores-saepe@hishprorg/amet-qui@hishprorg/beatae-officia@hishprorg/earum-occaecati@hishprorg/earum-inventore@hishprorg/earum-consectetur@hishprorg/esse-voluptates-veritatis@hishprorg/id-ab@hishprorg/id-harum@hishprorg/id-modi@hishprorg/id-dignissimos@hishprorg/id-voluptas@hishprorg/id-consequuntur@hishprorg/illo-dolores@hishprorg/cumque-optio@hishprorg/cupiditate-quaerat-qui@hishprorg/doloribus-vero@hishprorg/dolorum-commodi-architecto@hishprorg/doloribus-reiciendis@hishprorg/doloribus-minima@hishprorg/dolorum-est@hishprorg/exercitationem-ipsum@hishprorg/distinctio-repudiandae-molestias@hishprorg/distinctio-alias@hishprorg/dignissimos-sunt-quaerat@hishprorg/distinctio-in@hishprorg/eos-enim-voluptate@hishprorg/eos-asperiores@hishprorg/eligendi-laborum@hishprorg/enim-fugiat-quas@hishprorg/eligendi-neque@hishprorg/eveniet-maxime@hishprorg/ex-tempora-libero@hishprorg/architecto-consectetur@hishprorg/culpa-ea-facilis@hishprorg/culpa-ratione-dolores@hishprorg/corrupti-voluptas@hishprorg/corrupti-vero@hishprorg/culpa-iusto-corrupti@hishprorg/dignissimos-enim-adipisci@hishprorg/dignissimos-recusandae-exercitationem@hishprorg/eos-illo
5.9.89

11 months ago

2.5.49

1 year ago

3.6.62

12 months ago

3.6.61

1 year ago

3.6.60

1 year ago

4.7.81

11 months ago

4.7.82

11 months ago

4.7.80

11 months ago

2.3.39

1 year ago

2.1.16

1 year ago

2.3.38

1 year ago

2.1.17

1 year ago

2.3.37

1 year ago

2.5.50

1 year ago

2.5.51

1 year ago

2.1.18

1 year ago

2.1.19

1 year ago

2.1.25

1 year ago

2.1.26

1 year ago

2.3.46

1 year ago

2.1.23

1 year ago

2.3.45

1 year ago

2.1.24

1 year ago

2.1.21

1 year ago

2.1.22

1 year ago

5.10.98

11 months ago

2.3.42

1 year ago

5.10.97

11 months ago

2.3.41

1 year ago

2.1.20

1 year ago

2.3.44

1 year ago

5.10.99

11 months ago

2.3.43

1 year ago

5.10.96

11 months ago

2.3.40

1 year ago

5.10.95

11 months ago

5.8.85

11 months ago

5.8.86

11 months ago

5.8.87

11 months ago

5.8.88

11 months ago

5.8.89

11 months ago

3.5.58

1 year ago

3.5.57

1 year ago

3.7.79

12 months ago

3.5.56

1 year ago

3.5.55

1 year ago

3.7.77

12 months ago

3.5.54

1 year ago

3.7.78

12 months ago

3.5.53

1 year ago

3.7.75

12 months ago

3.5.52

1 year ago

3.7.76

12 months ago

3.5.51

1 year ago

3.5.59

1 year ago

3.7.73

12 months ago

3.7.74

12 months ago

3.7.71

12 months ago

3.7.72

12 months ago

3.7.70

12 months ago

2.2.28

1 year ago

2.2.29

1 year ago

2.2.26

1 year ago

2.2.27

1 year ago

2.4.47

1 year ago

2.4.46

1 year ago

2.4.49

1 year ago

2.4.48

1 year ago

3.5.60

1 year ago

5.7.85

11 months ago

5.7.84

11 months ago

5.7.83

11 months ago

5.7.82

11 months ago

5.10.100

11 months ago

2.0.15

1 year ago

4.7.79

12 months ago

2.0.16

1 year ago

2.2.37

1 year ago

2.2.35

1 year ago

2.2.36

1 year ago

2.2.33

1 year ago

2.2.34

1 year ago

2.2.31

1 year ago

2.2.32

1 year ago

2.2.30

1 year ago

3.7.68

12 months ago

3.7.69

12 months ago

5.9.93

11 months ago

3.7.66

12 months ago

5.9.94

11 months ago

3.7.67

12 months ago

5.9.95

11 months ago

3.7.64

12 months ago

3.7.65

12 months ago

5.9.90

11 months ago

5.9.91

11 months ago

5.9.92

11 months ago

3.7.62

12 months ago

3.7.63

12 months ago

2.0.14

1 year ago

2.0.13

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

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