Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(vk: VK, options: IImplicitFlowOptions & { groups: number[] }) {
super(vk, options);
let { groups = null } = options;
if (groups === null) {
throw new VKError({
message: 'Groups list must have',
code: 'GROUPS_NOT_SET'
});
}
if (!Array.isArray(groups)) {
groups = [groups];
}
this.groups = groups.map((rawGroup) => {
const group = Number(rawGroup);
return group < 0
? -group
: group;
});