0.0.2 • Published 5 years ago

@ri7nz/common v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Documentation

Table of Contents

is

Type data checking on the fly.

Parameters

  • Any

Examples

const myObject = {x:1, y:3}
const thisIs = is(myObject)
// expect(thisIs).toBe("Object")

Returns Boolean

isEqual

isEqual is like is but have 2 parameter for compare 2 type and return Bolean.

Parameters

  • Anything Any
  • Anymore Any

Returns Boolean

has

checking the property in your object.

Parameters

Examples

const Person = {name: 'John Lennon', band: 'Beatles', genre: "rock n roll"}

has(Person,'name')

Returns Boolean

equal

Compare 2 Object

Parameters

Returns Bool This function for simple json object compare you can't compare specific JSON like NODE Or Dom Object in JSON-Data.

unique

Get Unique value in array.

Parameters

Returns Array new array

getByProp

Get value of object by property name.

Parameters

  • obj Object to find value in this object
  • prop String property name in obj

Returns Any value in object by property name

0.0.2

5 years ago

0.0.1

5 years ago