JSONPath возвращает неопределенное значение, может быть, я делаю это неправильно, но, как я вижу в документации, это должно работать.
let json = {
"name": "test"
"actions": [
{"foo":"moo"}
]
}
let test = jsonPath(schema, "$.name");
console.log(test); // returns undefined
let test = jsonPath(schema, "$.name").toJSONString();
console.log(test); // throws error toJSONString() undefined
let test = jsonPath(schema, "$.name").toString();
console.log(test); // throws error toString() undefined
let test = jsonPath(schema, "$.actions");
console.log(test); // returns undefined
let test = jsonPath(schema, "$.actions.*");
console.log(test); // returns undefined
let test = jsonPath(schema, "$..actions");
console.log(test); // returns undefined
Мне нужна помощь. Я также хочу знать, есть ли возможность вернуть массив ключей объекта?И как?