Skip to content

Commit bff098c

Browse files
closes #176 (#177)
1 parent 9767489 commit bff098c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

npm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "commonjs",
33
"name": "coded-json",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"description": "CJSON is a data file format(inspired from JSON), but supports logical expressions too. Having extended language support to NodeJS, Python and Java, users has experienced data reusability. For features and examples, please refer to this documentation as base document.",
66
"repository": "https://github.com/SubhenduShekhar/cjson",
77
"homepage": "https://github.com/SubhenduShekhar/cjson#readme",

npm/spec/tests/jsonNativeTests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("JSON Test 2", () => {
5151
});
5252

5353
it("I should be able to get all keys after deserialization", () => {
54-
var cjson = new Cjson(VariableInjection);
54+
var cjson = new Cjson(relativeTargetCjson);
5555
cjson.deserialize();
5656

5757
assert.notEqual(cjson.json.getAllKeys().length, 0, "getAllKeys() test passed");

npm/src/utils/json.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ export class Json extends Base {
7575
* @param prevKey Previous key
7676
*/
7777
private getKeys(jsonData: any, prevKey: string = "") {
78-
if(isContentJson(JSON.stringify(jsonData))) {
78+
if(jsonData === null)
79+
this.pushKey("", prevKey);
80+
81+
else if(isContentJson(JSON.stringify(jsonData))) {
7982
Object.keys(jsonData).forEach(eachKey => {
8083
if(Array.isArray(jsonData[eachKey])) {
8184
var allRaw: boolean = true;

0 commit comments

Comments
 (0)