Skip to content

Commit

Permalink
Changed code that the new unit-test, and all other 3d unit-tests, pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentmarchetti committed Aug 19, 2024
1 parent 131acd0 commit 7c29217
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export class Camera extends AnnotationBody {
**/
getLookAt() : object | PointSelector | null {
let rawObj = this.getPropertyAsObject("lookAt" )
if ( ! rawObj) return null;

let rawType = (rawObj["type"] || rawObj["@type"])
if (rawType == "Annotation"){
return rawObj;
Expand Down
7 changes: 3 additions & 4 deletions src/JSONLDResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ export class JSONLDResource {
{
let prop = this.getProperty(name);

if ( prop === null)
return prop;
else if ( typeof(prop) === 'string')

if ( typeof(prop) === 'string')
return { "id" : prop ,
"isIRI" : true
};
else if ( prop === Object(prop))
return prop;
else{
throw new Error("cannot resolve prop as object: " + prop );
return null;
}
}
}

0 comments on commit 7c29217

Please sign in to comment.