shallow-equals

WebJar for shallow-equals

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

shallow-equals
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

shallow-equals
WebJar for shallow-equals
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/hughsk/shallow-equals

Download shallow-equals

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/shallow-equals/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>shallow-equals</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/shallow-equals/
implementation 'org.webjars.npm:shallow-equals:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/shallow-equals/
implementation ("org.webjars.npm:shallow-equals:1.0.0")
'org.webjars.npm:shallow-equals:jar:1.0.0'
<dependency org="org.webjars.npm" name="shallow-equals" rev="1.0.0">
  <artifact name="shallow-equals" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='shallow-equals', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "shallow-equals" % "1.0.0"
[org.webjars.npm/shallow-equals "1.0.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.

shallow-equals Flattr this!experimental

Determine if an array or object is equivalent with another, not recursively.

Usage

shallow-equals

equals(a, b, [compare])

Check if a and b are pretty much the same thing. Note this won't be the case if a and b are different types (e.g. Array vs. Object, String vs. Function).

By default, all comparisons between values are using the strict equality (===) operator. You can also pass in a custom compare function to override this behavior.

var equals = require('shallow-equals')

// true:
equals([1, 2, 3], [1, 2, 3])

// true:
equals({ hello: 'world' }, { hello: 'world' })

// false:
equals([1, 2, {}], [1, 2, {}])

// true:
equals([1, 2], [
  { value: 1 },
  { value: 2 }
], function(a, b) {
  return a === b.value
})

License

MIT. See LICENSE.md for details.

Versions

Version
1.0.0