MCPcopy
hub / github.com/stalniy/casl / update

Method update

src/ability.js:45–53  ·  view source on GitHub ↗
(rules)

Source from the content-addressed store, hash-verified

43 }
44
45 update(rules) {
46 if (Array.isArray(rules)) {
47 this.emit('update', { rules, ability: this });
48 this[PRIVATE_FIELD].originalRules = Object.freeze(rules.slice(0));
49 this[PRIVATE_FIELD].rules = this.buildIndexFor(this.rules);
50 }
51
52 return this;
53 }
54
55 buildIndexFor(rules) {
56 const indexedRules = {};

Callers 2

constructorMethod · 0.95
ability.spec.jsFile · 0.80

Calls 2

emitMethod · 0.95
buildIndexForMethod · 0.95

Tested by

no test coverage detected