Comparing version 1.0.37 to 1.0.38
{ | ||
"name": "manyfest", | ||
"version": "1.0.37", | ||
"version": "1.0.38", | ||
"description": "JSON Object Manifest for Data Description and Parsing", | ||
@@ -5,0 +5,0 @@ "main": "source/Manyfest.js", |
@@ -50,5 +50,15 @@ /** | ||
// Make sure pObject (the object we are meant to be recursing) is an object (which could be an array or object) | ||
if (typeof(pObject) != 'object') return undefined; | ||
if (typeof(pObject) != 'object') | ||
{ | ||
return undefined; | ||
} | ||
if (pObject === null) | ||
{ | ||
return undefined; | ||
} | ||
// Make sure pAddress (the address we are resolving) is a string | ||
if (typeof(pAddress) != 'string') return undefined; | ||
if (typeof(pAddress) != 'string') | ||
{ | ||
return undefined; | ||
} | ||
// Stash the parent address for later resolution | ||
@@ -339,3 +349,3 @@ let tmpParentAddress = ""; | ||
{ | ||
return undefined; | ||
return null; | ||
} | ||
@@ -342,0 +352,0 @@ } |
@@ -47,2 +47,21 @@ /** | ||
( | ||
'Javascript null values should not cause errors..', | ||
(fTestComplete)=> | ||
{ | ||
let _Manyfest = new libManyfest({ Scope:'Archive.org', Descriptors: {'metadata.creator': {Name:'Creator', Hash:'Creator'}}}); | ||
let tmpNullSampleData = JSON.parse(JSON.stringify(_SampleDataArchiveOrgFrankenberry)); | ||
tmpNullSampleData.Noel = null; | ||
let tmpNullValue = _Manyfest.getValueAtAddress(tmpNullSampleData, 'Noel'); | ||
let tmpNullValueOneDeep = _Manyfest.getValueAtAddress(tmpNullSampleData, 'Noel.SomeChildValue'); | ||
let tmpNullValueTwoDeep = _Manyfest.getValueAtAddress(tmpNullSampleData, 'Noel.SomeChildValue.SecondTier'); | ||
let tmpNullValueTwoDeepObject = _Manyfest.getValueAtAddress(tmpNullSampleData, 'Noel.SomeChildValue[SecondTier]'); | ||
let tmpNullValueTwoDeepArray = _Manyfest.getValueAtAddress(tmpNullSampleData, 'Noel.SomeChildValue.SecondTier[0]'); | ||
Expect(tmpNullValue).to.equal(null); | ||
Expect(tmpNullValueOneDeep).to.equal(undefined); | ||
Expect(tmpNullValueTwoDeep).to.equal(undefined); | ||
fTestComplete(); | ||
} | ||
); | ||
test | ||
( | ||
'It should be trivial to access subproperties with a schema by hash.', | ||
@@ -49,0 +68,0 @@ (fTestComplete)=> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1224774
11496