@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 CHANGED
@@ -53,7 +53,6 @@ Pretty much every keyword defined on the [scryfall search syntax](https://scryfa
53
53
  ## unimplemented keywords
54
54
 
55
55
  **TAGGING**
56
- - otag/oracletag/function
57
56
  - art/atag/arttag
58
57
 
59
58
  **PRICING**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigil-sifter/magic",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "mator",
@@ -114,6 +114,10 @@ export default class MagicCard {
114
114
  throw new NotImplementedError();
115
115
  }
116
116
 
117
+ get tags() {
118
+ throw new NotImplementedError();
119
+ }
120
+
117
121
  get typeLines() {
118
122
  throw new NotImplementedError();
119
123
  }
@@ -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
+ }
@@ -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
  }