2.3.1 • Published 6 years ago

what-changed v2.3.1

Weekly downloads
9
License
ISC
Repository
github
Last release
6 years ago

what-changed

Provides an overview of how a value changed since the last time you checked.

usage

install:

npm install what-changed

require:

var WhatChanged = require('what-changed');

instantiate:

var state = new WhatChanged([initial value]);

change the value, and get the change overview:

state.update(123);

// -> {type: true, value: true}

The following describes expected output based on how a value changes:

1, 1

{}

1, 2

{
    value: true,
    any: true
}

1, true

{
    value: true,
    type: true,
    any: true
}

1, '1'

{
    type: true,
    any: true
}

{a:1}, {a:1} (same instance)

{}

{a:1}, {a:1} (different instance)

{
    reference: true
}

{a:1}, {b:1} (same instance)

{
    keys: true,
    structure: true,
    any: true
}

{a:{b:1}}, {a:{b:2}} (same instance)

{
    structure: true,
    any: true
}

{a:1}, {b:1} (different instance)

{
    reference: true,
    keys: true,
    structure: true,
    any: true
}
2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

8 years ago

2.1.5

8 years ago

2.1.4

9 years ago

2.1.3

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.0.1

10 years ago

1.0.0

10 years ago