stack-analyze 1.4.0 → 1.4.1
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/CHANGELOG.md +6 -0
- package/functions/getStations.js +25 -0
- package/functions/magicBall.js +7 -4
- package/hash/infoTools.js +11 -0
- package/hash/utilityTools.js +1 -0
- package/package.json +1 -1
- package/utils.js +8 -14
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
|
|
|
6
6
|
- version 1.4.0
|
|
7
7
|
- Added:
|
|
8
8
|
- new tool magic ball
|
|
9
|
+
- version 1.4.1
|
|
10
|
+
- Added:
|
|
11
|
+
- stations info
|
|
12
|
+
- Changed:
|
|
13
|
+
- change from basic console.log for magic ball now using boxen
|
|
14
|
+
- update sets for tcgp info tool
|
|
9
15
|
|
|
10
16
|
## generation 4 (ver. 1.3.0 - 1.3.9)
|
|
11
17
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { printTable } from "console-table-printer";
|
|
3
|
+
import colors from "colors";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {string} country
|
|
8
|
+
*/
|
|
9
|
+
const getStations = async (country) => {
|
|
10
|
+
try {
|
|
11
|
+
const { data } = await axios.get(`https://de1.api.radio-browser.info/json/stations/bycountry/${country}`, {
|
|
12
|
+
params: { limit: 20 }
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const stations = data.map(({ name, state, codec }) => ({
|
|
16
|
+
name, state: state || "unknown", codec,
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
stations.length === 0 ? console.warn("no stations".yellow) : printTable(stations);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.error(colors.red(err));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default getStations;
|
package/functions/magicBall.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import colors from "colors";
|
|
3
|
+
import boxen from "boxen";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @async
|
|
@@ -12,15 +13,17 @@ export default async function magicBall(locale, question) {
|
|
|
12
13
|
en: "magic ball say:",
|
|
13
14
|
es: "la bola magic te dice:"
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
|
|
16
17
|
try {
|
|
17
18
|
const {data} = await axios.get("https://eightballapi.com/api/biased", {
|
|
18
19
|
params: { question, locale }
|
|
19
20
|
});
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
localeKeyword[locale],
|
|
23
|
-
);
|
|
22
|
+
const anwser = boxen(data.reading, {
|
|
23
|
+
title: localeKeyword[locale],
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
console.info(anwser);
|
|
24
27
|
} catch (err) {
|
|
25
28
|
console.info(colors.red(err.message));
|
|
26
29
|
}
|
package/hash/infoTools.js
CHANGED
|
@@ -8,6 +8,7 @@ import githubInfo from "../functions/gitUser.js";
|
|
|
8
8
|
import bundlephobia from "../functions/bundlephobia.js";
|
|
9
9
|
import { returnMainOpts, TCGP_EXPANSIONS } from "../utils.js";
|
|
10
10
|
import getTcgpCard from "../functions/tcgp.js";
|
|
11
|
+
import getStations from "../functions/getStations.js";
|
|
11
12
|
|
|
12
13
|
// bitly regexp
|
|
13
14
|
const bitlyRegexp = /bit\.ly\//g;
|
|
@@ -83,6 +84,16 @@ const infoTools = {
|
|
|
83
84
|
|
|
84
85
|
getTcgpCard(setName, cardID);
|
|
85
86
|
|
|
87
|
+
setTimeout(refreshCallback, 5e3);
|
|
88
|
+
},
|
|
89
|
+
async getStations(refreshCallback) {
|
|
90
|
+
console.warn("some stations not visble only info".yellow);
|
|
91
|
+
|
|
92
|
+
const country = await input({
|
|
93
|
+
message: "enter country"
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
getStations(country);
|
|
86
97
|
setTimeout(refreshCallback, 5e3);
|
|
87
98
|
}
|
|
88
99
|
};
|
package/hash/utilityTools.js
CHANGED
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -24,22 +24,16 @@ const pokerGameOpts = [
|
|
|
24
24
|
];
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @
|
|
27
|
+
*
|
|
28
|
+
* @constant {Object<string,number>}
|
|
29
29
|
*/
|
|
30
30
|
const TCGP_EXPANSIONS = {
|
|
31
|
-
"p-a": 100,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
a3: 239,
|
|
38
|
-
a3a: 103,
|
|
39
|
-
a3b: 107,
|
|
40
|
-
a4: 241,
|
|
41
|
-
a4a: 105,
|
|
42
|
-
b1: 331,
|
|
31
|
+
"p-a": 100, a1: 286, a1a: 86,
|
|
32
|
+
a2: 207, a2a: 96, a2b: 111,
|
|
33
|
+
a3: 239, a3a: 103, a3b: 107,
|
|
34
|
+
a4: 241, a4a: 105,
|
|
35
|
+
b1: 331, b1a: 103,
|
|
36
|
+
b2: 234,
|
|
43
37
|
};
|
|
44
38
|
|
|
45
39
|
/**
|