obchecked

1.0.1 • Public • Published

Obchecked

A package to help with finding the difference between two values, no matter their type.

Installation

  • NPM:
npm install obchecked
  • Yarn:
yarn add obchecked

Usage

JavaScript usage:

const obchecked = require('obchecked');

const Value1 = 'Lorem ipsum';
const Value2 = 'Lorem ipsum dolor';


// Compare your values and see what is returned.
let differences = obchecked(Value1, Value2);


// In this case, `differences` would be a DiffList containing 7 entries.
// One entry is added due to the difference in string length.
// Six entries are added due to the characters being different between the two strings.

Typescript usage:

// Import Obchecked into your project.
import obchecked from 'obchecked';

const Value1: string = 'Lorem ipsum';
const Value2: string = 'Lorem ipsum dolor';

// Compare your values and see what is returned.
let differences: DiffList = obchecked(Value1, Value2);


// In this case, `differences` would be a DiffList containing 7 entries.
// One entry is added due to the difference in string length.
// Six entries are added due to the characters being different between the two strings.

And that is pretty much all you need to know

Support

Obchecked is supported in both browser and on NodeJS.

Sorry Deno users, however I may not have the time to build a Deno version of this project. Feel free to fork the repository and fork it for yourself.

Type Supported

Obchecked currently supports the following:

  • Primitive Types:
    • Null values
    • Undefined values
    • Strings
    • Numbers and Floats
    • BigInts
    • NaN and Infinity values
    • Booleans
  • Objects (and by extension classes and interfaces)
    • Arrays
    • Maps

According to this list from Mozilla Obchecked has official support for all 7 of the primitive types within JavaScript.

Things we do not currently support:

  • Buffers
  • Functions

Readme

Keywords

none

Package Sidebar

Install

npm i obchecked

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

17.9 kB

Total Files

10

Last publish

Collaborators

  • altrius