Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object-has

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-has

Checks if path is a direct property of object.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
99
decreased by-13.91%
Maintainers
1
Weekly downloads
 
Created
Source

object-has

Checks if path is a direct property of object.

MIT License

build:? coverage:?

Install

$ npm install --save object-has 

Usage

For more use-cases see the tests

var has    = require('object-has');
var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };

has(object, 'a[0].b.c');           // => true
has(object, 'a[1]');               // => true
has(object);                       // => false
has(['a', 'b', 'c'], 2);           // => true
has({ a: 'abcde' }, 'a[1]');       // => false
has({ a: ['abcde'] }, 'a[0][2]');  // => true
  • object-at - Get object's property according to the path.
  • object-set - Sets the value at path of object.
  • object-unset - Removes the property at path of object.
  • to-path - Converts string to a property path array.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Keywords

FAQs

Package last updated on 15 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc