@avonjs/avonjs
Version:
A fluent Node.js API generator.
23 lines (22 loc) • 713 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const collect_js_1 = __importDefault(require("collect.js"));
exports.default = (Parent) => {
class GuardAttributes extends Parent {
/**
* The model's attributes.
*/
guarded = [];
/**
* Get all of the model attributes.
*/
getAttributes() {
const attributes = super.getAttributes();
return (0, collect_js_1.default)(attributes).except(this.guarded).all();
}
}
return GuardAttributes;
};