Socket
Book a DemoInstallSign in
Socket

kcwiki-quest-data

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kcwiki-quest-data

Kancolle Quest Data

0.8.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Kcwiki Quest Data

npm npm bundle size build

The Structured data for Kantai Collection quest

Supported features

  • Auto complete for quest data

image

  • Hover documentation

image

  • Types support
  • JSON schema support
  • Unit test
  • Linter
  • CI/CD
  • Monitor new quest data from poi server dump

image

Instructions

Quest data update

  • Clone this repo
  • Run npm install
  • Run npm run generateSchema
  • Edit data/*.json or draft/*.json in vscode

Use in other libraries

To install the latest version, run the following command:

# Stable version
npm install kcwiki-quest-data

# Nightly version
npm install kcwikizh/kcwiki-quest-data#nightly

Or if you're using yarn:

# Stable version
yarn add kcwiki-quest-data

# Nightly version
yarn add kcwikizh/kcwiki-quest-data#nightly
import type { Quest } from 'kcwiki-quest-data' // quest json type
import { questData } from 'kcwiki-quest-data' // all quests json array
import { questDataMap } from 'kcwiki-quest-data' // all quests json keyBy game_id
import quest101 from 'kcwiki-quest-data/data/101.json'
import { QuestHelper } from 'kcwiki-quest-data'

QuestHelper.of(101).ensure()?.unwrap().wiki_id // "A01"
QuestHelper.of(101).ensure(
  (questContainer) => console.log(questContainer.unwrap().wiki_id),
  (err) => console.error('Error!', err),
) // "A01"
QuestHelper.of(99999999).forceEnsure().unwrap().name // "UNKNOWN_QUEST"

API

Quest

The type of quest json.

QuestHelper

Basic

  • static QuestHelper.of(gameId: number): MaybeQuest
  • static QuestHelper.of(quest: Quest): QuestHelper
  • QuestHelper.id: number
  • QuestHelper.unwrap(): Quest

Utils

  • QuestHelper.translate(lng: string): string
  • QuestHelper.getPrerequisite(): QuestHelper[]
  • QuestHelper.getPostQuest(): QuestHelper[]

MaybeQuest

  • MaybeQuest.ensure(): QuestHelper | undefined
  • MaybeQuest.ensure((questContainer: QuestHelper) => {}, (error: Error) => {})
  • MaybeQuest.forceEnsure(): QuestHelper<Quest | UNKNOWN_QUEST>

Reference

Keywords

Kancolle

FAQs

Package last updated on 21 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.