mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
casting, parameter rename
Signed-off-by: nuts-n-bits <nuts-n-bits@outlook.com>
This commit is contained in:
committed by
Alexander Cerutti
parent
9565bf0944
commit
324bd1ba82
13
src/pass.ts
13
src/pass.ts
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user