LearningProcesss / boardgamegeekjsclient

Typescript written API wrapper for Boardgamegeek XML2 API
MIT License
18 stars 6 forks source link

Query builder ignore undefined property #39

Closed LearningProcesss closed 1 year ago

LearningProcesss commented 1 year ago
          Thank you for this! Just tried it out, but I'm getting some errors.

Running this code:

import { BggClient } from "boardgamegeekclient";
const client = BggClient.Create();

async function search() {
  const result = await client.search.query({
    type: ["boardgame", "boardgameexpansion"],
    query: "Exit The Game",
    exact: undefined,
  });
  console.log(result);
}

search();

I get the following error:

TypeError: Cannot read properties of undefined (reading 'toString')
    at /bgg-thing/node_modules/boardgamegeekclient/dist/src/query/concrete/GenericQueryBuilder.ts:7:61
    at Array.map (<anonymous>)
    at GenericQueryBuilder.build (/bgg-thing/node_modules/boardgamegeekclient/dist/src/query/concrete/GenericQueryBuilder.ts:7:10)
    at BggSearchClient.<anonymous> (/bgg-thing/node_modules/boardgamegeekclient/dist/src/client/concrete/BggSearchClient.ts:28:42)
    at Generator.next (<anonymous>)
    at /bgg-thing/node_modules/boardgamegeekclient/dist/cjs/client/concrete/BggSearchClient.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/bgg-thing/node_modules/boardgamegeekclient/dist/cjs/client/concrete/BggSearchClient.js:4:12)
    at BggSearchClient.query (/bgg-thing/node_modules/boardgamegeekclient/dist/cjs/client/concrete/BggSearchClient.js:22:16)
    at /bgg-thing/test.ts:6:38

Originally posted by @benjick in https://github.com/LearningProcesss/boardgamegeekjsclient/issues/27#issuecomment-1159570244

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.7.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: