Skip to content

Commit

Permalink
chore: add type checking in jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed May 26, 2023
1 parent c74f868 commit f34968a
Show file tree
Hide file tree
Showing 87 changed files with 468 additions and 270 deletions.
4 changes: 2 additions & 2 deletions helpers/fixtures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { fileURLToPath } from "node:url";

/**
* @param {string} filename - Fixture’s file name
* @param {string} encoding - String encoding
* @returns {Promise|object} File contents
* @param {NodeJS.BufferEncoding} encoding - String encoding
* @returns {object} File contents
*/
export const getFixture = (filename, encoding = "utf8") => {
const file = fileURLToPath(new URL(filename, import.meta.url));
Expand Down
12 changes: 6 additions & 6 deletions helpers/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export default class TestStore {
}

/**
* @private
* @access private
* @param {string} path - Request path
* @param {string} [method=GET] - Request method
* @param {object} [body] - Request body
* @returns {Function} Store client interface
* @returns {Promise<Response>} Store client interface
*/
async #client(path, method = "GET", body) {
const { baseUrl, user } = this.options;
Expand Down Expand Up @@ -61,7 +61,7 @@ export default class TestStore {
* @param {string} path - Path to file
* @param {string} content - File content
* @param {string} message - Commit message
* @returns {Promise<Response>} A promise to the response
* @returns {Promise<boolean>} File created
*/
async createFile(path, content, message) {
await this.#client(path, "PUT", { content, message });
Expand All @@ -71,7 +71,7 @@ export default class TestStore {
/**
* Read file
* @param {string} path - Path to file
* @returns {Promise<Response>} A promise to the response
* @returns {Promise<string>} File content
*/
async readFile(path) {
const response = await this.#client(path);
Expand All @@ -84,7 +84,7 @@ export default class TestStore {
* @param {string} path - Path to file
* @param {string} content - File content
* @param {string} message - Commit message
* @returns {Promise<Response>} A promise to the response
* @returns {Promise<boolean>} File updated
*/
async updateFile(path, content, message) {
await this.#client(path, "PATCH", { content, message });
Expand All @@ -95,7 +95,7 @@ export default class TestStore {
* Delete file
* @param {string} path - Path to file
* @param {string} message - Commit message
* @returns {Promise<Response>} A promise to the response
* @returns {Promise<boolean>} File deleted
*/
async deleteFile(path, message) {
await this.#client(path, "DELETE", { message });
Expand Down
10 changes: 10 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"checkJs": true,
"module": "nodenext",
"resolveJsonModule": true,
"target": "es2021"
},
"exclude": ["node_modules", "**/tests/**/*.js"],
"typeRoots": ["types", "./node_modules/@types"]
}
Loading

0 comments on commit f34968a

Please sign in to comment.