lastfm-nodejs-client 1.4.5 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/getTopAlbums.d.ts +1 -1
- package/dist/cjs/getTopAlbums.js +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/request.js +5 -1
- package/dist/mjs/getTopAlbums.d.ts +1 -1
- package/dist/mjs/getTopAlbums.js +2 -2
- package/dist/mjs/index.js +1 -0
- package/dist/mjs/request.js +5 -1
- package/package.json +1 -1
package/dist/cjs/getTopAlbums.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getTopAlbums = void 0;
|
|
7
|
-
const createOptions_1 = require("./createOptions");
|
|
8
7
|
const request_1 = __importDefault(require("./request"));
|
|
8
|
+
const createOptions_1 = require("./createOptions");
|
|
9
9
|
/**
|
|
10
10
|
* GET: Top Albums - LastFM
|
|
11
11
|
*
|
package/dist/cjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const method_1 = require("./method");
|
|
|
16
16
|
const topTags_1 = require("./chart/topTags");
|
|
17
17
|
const topTracks_1 = require("./chart/topTracks");
|
|
18
18
|
const topArtists_1 = require("./chart/topArtists");
|
|
19
|
+
console.log('LastFmApi init>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
|
|
19
20
|
function LastFmApi() {
|
|
20
21
|
return {
|
|
21
22
|
auth: auth_1.auth,
|
package/dist/cjs/request.js
CHANGED
|
@@ -48,7 +48,11 @@ const request = async (options) => {
|
|
|
48
48
|
}
|
|
49
49
|
switch (res.status) {
|
|
50
50
|
case 200: {
|
|
51
|
-
|
|
51
|
+
if (res.headers.get('content-type').includes('json')) {
|
|
52
|
+
const body = await res.json();
|
|
53
|
+
return body;
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
52
56
|
}
|
|
53
57
|
case 400: {
|
|
54
58
|
throw new Error('Bad request');
|
package/dist/mjs/getTopAlbums.js
CHANGED
package/dist/mjs/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { method } from './method';
|
|
|
14
14
|
import { chartTopTags } from './chart/topTags';
|
|
15
15
|
import { chartTopTracks } from './chart/topTracks';
|
|
16
16
|
import { chartTopArtists } from './chart/topArtists';
|
|
17
|
+
console.log('LastFmApi init>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
|
|
17
18
|
export default function LastFmApi() {
|
|
18
19
|
return {
|
|
19
20
|
auth,
|
package/dist/mjs/request.js
CHANGED
|
@@ -43,7 +43,11 @@ const request = async (options) => {
|
|
|
43
43
|
}
|
|
44
44
|
switch (res.status) {
|
|
45
45
|
case 200: {
|
|
46
|
-
|
|
46
|
+
if (res.headers.get('content-type').includes('json')) {
|
|
47
|
+
const body = await res.json();
|
|
48
|
+
return body;
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
47
51
|
}
|
|
48
52
|
case 400: {
|
|
49
53
|
throw new Error('Bad request');
|
package/package.json
CHANGED