value-equal

WebJar for value-equal

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

value-equal
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

value-equal
WebJar for value-equal
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mjackson/value-equal

Download value-equal

How to add to project

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

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.

value-equal Travis npm package

value-equal determines if two JavaScript values are equal using Object.prototype.valueOf.

In many instances when I'm checking for object equality, what I really want to know is if their values are equal. This is good for:

  • Stuff you keep in localStorage
  • window.history.state values
  • Query strings

Installation

Using npm:

$ npm install --save value-equal

Then with a module bundler like webpack, use as you would anything else:

// using ES6 modules
import valueEqual from 'value-equal';

// using CommonJS modules
var valueEqual = require('value-equal');

The UMD build is also available on unpkg:

<script src="https://unpkg.com/value-equal"></script>

You can find the library on window.valueEqual.

Usage

valueEqual(1, 1); // true
valueEqual('asdf', 'asdf'); // true
valueEqual('asdf', new String('asdf')); // true
valueEqual(true, true); // true
valueEqual(true, false); // false
valueEqual({ a: 'a' }, { a: 'a' }); // true
valueEqual({ a: 'a' }, { a: 'b' }); // false
valueEqual([1, 2, 3], [1, 2, 3]); // true
valueEqual([1, 2, 3], [2, 3, 4]); // false

That's it. Enjoy!

Versions

Version
1.0.1
0.4.1-beta.6
0.4.0
0.2.0
0.1.1