@azrico/node
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

deus-object

Some useful object functions

Install

yarn add @azrico/object

Functions

object_clone(object);
object_first(object);
object_update(a, b);
object_delta(a, b);
object_has_delta(object);
object_equals(a, b);
isEmpty(object);

Usage

import React, { Component } from 'react'
import { View } from 'react-native'
import {
	getInArray,
	object_clone,
	object_delta,
	object_equals,
	object_first,
	object_isEmpty,
	origCompare,
	setInArray,
/* ... */
} from "@azrico/object";

class Example extends Component {

  let eq1=object_equals({a:"b"},{a:"b"});//true
  let eq2=object_equals({a:"b"},{a:"c"});//false

  let ie1=object_isEmpty({});  //true
  let ie2=object_isEmpty([]);  //true
  let ie3=object_isEmpty(null);//true
  let ie4=object_isEmpty({test:"a"});//false

  let if1=object_first({a:"a",b:"b",c:"c"});// a:"a"
  let if2=object_first([1,2,3,4]);//1


  render() {
    return <View></View>
  }
}

License

MIT ©

Readme

Keywords

none

Package Sidebar

Install

npm i @azrico/node

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

110 kB

Total Files

24

Last publish

Collaborators

  • azrideus