From a6da7d045e149261f19bca20d1fd92568cc79eee Mon Sep 17 00:00:00 2001 From: Cherkashin Alexander Date: Tue, 19 Dec 2023 17:50:28 +0300 Subject: [PATCH] TypeScript error when using sample from README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa8b85a..dc1959a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The major and minor version of this library is mapped to the version of the Gite ```ts import { giteaApi } from 'gitea-js'; -const api = new giteaApi('https://try.gitea.com/', { +const api = giteaApi('https://try.gitea.com/', { token: 'access-token', // generate one at https://gitea.example.com/user/settings/applications }); @@ -42,7 +42,7 @@ console.log(repo); const { giteaApi } = require('gitea-js'); const fetch = require('cross-fetch'); // You have to use a fetch compatible polyfill like cross-fetch for Node.JS -const api = new giteaApi('https://try.gitea.com/', { +const api = giteaApi('https://try.gitea.com/', { token: 'access-token', // generate one at https://gitea.example.com/user/settings/applications customFetch: fetch, });