Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

r17x/common.js

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages