main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
474 bytes
|
Line | |
---|
1 | import JsonNode from "./JsonNode.mjs";
|
---|
2 | import { isArray, isFalse, isKey, isNull, isNumber, isObject, isString, isTrue } from "./predicates.mjs";
|
---|
3 | class JsonProperty extends JsonNode {
|
---|
4 | static type = 'property';
|
---|
5 | get key() {
|
---|
6 | return this.children.find(isKey);
|
---|
7 | }
|
---|
8 | get value() {
|
---|
9 | return this.children.find(node => isFalse(node) || isTrue(node) || isNull(node) || isNumber(node) || isString(node) || isArray(node) || isObject(node));
|
---|
10 | }
|
---|
11 | }
|
---|
12 | export default JsonProperty; |
---|
Note:
See
TracBrowser
for help on using the repository browser.