Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sail-sail/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[" ... "])
https://github.com/sail-sail/is_property
Last synced: 1 day ago
JSON representation
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[" ... "])
- Host: GitHub
- URL: https://github.com/sail-sail/is_property
- Owner: sail-sail
- Created: 2022-05-17T08:07:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-17T08:26:04.000Z (over 2 years ago)
- Last Synced: 2024-12-07T00:41:42.715Z (2 months ago)
- Language: TypeScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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[" ... "])
## usage
```ts
import { assert } from "https://deno.land/[email protected]/testing/asserts.ts";
import { isProperty } from "https://deno.land/x/[email protected]/mod.ts";Deno.test("isProperty", function() {
assert(isProperty("foo"))
assert(!isProperty(".foo"))
assert(!isProperty("a.b.c"))
assert(isProperty("_joke"))
assert(isProperty("j_a_b_c"))
assert(isProperty("f00"))
assert(!isProperty("0bad"))
assert(isProperty("break"))
assert(!isProperty("@context"))
});```