@stamhoofd/structures
Advanced tools
Comparing version 1.2.15 to 1.2.16
import { AutoEncoder } from '@simonbackx/simple-encoding'; | ||
import { Address } from '../Address'; | ||
import { Group } from '../Group'; | ||
import { EmergencyContact } from './EmergencyContact'; | ||
@@ -32,3 +33,5 @@ import { Gender } from './Gender'; | ||
matchQuery(query: string): boolean; | ||
doesMatchGroup(group: Group): boolean; | ||
getMatchingGroups(groups: Group[]): Group[]; | ||
} | ||
//# sourceMappingURL=MemberDetails.d.ts.map |
@@ -7,2 +7,3 @@ "use strict"; | ||
const Address_1 = require("../Address"); | ||
const GroupGenderType_1 = require("../GroupGenderType"); | ||
const EmergencyContact_1 = require("./EmergencyContact"); | ||
@@ -61,2 +62,25 @@ const Gender_1 = require("./Gender"); | ||
} | ||
doesMatchGroup(group) { | ||
const birthYear = this.birthDay.getFullYear(); | ||
if (group.settings.minBirthYear) { | ||
if (birthYear < group.settings.minBirthYear) { | ||
return false; | ||
} | ||
} | ||
if (group.settings.maxBirthYear) { | ||
if (birthYear > group.settings.maxBirthYear) { | ||
return false; | ||
} | ||
} | ||
if (this.gender == Gender_1.Gender.Male && group.settings.genderType == GroupGenderType_1.GroupGenderType.OnlyFemale) { | ||
return false; | ||
} | ||
if (this.gender == Gender_1.Gender.Female && group.settings.genderType == GroupGenderType_1.GroupGenderType.OnlyMale) { | ||
return false; | ||
} | ||
return false; | ||
} | ||
getMatchingGroups(groups) { | ||
return groups.filter(g => this.doesMatchGroup(g)); | ||
} | ||
} | ||
@@ -63,0 +87,0 @@ tslib_1.__decorate([ |
import { AutoEncoder } from '@simonbackx/simple-encoding'; | ||
import { Address } from '../Address'; | ||
import { Group } from '../Group'; | ||
import { EmergencyContact } from './EmergencyContact'; | ||
@@ -32,3 +33,5 @@ import { Gender } from './Gender'; | ||
matchQuery(query: string): boolean; | ||
doesMatchGroup(group: Group): boolean; | ||
getMatchingGroups(groups: Group[]): Group[]; | ||
} | ||
//# sourceMappingURL=MemberDetails.d.ts.map |
import { __decorate } from "tslib"; | ||
import { ArrayDecoder, AutoEncoder, DateDecoder, EnumDecoder, field, StringDecoder } from '@simonbackx/simple-encoding'; | ||
import { Address } from '../Address'; | ||
import { GroupGenderType } from '../GroupGenderType'; | ||
import { EmergencyContact } from './EmergencyContact'; | ||
@@ -57,2 +58,25 @@ import { Gender } from './Gender'; | ||
} | ||
doesMatchGroup(group) { | ||
const birthYear = this.birthDay.getFullYear(); | ||
if (group.settings.minBirthYear) { | ||
if (birthYear < group.settings.minBirthYear) { | ||
return false; | ||
} | ||
} | ||
if (group.settings.maxBirthYear) { | ||
if (birthYear > group.settings.maxBirthYear) { | ||
return false; | ||
} | ||
} | ||
if (this.gender == Gender.Male && group.settings.genderType == GroupGenderType.OnlyFemale) { | ||
return false; | ||
} | ||
if (this.gender == Gender.Female && group.settings.genderType == GroupGenderType.OnlyMale) { | ||
return false; | ||
} | ||
return false; | ||
} | ||
getMatchingGroups(groups) { | ||
return groups.filter(g => this.doesMatchGroup(g)); | ||
} | ||
} | ||
@@ -59,0 +83,0 @@ __decorate([ |
{ | ||
"name": "@stamhoofd/structures", | ||
"version": "1.2.15", | ||
"version": "1.2.16", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./esm/dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261777
3750