@pkmn/data
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -17,3 +17,3 @@ "use strict"; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
@@ -37,3 +37,3 @@ return result; | ||
const Gen = (num) => gens.get(num); | ||
describe('exists', () => { | ||
test('exists', () => { | ||
const gens2 = new index_1.Generations(Dex, e => !!e.exists && (!('num' in e) || e.num < 10)); | ||
@@ -65,3 +65,3 @@ expect(gens2.get(5).species.get('Bulbasaur')).toBeDefined(); | ||
}); | ||
test('counts', () => { | ||
it('counts', () => { | ||
const COUNTS = [0, 0, 76, 47, 41, 27, 42, 27]; | ||
@@ -73,3 +73,3 @@ let total = 0; | ||
}); | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).abilities.get('Mummy'); | ||
@@ -105,3 +105,3 @@ const b = Gen(6).abilities.get('Mummy'); | ||
}); | ||
test('fields', () => { | ||
it('fields', () => { | ||
expect(Gen(7).items.get('Sitrus Berry').effectType).toBe('Item'); | ||
@@ -123,3 +123,3 @@ expect(Gen(4).items.get('Sitrus Berry').isBerry).toBe(true); | ||
}); | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).items.get('Choice Band'); | ||
@@ -144,3 +144,3 @@ const b = Gen(6).items.get('Choice Band'); | ||
}); | ||
test('fields', () => { | ||
it('fields', () => { | ||
expect(Gen(7).moves.get('Tackle').effectType).toBe('Move'); | ||
@@ -200,3 +200,3 @@ expect(Gen(1).moves.get('Surf').basePower).toBe(95); | ||
}); | ||
test('counts', () => { | ||
it('counts', () => { | ||
const COUNTS = [165, 86 + 16, 103, 113, 92, 59, 105 - 14]; | ||
@@ -209,3 +209,3 @@ let total = 0; | ||
}); | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).moves.get('Earthquake'); | ||
@@ -220,3 +220,3 @@ const b = Gen(6).moves.get('Earthquake'); | ||
describe('Species', () => { | ||
test('#get', () => { | ||
it('#get', () => { | ||
const gen = Gen(7); | ||
@@ -244,3 +244,3 @@ expect(gen.species.get('foo')).toBeUndefined(); | ||
}); | ||
test('counts', () => { | ||
it('counts', () => { | ||
const counts = (num) => { | ||
@@ -298,3 +298,3 @@ const gen = Gen(num); | ||
}); | ||
test('formeNum', () => { | ||
it('formeNum', () => { | ||
for (const gen of gens) { | ||
@@ -315,3 +315,3 @@ for (const species of gen.species) { | ||
}); | ||
test('fields', () => { | ||
it('fields', () => { | ||
expect(Gen(7).species.get('Clefable').types).toEqual(['Fairy']); | ||
@@ -351,7 +351,7 @@ expect(Gen(3).species.get('Clefable').types).toEqual(['Normal']); | ||
}); | ||
test('#hasAbility', () => { | ||
it('#hasAbility', () => { | ||
expect(Gen(7).species.get('Gengar').hasAbility('Levitate')).toBe(false); | ||
expect(Gen(5).species.get('Gengar').hasAbility('Levitate')).toBe(true); | ||
}); | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).species.get('Gengar'); | ||
@@ -366,3 +366,3 @@ const b = Gen(6).species.get('Gengar'); | ||
describe('Effects', () => { | ||
test('#get', () => { | ||
it('#get', () => { | ||
const gen = Gen(8); | ||
@@ -384,3 +384,3 @@ expect(gen.effects.get('')).toBeUndefined(); | ||
describe('Learnsets', () => { | ||
test('#get', async () => { | ||
it('#get', async () => { | ||
expect((await Gen(8).learnsets.get('foo'))).toBeUndefined(); | ||
@@ -398,3 +398,3 @@ const learnset = (await Gen(1).learnsets.get('mew')); | ||
describe('Natures', () => { | ||
test('#get', () => { | ||
it('#get', () => { | ||
const adamant = Gen(8).natures.get('adamant'); | ||
@@ -410,3 +410,3 @@ expect(adamant.name).toBe('Adamant'); | ||
}); | ||
test('count', () => { | ||
it('count', () => { | ||
expect(Array.from(Gen(8).natures)).toHaveLength(25); | ||
@@ -466,3 +466,3 @@ }); | ||
describe('Stats', () => { | ||
test('calc', () => { | ||
it('calc', () => { | ||
const rby = { hp: 403, atk: 298, def: 298, spa: 298, spd: 298, spe: 298 }; | ||
@@ -487,3 +487,3 @@ const adv = { hp: 404, atk: 328, def: 299, spa: 269, spd: 299, spe: 299 }; | ||
}); | ||
test('get', () => { | ||
it('get', () => { | ||
const gen = Gen(8); | ||
@@ -496,3 +496,3 @@ expect(gen.stats.get('foo')).not.toBeDefined(); | ||
}); | ||
test('display', () => { | ||
it('display', () => { | ||
const gen = Gen(8); | ||
@@ -506,3 +506,3 @@ expect(gen.stats.display('foo')).toBe('foo'); | ||
}); | ||
test('fill', () => { | ||
it('fill', () => { | ||
const gen = Gen(8); | ||
@@ -514,3 +514,3 @@ expect(gen.stats.fill({ atk: 10, def: 12, spd: 15 }, 31)) | ||
}); | ||
test('getHPDV', () => { | ||
it('getHPDV', () => { | ||
const stats = Gen(8).stats; | ||
@@ -527,3 +527,3 @@ expect(stats.getHPDV({ spa: stats.toIV(15), spe: stats.toIV(15) })).toBe(15); | ||
}); | ||
test('iterate', () => { | ||
it('iterate', () => { | ||
expect(Array.from(Gen(8).stats)) | ||
@@ -530,0 +530,0 @@ .toStrictEqual(['hp', 'atk', 'def', 'spe', 'spa', 'spd']); |
@@ -20,3 +20,3 @@ import {GenerationNum, Generations, StatsTable, Dex as DexT, ItemName} from './index'; | ||
describe('exists', () => { | ||
test('exists', () => { | ||
const gens2 = new Generations(Dex, e => !!e.exists && (!('num' in e) || e.num < 10)); | ||
@@ -52,3 +52,3 @@ expect(gens2.get(5).species.get('Bulbasaur')).toBeDefined(); | ||
test('counts', () => { | ||
it('counts', () => { | ||
const COUNTS = [0, 0, 76, 47, 41, 27, 42, 27]; | ||
@@ -61,3 +61,3 @@ let total = 0; | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).abilities.get('Mummy'); | ||
@@ -101,3 +101,3 @@ const b = Gen(6).abilities.get('Mummy'); | ||
test('fields', () => { | ||
it('fields', () => { | ||
expect(Gen(7).items.get('Sitrus Berry')!.effectType).toBe('Item'); | ||
@@ -120,3 +120,3 @@ expect(Gen(4).items.get('Sitrus Berry')!.isBerry).toBe(true); | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).items.get('Choice Band'); | ||
@@ -144,3 +144,3 @@ const b = Gen(6).items.get('Choice Band'); | ||
test('fields', () => { | ||
it('fields', () => { | ||
expect(Gen(7).moves.get('Tackle')!.effectType).toBe('Move'); | ||
@@ -203,3 +203,3 @@ expect(Gen(1).moves.get('Surf')!.basePower).toBe(95); | ||
test('counts', () => { | ||
it('counts', () => { | ||
const COUNTS = [165, 86 + 16, 103, 113, 92, 59, 105 - 14]; | ||
@@ -213,3 +213,3 @@ let total = 0; | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).moves.get('Earthquake'); | ||
@@ -226,3 +226,3 @@ const b = Gen(6).moves.get('Earthquake'); | ||
describe('Species', () => { | ||
test('#get', () => { | ||
it('#get', () => { | ||
const gen = Gen(7); | ||
@@ -252,3 +252,3 @@ expect(gen.species.get('foo')).toBeUndefined(); | ||
test('counts', () => { | ||
it('counts', () => { | ||
const counts = (num: GenerationNum) => { | ||
@@ -307,3 +307,3 @@ const gen = Gen(num); | ||
test('formeNum', () => { | ||
it('formeNum', () => { | ||
for (const gen of gens) { | ||
@@ -325,3 +325,3 @@ for (const species of gen.species) { | ||
test('fields', () => { | ||
it('fields', () => { | ||
expect(Gen(7).species.get('Clefable')!.types).toEqual(['Fairy']); | ||
@@ -362,3 +362,3 @@ expect(Gen(3).species.get('Clefable')!.types).toEqual(['Normal']); | ||
test('#hasAbility', () => { | ||
it('#hasAbility', () => { | ||
expect(Gen(7).species.get('Gengar')!.hasAbility('Levitate')).toBe(false); | ||
@@ -368,3 +368,3 @@ expect(Gen(5).species.get('Gengar')!.hasAbility('Levitate')).toBe(true); | ||
test('cached', () => { | ||
it('cached', () => { | ||
const a = Gen(6).species.get('Gengar'); | ||
@@ -381,3 +381,3 @@ const b = Gen(6).species.get('Gengar'); | ||
describe('Effects', () => { | ||
test('#get', () => { | ||
it('#get', () => { | ||
const gen = Gen(8); | ||
@@ -400,3 +400,3 @@ expect(gen.effects.get('')).toBeUndefined(); | ||
describe('Learnsets', () => { | ||
test('#get', async () => { | ||
it('#get', async () => { | ||
expect((await Gen(8).learnsets.get('foo'))).toBeUndefined(); | ||
@@ -416,3 +416,3 @@ const learnset = (await Gen(1).learnsets.get('mew'))!; | ||
describe('Natures', () => { | ||
test('#get', () => { | ||
it('#get', () => { | ||
const adamant = Gen(8).natures.get('adamant')!; | ||
@@ -431,3 +431,3 @@ expect(adamant.name).toBe('Adamant'); | ||
test('count', () => { | ||
it('count', () => { | ||
expect(Array.from(Gen(8).natures)).toHaveLength(25); | ||
@@ -492,3 +492,3 @@ }); | ||
describe('Stats', () => { | ||
test('calc', () => { | ||
it('calc', () => { | ||
const rby: StatsTable = {hp: 403, atk: 298, def: 298, spa: 298, spd: 298, spe: 298}; | ||
@@ -515,3 +515,3 @@ const adv: StatsTable = {hp: 404, atk: 328, def: 299, spa: 269, spd: 299, spe: 299}; | ||
test('get', () => { | ||
it('get', () => { | ||
const gen = Gen(8); | ||
@@ -525,3 +525,3 @@ expect(gen.stats.get('foo')).not.toBeDefined(); | ||
test('display', () => { | ||
it('display', () => { | ||
const gen = Gen(8); | ||
@@ -536,3 +536,3 @@ expect(gen.stats.display('foo')).toBe('foo'); | ||
test('fill', () => { | ||
it('fill', () => { | ||
const gen = Gen(8); | ||
@@ -545,3 +545,3 @@ expect(gen.stats.fill({atk: 10, def: 12, spd: 15}, 31)) | ||
test('getHPDV', () => { | ||
it('getHPDV', () => { | ||
const stats = Gen(8).stats; | ||
@@ -561,3 +561,3 @@ expect(stats.getHPDV({spa: stats.toIV(15), spe: stats.toIV(15)})).toBe(15); | ||
test('iterate', () => { | ||
it('iterate', () => { | ||
expect(Array.from(Gen(8).stats)) | ||
@@ -564,0 +564,0 @@ .toStrictEqual(['hp', 'atk', 'def', 'spe', 'spa', 'spd']); |
{ | ||
"name": "@pkmn/data", | ||
"version": "0.1.3", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"description": "A forked implementation of the Pokémon Showdown client's data layer", | ||
"repository": "github:pkmn/ps", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pkmn/dex-types": "^0.1.3" | ||
}, | ||
"devDependencies": { | ||
"@pkmn/dex": "^0.1.3", | ||
"@pkmn/sim": "^0.1.3", | ||
"@smogon/calc": "^0.4.4" | ||
}, | ||
"scripts": { | ||
"lint": "eslint --cache --ext ts", | ||
"fix": "eslint --fix --ext ts", | ||
"compile": "tsc -p .", | ||
"bundle": "node bundle", | ||
"build": "npm run compile && npm run bundle", | ||
"test": "jest", | ||
"pretest": "npm run build", | ||
"posttest": "npm run lint" | ||
} | ||
"name": "@pkmn/data", | ||
"version": "0.2.0", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"description": "A forked implementation of the Pokémon Showdown client's data layer", | ||
"repository": "github:pkmn/ps", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pkmn/dex-types": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"@pkmn/dex": "^0.2.0", | ||
"@pkmn/sim": "^0.2.0", | ||
"@smogon/calc": "^0.5.0" | ||
}, | ||
"scripts": { | ||
"lint": "eslint --cache *.ts", | ||
"fix": "eslint --fix *.ts", | ||
"compile": "tsc -p .", | ||
"bundle": "node bundle", | ||
"build": "npm run compile && npm run bundle", | ||
"test": "jest", | ||
"pretest": "npm run build", | ||
"posttest": "npm run lint" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
496510
18
+ Added@pkmn/dex-types@0.2.7(transitive)
+ Added@pkmn/types@1.0.1(transitive)
- Removed@pkmn/dex-types@0.1.3(transitive)
- Removed@pkmn/types@0.1.2(transitive)
Updated@pkmn/dex-types@^0.2.0