Skip to content
theBowja edited this page Sep 12, 2022 · 10 revisions

The following are the default options that the library starts off with:

{
    dumpResult: false, // The query result will return an object with the properties: query, folder, match, matchtype, options, filename, result.
    matchNames: true, // Allows the matching of names.
    matchAltNames: true, // Allows the matching of alternate or custom names.
    matchAliases: false, // Allows the matching of aliases. These are searchable fields that returns the data object the query matched in.
    matchCategories: false, // Allows the matching of categories. If true, then returns an array if it matches.
    verboseCategories: false, // Used if a category is matched. If true, then replaces each string name in the array with the data object instead.
    queryLanguages: ["English"], // Array of languages that your query will be searched in.
    resultLanguage: "English" // Output language that you want your results to be in.
}

Table of Contents

dumpResult

If set to true, the return result from query functions will have extra info about the search. This will be in the format of an object with the properties: query, folder, match, matchtype, options, filename, result.

query: The query that was passed into the query function.
folder: The folder we're searching in. Enum genshindb.Folder
match: The name of the data that the autocompleted query matched.
matchtype: The type of match. Enum genshindb.MatchType
options:
filename:
result:

genshindb.characters('jade')
{
  name: 'Juvenile Jade',
  description: 'A crystalline substance taken from a Primo Geovishap. Within it is contained the potential to become a dragon.\n' +
    'These dull crystals are precipitated within the bodies of vishaps sleeping in the mountains. Liyue folklore holds that they will gather power over many years, after which this crystal will, at last, replace their original heart, and the vishap will become a true dragon — one that can shake the mountains and split the earth.',
  sortorder: 2406,
  rarity: '4',
  category: 'AVATAR_MATERIAL',
  materialtype: 'Character Level-Up Material',
  source: [ 'Dropped by Lv. 30+ primo geovishaps' ],
  images: {
    redirect: 'https://genshin-impact.fandom.com/wiki/Special:Redirect/file/Item_Juvenile_Jade.png',
    fandom: 'https://static.wikia.nocookie.net/gensin-impact/images/f/f1/Item_Juvenile_Jade.png',
    nameicon: 'UI_ItemIcon_113016'
  },
  url: { fandom: 'https://genshin-impact.fandom.com/wiki/Juvenile_Jade' },
  version: ''
}
genshindb.characters('jade', { dumpResult: true })
{
  query: 'jade',
  folder: 'materials',
  match: 'Juvenile Jade',
  matchtype: 'names',
  options: {
    dumpResult: true,
    matchNames: true,
    matchAltNames: true,
    matchAliases: false,
    matchCategories: false,
    verboseCategories: false,
    queryLanguages: [ 'English' ],
    resultLanguage: 'English'
  },
  filename: 'juvenilejade',
  result: {
    name: 'Juvenile Jade',
    description: 'A crystalline substance taken from a Primo Geovishap. Within it is contained the potential to become a dragon.\n' +
      'These dull crystals are precipitated within the bodies of vishaps sleeping in the mountains. Liyue folklore holds that they will gather power over many years, after which this crystal will, at last, replace their original heart, and the vishap will become a true dragon — one that can shake the mountains and split the earth.',
    sortorder: 2406,
    rarity: '4',
    category: 'AVATAR_MATERIAL',
    materialtype: 'Character Level-Up Material',
    source: [ 'Dropped by Lv. 30+ primo geovishaps' ],
    images: {
      redirect: 'https://genshin-impact.fandom.com/wiki/Special:Redirect/file/Item_Juvenile_Jade.png',
      fandom: 'https://static.wikia.nocookie.net/gensin-impact/images/f/f1/Item_Juvenile_Jade.png',
      nameicon: 'UI_ItemIcon_113016'
    },
    url: { fandom: 'https://genshin-impact.fandom.com/wiki/Juvenile_Jade' },
    version: ''
  }
}
[Finished in 705ms]

matchNames

matchAltNames

matchAliases

matchCategories

verboseCategories

queryLanguages

resultLanguage

Clone this wiki locally