Skip to content

Commit

Permalink
implement requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Weirich <matthias.weirich@selectcode.de>
  • Loading branch information
vavido committed Apr 12, 2021
1 parent efe7e0d commit a255d65
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9,374 deletions.
4 changes: 2 additions & 2 deletions javascript/lib/api/src/model/things.model.ts
Expand Up @@ -63,8 +63,8 @@ export class Thing extends EntityWithId {
}

public toObject(): object {
const featuresObj = this.features ? Features.toObject(this.features) : undefined;
const aclObj = this._acl ? Acl.toObject(this._acl) : undefined;
const featuresObj = Features.toObject(this.features);
const aclObj = Acl.toObject(this._acl);
return EntityModel.buildObject(new Map<string, any>([
['thingId', this.thingId],
['policyId', this.policyId],
Expand Down
2 changes: 1 addition & 1 deletion javascript/lib/api/tests/model/things.model.spec.ts
Expand Up @@ -184,7 +184,7 @@ describe('Thing', () => {
expect(thing.name).toEqual('Testthing');
expect(thing.acl).toEqual(acl);
expect(thing.definition).toEqual('example:test:definition');
expect(thing.created).toEqual('2017-06-01T00:01:57Z');
expect(thing._created).toEqual('2017-06-01T00:01:57Z');
});
it('handles a minimal thing', () => {
const minimalThing = new Thing('Tespspace:Minimal');
Expand Down

0 comments on commit a255d65

Please sign in to comment.