update dependencies

This commit is contained in:
Blake Joynes
2024-06-09 11:25:19 -04:00
parent fc44bcf425
commit 730afebd7d
9 changed files with 921 additions and 3032 deletions

View File

@@ -1,4 +0,0 @@
node_modules
dist
lib
coverage

View File

@@ -1,22 +0,0 @@
module.exports = {
env: {
browser: false,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
},
rules:{
'linebreak-style': ['off', 'unix'],
},
plugins: ["@typescript-eslint"],
};

2
.nvmrc
View File

@@ -1 +1 @@
v18.16.0
v20.14.0

23
eslint.config.mjs Normal file
View File

@@ -0,0 +1,23 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default [
{
files: ["src/*.ts"],
ignores:[
"node_modules",
"dist",
"lib",
"coverage"
],
languageOptions: {
globals: globals.browser,
}
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
];

3857
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
{
"name": "tmdb-ts",
"version": "1.8.0",
"version": "2.0.0",
"description": "TMDB v3 library wrapper",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"compile": "rm -rf dist && tsc -d",
"lint": "eslint --ext .ts src/",
"lint:fix": "eslint --ext .ts src/ --fix",
"lint": "eslint src/",
"lint:fix": "eslint --fix",
"format": "npx prettier --write src",
"pre-commit": "npm run lint"
},
@@ -29,27 +29,23 @@
"author": "Blake Joynes",
"license": "MIT",
"devDependencies": {
"@types/node": "^18.15.11",
"@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"dotenv": "^9.0.2",
"eslint": "^8.38.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"prettier": "^2.8.7",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
"@eslint/js": "^9.4.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.14.2",
"@types/node-fetch": "^3.0.3",
"dotenv": "^16.4.5",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"globals": "^15.4.0",
"husky": "^9.0.11",
"prettier": "^3.3.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.12.0"
},
"dependencies": {
"cross-fetch": "^3.1.4"
},
"volta": {
"node": "18.16.0",
"yarn": "1.22.4",
"npm": "9.5.1"
"cross-fetch": "^4.0.0"
},
"husky": {
"hooks": {

View File

@@ -1,8 +1,7 @@
import fetch from 'cross-fetch';
import { parseOptions } from './utils';
import { ErrorResponse } from './types';
const BASE_URL_V3 = 'https://api.themoviedb.org/3';
import { BASE_URL_V3 } from './common/constants';
export class Api {
constructor(private accessToken: string) {

1
src/common/constants.ts Normal file
View File

@@ -0,0 +1 @@
export const BASE_URL_V3 = 'https://api.themoviedb.org/3';

View File

@@ -1,4 +1,3 @@
export function parseOptions(options?: Record<string, any>): string {
/* eslint-disable @typescript-eslint/no-explicit-any */
return options ? new URLSearchParams(Object.entries(options)).toString() : '';
}