shallowequal

WebJar for shallowequal

License

License

MIT
GroupId

GroupId

org.webjars.bowergithub.dashed
ArtifactId

ArtifactId

shallowequal
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

shallowequal
WebJar for shallowequal
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dashed/shallowequal

Download shallowequal

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.dashed/shallowequal/ -->
<dependency>
    <groupId>org.webjars.bowergithub.dashed</groupId>
    <artifactId>shallowequal</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.dashed/shallowequal/
implementation 'org.webjars.bowergithub.dashed:shallowequal:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.dashed/shallowequal/
implementation ("org.webjars.bowergithub.dashed:shallowequal:1.1.0")
'org.webjars.bowergithub.dashed:shallowequal:jar:1.1.0'
<dependency org="org.webjars.bowergithub.dashed" name="shallowequal" rev="1.1.0">
  <artifact name="shallowequal" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.dashed', module='shallowequal', version='1.1.0')
)
libraryDependencies += "org.webjars.bowergithub.dashed" % "shallowequal" % "1.1.0"
[org.webjars.bowergithub.dashed/shallowequal "1.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

shallowequal Build Status Downloads npm version

shallowequal is like lodash's isEqual (v3.10.1) but for shallow (strict) equal.

shallowequal(value, other, [customizer], [thisArg])

Performs a shallow equality comparison between two values (i.e. value and other) to determine if they are equivalent.

The equality check returns true if value and other are already strictly equal, OR when all the following are true:

  • value and other are both objects with the same keys
  • For each key, the value in value and other are strictly equal (===)

If customizer (expected to be a function) is provided it is invoked to compare values. If customizer returns undefined (i.e. void 0), then comparisons are handled by the shallowequal function instead.

The customizer is bound to thisArg and invoked with three arguments: (value, other, key).

NOTE: Docs are (shamelessly) adapted from lodash's v3.x docs

Install

$ yarn add shallowequal
# npm v5+
$ npm install shallowequal
# before npm v5
$ npm install --save shallowequal

Usage

const shallowequal = require("shallowequal");

const object = { user: "fred" };
const other = { user: "fred" };

object == other;
// → false

shallowequal(object, other);
// → true

Credit

Code for shallowEqual originated from https://github.com/gaearon/react-pure-render/ and has since been refactored to have the exact same API as lodash.isEqualWith (as of v4.17.4).

Development

Chores

  • Lint: yarn lint
  • Test: yarn test
  • Pretty: yarn pretty
  • Prepare: yarn prepare

License

MIT.

Versions

Version
1.1.0