@solely/simple-fm
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -10,2 +10,3 @@ import Album from './classes/album.class.js'; | ||
private readonly key; | ||
private readonly options; | ||
readonly album: Album; | ||
@@ -21,3 +22,4 @@ readonly artist: Artist; | ||
}); | ||
private createService; | ||
private validateApiKey; | ||
} |
@@ -12,2 +12,3 @@ import Album from './classes/album.class.js'; | ||
key; | ||
options; | ||
album; | ||
@@ -22,12 +23,16 @@ artist; | ||
this.key = key; | ||
this.options = options; | ||
this.validateApiKey(); | ||
options.userAgent ??= `simple-fm v${pkg.version} - a simple Last.fm wrapper written in TypeScript (https://github.com/solelychloe/simple-fm)`; | ||
this.album = new Album(key, options.userAgent); | ||
this.artist = new Artist(key, options.userAgent); | ||
this.chart = new Chart(key, options.userAgent); | ||
this.geo = new Geo(key, options.userAgent); | ||
this.tag = new Tag(key, options.userAgent); | ||
this.track = new Track(key, options.userAgent); | ||
this.user = new User(key, options.userAgent); | ||
this.album = this.createService(Album); | ||
this.artist = this.createService(Artist); | ||
this.chart = this.createService(Chart); | ||
this.geo = this.createService(Geo); | ||
this.tag = this.createService(Tag); | ||
this.track = this.createService(Track); | ||
this.user = this.createService(User); | ||
} | ||
createService(ServiceClass) { | ||
return new ServiceClass(this.key, this.options.userAgent); | ||
} | ||
validateApiKey() { | ||
@@ -34,0 +39,0 @@ if (!this.key) |
@@ -39,3 +39,3 @@ import { $fetch, FetchError } from 'ofetch'; | ||
if (err instanceof FetchError) | ||
throw new FetchError(err.message); | ||
throw new LastFMError(err.data); | ||
else if (err instanceof LastFMError) | ||
@@ -42,0 +42,0 @@ throw new LastFMError(err.response); |
@@ -1,1 +0,23 @@ | ||
export declare const pkg: any; | ||
interface Package { | ||
name: string; | ||
version: string; | ||
license: string; | ||
author: string; | ||
description: string; | ||
type: string; | ||
main: string; | ||
files: string[]; | ||
scripts: Record<string, string>; | ||
publishConfig: Record<string, string>; | ||
engines: Record<string, string>; | ||
exports: Record<string, string>; | ||
homepage: string; | ||
repository: Record<string, string>; | ||
keywords: string[]; | ||
funding: Record<string, string>; | ||
packageManager: string; | ||
dependencies: Record<string, string>; | ||
devDependencies: Record<string, string>; | ||
} | ||
export declare const pkg: Package; | ||
export {}; |
{ | ||
"name": "@solely/simple-fm", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"license": "Zlib", | ||
@@ -65,2 +65,3 @@ "author": "Chloe Arciniega <solely@riseup.net> (https://arciniega.one)", | ||
"build": "tsc -p tsconfig.build.json && tsconfig-replace-paths -p tsconfig.build.json -s src/", | ||
"change": "pnpm changeset", | ||
"ci:publish": "pnpm publish -r", | ||
@@ -67,0 +68,0 @@ "ci:version": "pnpm changeset version", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91392
2661