Skip to content

Commit

Permalink
Merge pull request #216 from diffness/main
Browse files Browse the repository at this point in the history
Ignore double underscore properties
  • Loading branch information
aarons22 authored Jul 15, 2022
2 parents 4032c09 + d2cf114 commit 5e01a4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/BondApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export class BondApi {
const req = this.request(HTTPMethod.GET, this.uri.deviceIds());
return req.then(json =>
Object.keys(json).filter(x => {
// Ignore anything that is an empty string or '_'
return x.length > 0 && x !== '_';
// Ignore anything that is an empty string or all underscores
return x.length > 0 && !/^_+$/.test(x);
}),
);
}
Expand Down Expand Up @@ -278,8 +278,8 @@ export class BondApi {
const req = this.request(HTTPMethod.GET, this.uri.commands(id));
return req.then(json =>
Object.keys(json).filter(x => {
// Ignore anything that is an empty string or '_'
return x.length > 0 && x !== '_';
// Ignore anything that is an empty string or all underscores
return x.length > 0 && !/^_+$/.test(x);
}),
);
}
Expand Down

0 comments on commit 5e01a4b

Please sign in to comment.