@sigil-sifter/magic 1.0.0 → 1.0.2

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.
Files changed (97) hide show
  1. package/LICENSE +7 -7
  2. package/README.md +96 -95
  3. package/package.json +1 -1
  4. package/src/core/MagicCard.js +250 -250
  5. package/src/core/helpers.js +6 -6
  6. package/src/core/index.js +3 -3
  7. package/src/data/abilityWords.js +66 -66
  8. package/src/data/colors.js +15 -15
  9. package/src/data/gameFormats.js +25 -25
  10. package/src/data/games.js +5 -5
  11. package/src/data/guilds.js +33 -33
  12. package/src/data/languages.js +30 -30
  13. package/src/data/rarities.js +25 -25
  14. package/src/expressions/ArrayLengthExpression.js +15 -15
  15. package/src/expressions/ColorExpression.js +40 -40
  16. package/src/expressions/DevotionExpression.js +56 -56
  17. package/src/expressions/EvenOddExpression.js +43 -43
  18. package/src/expressions/ExactStringExpression.js +11 -11
  19. package/src/expressions/FormatExpression.js +19 -19
  20. package/src/expressions/GameExpression.js +19 -19
  21. package/src/expressions/KeywordAbilityExpression.js +33 -33
  22. package/src/expressions/LanguageExpression.js +34 -34
  23. package/src/expressions/ManaExpression.js +36 -36
  24. package/src/expressions/PowTouExpression.js +41 -41
  25. package/src/expressions/ProducesExpression.js +35 -35
  26. package/src/expressions/RarityExpression.js +30 -30
  27. package/src/expressions/has/IndicatorExpression.js +11 -11
  28. package/src/expressions/has/WatermarkExpression.js +11 -11
  29. package/src/expressions/is/BoosterExpression.js +11 -11
  30. package/src/expressions/is/DFCExpression.js +11 -11
  31. package/src/expressions/is/EtchedExpression.js +11 -11
  32. package/src/expressions/is/FlipExpression.js +11 -11
  33. package/src/expressions/is/FoilExpression.js +11 -11
  34. package/src/expressions/is/FrenchVanillaExpression.js +11 -11
  35. package/src/expressions/is/FullArtExpression.js +11 -11
  36. package/src/expressions/is/GlossyExpression.js +11 -11
  37. package/src/expressions/is/HistoricExpression.js +11 -11
  38. package/src/expressions/is/HybridExpression.js +11 -11
  39. package/src/expressions/is/LevelerExpression.js +11 -11
  40. package/src/expressions/is/MDFCExpression.js +11 -11
  41. package/src/expressions/is/MeldExpression.js +11 -11
  42. package/src/expressions/is/ModalExpression.js +11 -11
  43. package/src/expressions/is/NonFoilExpression.js +11 -11
  44. package/src/expressions/is/PartyExpression.js +11 -11
  45. package/src/expressions/is/PermanentExpression.js +11 -11
  46. package/src/expressions/is/PhyrexianExpression.js +11 -11
  47. package/src/expressions/is/PromoExpression.js +11 -11
  48. package/src/expressions/is/ReprintExpression.js +11 -11
  49. package/src/expressions/is/ReservedExpression.js +11 -11
  50. package/src/expressions/is/SpellExpression.js +11 -11
  51. package/src/expressions/is/SplitExpression.js +11 -11
  52. package/src/expressions/is/SpotlightExpression.js +11 -11
  53. package/src/expressions/is/TextlessExpression.js +11 -11
  54. package/src/expressions/is/TransformExpression.js +11 -11
  55. package/src/expressions/is/UniversesBeyondExpression.js +11 -11
  56. package/src/expressions/is/VanillaExpression.js +11 -11
  57. package/src/expressions/is/index.js +59 -59
  58. package/src/extensions/ColorExtension.js +22 -22
  59. package/src/extensions/FormatExtension.js +15 -15
  60. package/src/extensions/GameExtension.js +15 -15
  61. package/src/extensions/KeywordExtension.js +11 -11
  62. package/src/extensions/LanguageExtension.js +15 -15
  63. package/src/extensions/RarityExtension.js +20 -20
  64. package/src/extensions/SetExtension.js +13 -13
  65. package/src/index.js +30 -36
  66. package/src/keywords/AbilityKeyword.js +16 -16
  67. package/src/keywords/ArtistKeyword.js +11 -11
  68. package/src/keywords/BannedKeyword.js +21 -21
  69. package/src/keywords/BorderKeyword.js +21 -21
  70. package/src/keywords/CardTypeKeyword.js +11 -11
  71. package/src/keywords/CollectorNumberKeyword.js +16 -16
  72. package/src/keywords/ColorIdentityKeyword.js +11 -11
  73. package/src/keywords/ColorKeyword.js +17 -17
  74. package/src/keywords/DevotionKeyword.js +21 -21
  75. package/src/keywords/FlavorTextKeyword.js +11 -11
  76. package/src/keywords/FormatKeyword.js +21 -21
  77. package/src/keywords/FrameKeyword.js +22 -22
  78. package/src/keywords/GameKeyword.js +21 -21
  79. package/src/keywords/HasKeyword.js +13 -13
  80. package/src/keywords/IsKeyword.js +17 -17
  81. package/src/keywords/LanguageKeyword.js +16 -16
  82. package/src/keywords/LoyaltyKeyword.js +16 -16
  83. package/src/keywords/ManaCostKeyword.js +20 -20
  84. package/src/keywords/ManaValueKeyword.js +17 -17
  85. package/src/keywords/NameKeyword.js +11 -11
  86. package/src/keywords/NotKeyword.js +21 -21
  87. package/src/keywords/PowerKeyword.js +29 -29
  88. package/src/keywords/ProducesKeyword.js +16 -16
  89. package/src/keywords/RarityKeyword.js +16 -16
  90. package/src/keywords/RestrictedKeyword.js +21 -21
  91. package/src/keywords/RulesTextKeyword.js +11 -11
  92. package/src/keywords/SetKeyword.js +21 -21
  93. package/src/keywords/SetTypeKeyword.js +21 -21
  94. package/src/keywords/StampKeyword.js +21 -21
  95. package/src/keywords/ToughnessKeyword.js +29 -29
  96. package/src/keywords/WatermarkKeyword.js +16 -16
  97. package/src/keywords/index.js +65 -65
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Copyright 2025 Colin A
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright 2025 Colin A
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,95 +1,96 @@
1
- # @sigil-sifter/magic
2
-
3
- This is a module which provides the keywords, expressions, and data extensions to filter Magic: The Gathering cards with sigil-sifter.
4
-
5
- ## installation
6
- ```bash
7
- npm i @sigil-sifter/magic
8
- ```
9
-
10
- ## usage
11
- ```js
12
- import Sifter from 'sigil-sifter';
13
- import Magic from '@sigil-sifter/magic';
14
- import { MagicCard } from '@sigil-sifter/magic/core';
15
-
16
- class CardClass extends MagicCard {
17
- // implement your custom card data wrapper here
18
- // see the base MagicCard class for all methods
19
- get names() {
20
- return [this.card.name];
21
- }
22
- }
23
-
24
- // you can pass the library data to override default
25
- // behavior or enable certain keywords
26
- const GameData = {
27
- colors: null,
28
- guilds: null,
29
- gameFormats: null,
30
- abilityWords: null,
31
- languages: null,
32
- rarities: null,
33
- sets: null
34
- };
35
-
36
- Magic(sifter, CardClass, GameData);
37
-
38
- // invoke sifter to filter an array of cards
39
- const cards = [{
40
- name: 'Black Lotus'
41
- }, {
42
- name: 'Mox Emerald'
43
- }, {
44
- name: 'Mox Sapphire'
45
- }]
46
- sifter.filter(cards, 'black lotus');
47
- ```
48
-
49
- ## implemented keywords
50
- Pretty much every keyword defined on the [scryfall search syntax](https://scryfall.com/docs/syntax) page is implemented by this module. You can use the `@sigil-sifter/magic-scryfall` package with this module to search downloaded scryfall card data directly.
51
-
52
- ## unimplemented keywords
53
-
54
- **TAGGING**
55
- - otag/oracletag/function
56
- - art/atag/arttag
57
-
58
- **PRICING**
59
- - usd
60
- - eur
61
- - tix
62
-
63
- **SET**
64
- - block
65
- - year
66
- - date
67
-
68
- **PRINTINGS**
69
- - in
70
- - sets
71
- - cheapest
72
- - prints
73
-
74
- **OTHERS**
75
- - fulloracle, ~ support in oracle text
76
- - artists
77
- - illustrations
78
- - is:hires
79
- - new
80
- - is:reserved
81
- - is:duelcommander
82
- - is:commander
83
- - is:brawler
84
- - is:companion
85
- - cube
86
- - is:\[product]
87
- - include:extras
88
- - is:funny
89
- - is:bear
90
- - is:\[landgroup]
91
- - is:masterpiece
92
- - order
93
- - prefer
94
- - direction
95
- - unique
1
+ # @sigil-sifter/magic
2
+
3
+ This is a module which provides the keywords, expressions, and data extensions to filter Magic: The Gathering cards with sigil-sifter.
4
+
5
+ ## installation
6
+ ```bash
7
+ npm i @sigil-sifter/magic
8
+ ```
9
+
10
+ ## usage
11
+ ```js
12
+ import Sifter from 'sigil-sifter';
13
+ import Magic from '@sigil-sifter/magic';
14
+ import { MagicCard } from '@sigil-sifter/magic/core';
15
+
16
+ class CardClass extends MagicCard {
17
+ // implement your custom card data wrapper here
18
+ // see the base MagicCard class for all methods
19
+ get names() {
20
+ return [this.card.name];
21
+ }
22
+ }
23
+
24
+ // you can pass the library data to override default
25
+ // behavior or enable certain keywords
26
+ const GameData = {
27
+ colors: null,
28
+ guilds: null,
29
+ gameFormats: null,
30
+ abilityWords: null,
31
+ languages: null,
32
+ rarities: null,
33
+ sets: null
34
+ };
35
+
36
+ const sifter = new Sifter();
37
+ Magic(sifter, CardClass, GameData);
38
+
39
+ // invoke sifter to filter an array of cards
40
+ const cards = [{
41
+ name: 'Black Lotus'
42
+ }, {
43
+ name: 'Mox Emerald'
44
+ }, {
45
+ name: 'Mox Sapphire'
46
+ }]
47
+ sifter.filter(cards, 'black lotus');
48
+ ```
49
+
50
+ ## implemented keywords
51
+ Pretty much every keyword defined on the [scryfall search syntax](https://scryfall.com/docs/syntax) page is implemented by this module. You can use the `@sigil-sifter/magic-scryfall` package with this module to search downloaded scryfall card data directly.
52
+
53
+ ## unimplemented keywords
54
+
55
+ **TAGGING**
56
+ - otag/oracletag/function
57
+ - art/atag/arttag
58
+
59
+ **PRICING**
60
+ - usd
61
+ - eur
62
+ - tix
63
+
64
+ **SET**
65
+ - block
66
+ - year
67
+ - date
68
+
69
+ **PRINTINGS**
70
+ - in
71
+ - sets
72
+ - cheapest
73
+ - prints
74
+
75
+ **OTHERS**
76
+ - fulloracle, ~ support in oracle text
77
+ - artists
78
+ - illustrations
79
+ - is:hires
80
+ - new
81
+ - is:reserved
82
+ - is:duelcommander
83
+ - is:commander
84
+ - is:brawler
85
+ - is:companion
86
+ - cube
87
+ - is:\[product]
88
+ - include:extras
89
+ - is:funny
90
+ - is:bear
91
+ - is:\[landgroup]
92
+ - is:masterpiece
93
+ - order
94
+ - prefer
95
+ - direction
96
+ - unique
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigil-sifter/magic",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "mator",