casting, parameter rename

Signed-off-by: nuts-n-bits <nuts-n-bits@outlook.com>
This commit is contained in:
nuts-n-bits
2019-12-11 17:33:54 -05:00
committed by Alexander Cerutti
parent 9565bf0944
commit 324bd1ba82

View File

@@ -287,13 +287,14 @@ export class Pass {
beacons(resetFlag: null): this; beacons(resetFlag: null): this;
beacons(...data: schema.Beacon[]): this beacons(...data: schema.Beacon[]): this
beacons(...args: (schema.Beacon|null)[]){ beacons(...data: (schema.Beacon|null)[]){
if (args[0] === null) {
if (data[0] === null) {
delete this[passProps]["beacons"]; delete this[passProps]["beacons"];
return this; return this;
} }
const valid = processRelevancySet("beacons", args); const valid = processRelevancySet("beacons", data as schema.Beacon[]);
if (valid.length) { if (valid.length) {
this[passProps]["beacons"] = valid; this[passProps]["beacons"] = valid;
@@ -310,13 +311,13 @@ export class Pass {
locations(resetFlag : null) : this; locations(resetFlag : null) : this;
locations(...data: schema.Location[]): this; locations(...data: schema.Location[]): this;
locations(...args: (schema.Location|null)[]) : this { locations(...data: (schema.Location|null)[]) : this {
if (args[0] === null) { if (data[0] === null) {
delete this[passProps]["locations"]; delete this[passProps]["locations"];
return this; return this;
} }
const valid = processRelevancySet("locations", args); const valid = processRelevancySet("locations", data as schema.Location[]);
if (valid.length) { if (valid.length) {
this[passProps]["locations"] = valid; this[passProps]["locations"] = valid;