@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.
- package/LICENSE +7 -7
- package/README.md +96 -95
- package/package.json +1 -1
- package/src/core/MagicCard.js +250 -250
- package/src/core/helpers.js +6 -6
- package/src/core/index.js +3 -3
- package/src/data/abilityWords.js +66 -66
- package/src/data/colors.js +15 -15
- package/src/data/gameFormats.js +25 -25
- package/src/data/games.js +5 -5
- package/src/data/guilds.js +33 -33
- package/src/data/languages.js +30 -30
- package/src/data/rarities.js +25 -25
- package/src/expressions/ArrayLengthExpression.js +15 -15
- package/src/expressions/ColorExpression.js +40 -40
- package/src/expressions/DevotionExpression.js +56 -56
- package/src/expressions/EvenOddExpression.js +43 -43
- package/src/expressions/ExactStringExpression.js +11 -11
- package/src/expressions/FormatExpression.js +19 -19
- package/src/expressions/GameExpression.js +19 -19
- package/src/expressions/KeywordAbilityExpression.js +33 -33
- package/src/expressions/LanguageExpression.js +34 -34
- package/src/expressions/ManaExpression.js +36 -36
- package/src/expressions/PowTouExpression.js +41 -41
- package/src/expressions/ProducesExpression.js +35 -35
- package/src/expressions/RarityExpression.js +30 -30
- package/src/expressions/has/IndicatorExpression.js +11 -11
- package/src/expressions/has/WatermarkExpression.js +11 -11
- package/src/expressions/is/BoosterExpression.js +11 -11
- package/src/expressions/is/DFCExpression.js +11 -11
- package/src/expressions/is/EtchedExpression.js +11 -11
- package/src/expressions/is/FlipExpression.js +11 -11
- package/src/expressions/is/FoilExpression.js +11 -11
- package/src/expressions/is/FrenchVanillaExpression.js +11 -11
- package/src/expressions/is/FullArtExpression.js +11 -11
- package/src/expressions/is/GlossyExpression.js +11 -11
- package/src/expressions/is/HistoricExpression.js +11 -11
- package/src/expressions/is/HybridExpression.js +11 -11
- package/src/expressions/is/LevelerExpression.js +11 -11
- package/src/expressions/is/MDFCExpression.js +11 -11
- package/src/expressions/is/MeldExpression.js +11 -11
- package/src/expressions/is/ModalExpression.js +11 -11
- package/src/expressions/is/NonFoilExpression.js +11 -11
- package/src/expressions/is/PartyExpression.js +11 -11
- package/src/expressions/is/PermanentExpression.js +11 -11
- package/src/expressions/is/PhyrexianExpression.js +11 -11
- package/src/expressions/is/PromoExpression.js +11 -11
- package/src/expressions/is/ReprintExpression.js +11 -11
- package/src/expressions/is/ReservedExpression.js +11 -11
- package/src/expressions/is/SpellExpression.js +11 -11
- package/src/expressions/is/SplitExpression.js +11 -11
- package/src/expressions/is/SpotlightExpression.js +11 -11
- package/src/expressions/is/TextlessExpression.js +11 -11
- package/src/expressions/is/TransformExpression.js +11 -11
- package/src/expressions/is/UniversesBeyondExpression.js +11 -11
- package/src/expressions/is/VanillaExpression.js +11 -11
- package/src/expressions/is/index.js +59 -59
- package/src/extensions/ColorExtension.js +22 -22
- package/src/extensions/FormatExtension.js +15 -15
- package/src/extensions/GameExtension.js +15 -15
- package/src/extensions/KeywordExtension.js +11 -11
- package/src/extensions/LanguageExtension.js +15 -15
- package/src/extensions/RarityExtension.js +20 -20
- package/src/extensions/SetExtension.js +13 -13
- package/src/index.js +30 -36
- package/src/keywords/AbilityKeyword.js +16 -16
- package/src/keywords/ArtistKeyword.js +11 -11
- package/src/keywords/BannedKeyword.js +21 -21
- package/src/keywords/BorderKeyword.js +21 -21
- package/src/keywords/CardTypeKeyword.js +11 -11
- package/src/keywords/CollectorNumberKeyword.js +16 -16
- package/src/keywords/ColorIdentityKeyword.js +11 -11
- package/src/keywords/ColorKeyword.js +17 -17
- package/src/keywords/DevotionKeyword.js +21 -21
- package/src/keywords/FlavorTextKeyword.js +11 -11
- package/src/keywords/FormatKeyword.js +21 -21
- package/src/keywords/FrameKeyword.js +22 -22
- package/src/keywords/GameKeyword.js +21 -21
- package/src/keywords/HasKeyword.js +13 -13
- package/src/keywords/IsKeyword.js +17 -17
- package/src/keywords/LanguageKeyword.js +16 -16
- package/src/keywords/LoyaltyKeyword.js +16 -16
- package/src/keywords/ManaCostKeyword.js +20 -20
- package/src/keywords/ManaValueKeyword.js +17 -17
- package/src/keywords/NameKeyword.js +11 -11
- package/src/keywords/NotKeyword.js +21 -21
- package/src/keywords/PowerKeyword.js +29 -29
- package/src/keywords/ProducesKeyword.js +16 -16
- package/src/keywords/RarityKeyword.js +16 -16
- package/src/keywords/RestrictedKeyword.js +21 -21
- package/src/keywords/RulesTextKeyword.js +11 -11
- package/src/keywords/SetKeyword.js +21 -21
- package/src/keywords/SetTypeKeyword.js +21 -21
- package/src/keywords/StampKeyword.js +21 -21
- package/src/keywords/ToughnessKeyword.js +29 -29
- package/src/keywords/WatermarkKeyword.js +16 -16
- 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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
- is:
|
|
82
|
-
- is:
|
|
83
|
-
- is:
|
|
84
|
-
- is:
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- is:
|
|
90
|
-
- is
|
|
91
|
-
- is
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
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
|