Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/is-property
Tests if a json property can be safely accessed using the . syntax
https://github.com/mikolalysenko/is-property
Last synced: about 2 months ago
JSON representation
Tests if a json property can be safely accessed using the . syntax
- Host: GitHub
- URL: https://github.com/mikolalysenko/is-property
- Owner: mikolalysenko
- License: mit
- Created: 2013-07-18T14:10:33.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-11T22:04:59.000Z (over 8 years ago)
- Last Synced: 2024-10-19T14:11:55.644Z (2 months ago)
- Language: JavaScript
- Size: 147 KB
- Stars: 13
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
is-property
===========
Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "])Example
-------```javascript
var isProperty = require("is-property")console.log(isProperty("foo")) //Prints true
console.log(isProperty("0")) //Prints false
```Install
-------npm install is-property
### `require("is-property")(str)`
Checks if str is a property* `str` is a string which we will test if it is a property or not
**Returns** true or false depending if str is a property
## Credits
(c) 2013 Mikola Lysenko. MIT License