mirror of
https://github.com/projectdysnomia/dysnomia.git
synced 2026-12-02 13:48:31 +02:00
This commit switches Dysnomia over to ESLint flat config for futureproofing and better maintainability. For the most part, the codebase will pass the test suite, apart from a few exceptions introduced by the stylistic plugin which I believe are reasonable to include. Additionally, JSDoc linting was added to maintain proper alignment of various features.
33 lines
668 B
JavaScript
33 lines
668 B
JavaScript
"use strict";
|
|
|
|
const Permission = require("./Permission");
|
|
|
|
/**
|
|
* Represents a permission overwrite
|
|
* @extends Permission
|
|
*/
|
|
class PermissionOverwrite extends Permission {
|
|
constructor(data) {
|
|
super(data.allow, data.deny);
|
|
/**
|
|
* The ID of the overwrite
|
|
* @type {String}
|
|
*/
|
|
this.id = data.id;
|
|
/**
|
|
* The type of the overwrite, either 1 for "member" or 0 for "role"
|
|
* @type {Number}
|
|
*/
|
|
this.type = data.type;
|
|
}
|
|
|
|
toJSON(props = []) {
|
|
return super.toJSON([
|
|
"type",
|
|
...props
|
|
]);
|
|
}
|
|
}
|
|
|
|
module.exports = PermissionOverwrite;
|