@sigil-sifter/magic 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/package.json +1 -1
- package/src/core/MagicCard.js +4 -0
- package/src/keywords/TagKeyword.js +11 -0
- package/src/keywords/index.js +2 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/src/core/MagicCard.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StringKeyword } from 'sigil-sifter/keywords';
|
|
2
|
+
|
|
3
|
+
export default class TagKeyword extends StringKeyword {
|
|
4
|
+
static get keys() {
|
|
5
|
+
return ['otag', 'tag', 'oracletag', 'function'];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
test(card) {
|
|
9
|
+
return card.tags.some(tag => super.test(tag));
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/keywords/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import RulesTextKeyword from './RulesTextKeyword.js';
|
|
|
27
27
|
import SetKeyword from './SetKeyword.js';
|
|
28
28
|
import SetTypeKeyword from './SetTypeKeyword.js';
|
|
29
29
|
import StampKeyword from './StampKeyword.js';
|
|
30
|
+
import TagKeyword from './TagKeyword.js';
|
|
30
31
|
import ToughnessKeyword from './ToughnessKeyword.js';
|
|
31
32
|
import WatermarkKeyword from './WatermarkKeyword.js';
|
|
32
33
|
|
|
@@ -60,6 +61,7 @@ export {
|
|
|
60
61
|
SetKeyword,
|
|
61
62
|
SetTypeKeyword,
|
|
62
63
|
StampKeyword,
|
|
64
|
+
TagKeyword,
|
|
63
65
|
ToughnessKeyword,
|
|
64
66
|
WatermarkKeyword,
|
|
65
67
|
}
|