3.15.77 • Published 10 months ago

@erboladaiorg/ullam-dolorem-repellat v3.15.77

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

@erboladaiorg/ullam-dolorem-repellat

npm npm code style: prettier CI Status

Ignore keys with undefined value to compare from a deep equal operation with chai expect.

Why?

Sometimes you will have properties which have undefined value. This plugin helps to ignore those properties from comparison.

Works with both objects and array of objects with or without circular references.

Installation

npm install @erboladaiorg/ullam-dolorem-repellat --save-dev
yarn add @erboladaiorg/ullam-dolorem-repellat --dev

Usage

Require

const chai = require("chai");
const chaiIgnoreUndefinedProperties = require("@erboladaiorg/ullam-dolorem-repellat");

chai.use(chaiIgnoreUndefinedProperties);

ES6 Import

import chai from "chai";
import chaiIgnoreUndefinedProperties from "@erboladaiorg/ullam-dolorem-repellat";

chai.use(chaiIgnoreUndefinedProperties);

TypeScript

import * as chai from "chai";
import chaiIgnoreUndefinedProperties from "@erboladaiorg/ullam-dolorem-repellat";

chai.use(chaiIgnoreUndefinedProperties);

// The typings for @erboladaiorg/ullam-dolorem-repellat are included with the package itself.

Examples

All these examples are for JavaScript.

a) excluding

  1. Ignore a top level property from an object
expect({ aa: undefined, bb: "b" }).to.equal({
  bb: "b",
  cc: undefined,
});
  1. Ignore properties within array with undefined values
const expectedArray = [{ aa: undefined, bb: "b" }];
const actualArray = [{ cc: undefined, bb: "b" }];
expect(actualArray).to.deep.equal(expectedArray);
  1. Ignore a nested properties with undefined value (only for deep equal comparison)
expect({
  topLevelProp: { aa: undefined, bb: "b" },
}).to.deep.equal({
  topLevelProp: { bb: "b", cc: undefined },
});
  1. Works with circular dependencies
const actualObject = { aa: undefined, bb: "b" };
actualObject.c = actualObject;

const expectedObject = { bb: "b", cc: undefined };
expectedObject.c = expectedObject;

expect(actualObject).to.deep.equal(expectedObject);

Contributing

Contributions are welcome. If you have any questions create an issue here.

License

MIT

MicrosofttoStringTagoptionshellflatimportexportzodclass-validatorkeyspopmotionargvrgbowncacheES2021reduce256polyfillES2017react animationdiffcallbounddateserializerwaitnativeastautoscalingsomeredux-toolkitnodejscloudwatchresolvevalidatorslicepatchschemeInt32ArrayshrinkwrapECMAScript 2019point-freeenumerabletraversecore-jsArrayBufferutilspringutil.inspectbyteBigUint64ArraycallReflect.getPrototypeOfworkspace:*functionsharmonyeventDispatcherperformantroutinglocaldropinstallercss lesssestimeomitgraphqlprefixstylingbrowserfluxvalidatemovepnpm9requirelastlinuxunicodemergetranspileinputkeyECMAScript 2020erroroperating-systemsafeless.jshot.envfile systemmapArray.prototype.flataccessorSetcloudformationinvariantUnderscoreECMAScript 2017make dirfetchapicommandassertsquerystringpasswordkoreanasciitslibdeterministicautoprefixerES5io-tsmobilelintObject.valuesoffsettesterendpointflattensqscomputed-typesmixinsmetadataeslintconfigpyyamlwritestatelessStyleSheetstructuredCloneacornprettytypedarraycolumnsaccessibilitydataenvironmentspinnersloggingES2018function.lengthjsfixed-widthzxramdarfc9562warningscheme-validationreal-timeUint16Arraycloudsearchstableurlcss variablemacostoSortedpropes2018elmpropertiesnumberspinnergradients csstypesafehookformeslintdirectoryvalidObject.getPrototypeOf3dextendmoduleECMAScripttddFunction.prototype.namebrowserslisttyped arraychromehelpersjsdom.gitignoreIteratorformattingiees-abstractconfigurablerapidreadablesignalpackagesisES2019json-schema-validationreact-componentpostcss-pluginglaciertypeerrornopeArraychromiumglobalsassertionES2016protocol-buffersauthenticationloggerhashasyncgetintrinsicfromfilterSymbol.toStringTaggradients css3Object.definePropertywafdirprunebyteOffsetreducerguidfastcopyregularpostcssstreamsutilitysharedarraybufferfshigher-orderSystem.globalconcatMapclassnametypanionslotstringifierUint8Arrayless compilerTypeBoxbundlerWeakMapReactiveExtensionscollectionpathmulti-packagesigintarrayponyfillreadcloneframersymbolArray.prototype.flatMapexit-codestyleguidecolorsbyteLengthjavascriptdescriptionsettingsgesturesroute53typeequalforEachpromiselengthsymbolsES2020ECMAScript 2022hardlinksttyglobal objectconsoleoptimistbddflagcommand-lineyamlprotobufchildfast-deep-cloneweakmapelectronjson-schemabinariesObject.entriesnpmtoobjectsigtermjoiartoptimizerWebSocketsansirfc4122ECMAScript 2018specRFC-6455serializeobjectTypeScriptsortfast-deep-copypluginRxJSflatMapweaksetregular expressiondeepcloneES6ECMAScript 2016deletegetterjsonnamehandlersfigletcjkarraysidentifiersArrayBuffer#slicestringifya11ycertificatesinjson-schema-validatorcallbacktelephonequotehttpstypescriptconfigES2022sharedfastclonerobusttypeofObservabless3definePropertytrimRightfast-clonecollection.es6styled-componentsprocesstaketrimcss-in-jspackage.jsonexecfilegetOwnPropertyDescriptores2015ES3tacitfull-widthinterruptsInt16ArraytoolkitcolumnArray.prototype.findLastIndexreact-hook-formhookssidecurleventspushasterisksfunctionaleventEmittertranspilertouchgetuploadeffect-tses6to5toolsstarterUint32Arrayinternallruonceprivate
3.15.77

10 months ago

3.15.76

10 months ago

3.15.75

10 months ago

3.15.74

10 months ago

3.15.73

10 months ago

3.15.72

10 months ago

3.15.71

11 months ago

3.15.70

11 months ago

3.15.69

11 months ago

3.15.68

11 months ago

3.15.67

11 months ago

3.15.66

11 months ago

3.15.65

11 months ago

3.14.65

11 months ago

3.14.64

11 months ago

3.14.63

11 months ago

3.14.62

11 months ago

3.14.61

11 months ago

3.14.60

11 months ago

3.14.59

11 months ago

3.14.58

11 months ago

3.14.57

11 months ago

3.13.57

11 months ago

3.12.57

11 months ago

3.12.56

11 months ago

3.12.55

11 months ago

3.12.54

11 months ago

3.11.54

11 months ago

3.11.53

11 months ago

3.11.52

11 months ago

3.11.51

11 months ago

3.11.50

11 months ago

3.11.49

11 months ago

3.11.48

11 months ago

3.11.47

11 months ago

3.11.46

11 months ago

3.11.45

12 months ago

3.11.44

12 months ago

3.11.43

12 months ago

3.11.42

12 months ago

3.11.41

12 months ago

3.11.40

12 months ago

3.10.40

12 months ago

3.10.39

12 months ago

3.9.39

12 months ago

3.9.38

12 months ago

3.9.37

12 months ago

3.9.36

12 months ago

3.9.35

12 months ago

3.9.34

12 months ago

3.9.33

12 months ago

3.9.32

12 months ago

3.9.31

12 months ago

3.8.31

12 months ago

3.7.31

12 months ago

3.6.31

12 months ago

3.6.30

1 year ago

3.5.30

1 year ago

3.4.30

1 year ago

3.4.29

1 year ago

3.3.29

1 year ago

3.3.28

1 year ago

3.3.27

1 year ago

3.3.26

1 year ago

3.3.25

1 year ago

3.2.25

1 year ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

3.2.20

1 year ago

3.2.19

1 year ago

3.2.18

1 year ago

3.2.17

1 year ago

3.2.16

1 year ago

2.2.16

1 year ago

2.2.15

1 year ago

2.2.14

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.1.11

1 year ago

2.1.10

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

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