weekly-fifty 1.0.3 → 1.0.5
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/index.cjs +9 -2
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +9 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,8 @@ module.exports = __toCommonJS(index_exports);
|
|
|
37
37
|
// source/_exports.ts
|
|
38
38
|
var exports_exports = {};
|
|
39
39
|
__export(exports_exports, {
|
|
40
|
-
Fetch: () => Fetch
|
|
40
|
+
Fetch: () => Fetch,
|
|
41
|
+
URL: () => URL
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
// source/fetch/index.ts
|
|
@@ -46,6 +47,12 @@ async function Fetch(options = {}) {
|
|
|
46
47
|
const { url, parse } = Fetch.Options(options);
|
|
47
48
|
return fetch(url).then(parse);
|
|
48
49
|
}
|
|
50
|
+
function URL() {
|
|
51
|
+
return "https://weeklyfifty-7617b.web.app/api";
|
|
52
|
+
}
|
|
53
|
+
((URL2) => {
|
|
54
|
+
URL2.Latest = () => `${URL2()}/getLatestQuiz`;
|
|
55
|
+
})(URL || (URL = {}));
|
|
49
56
|
((Fetch2) => {
|
|
50
57
|
const m_timestamp = import_myzod.default.object({ _seconds: import_myzod.default.required(import_myzod.default.number()), _nanoseconds: import_myzod.default.required(import_myzod.default.number()) }, { allowUnknown: true }).map(({ _seconds, _nanoseconds }) => new Date(_seconds * 1e3 + _nanoseconds / 1e6));
|
|
51
58
|
const m_question = import_myzod.default.object({ qTitle: import_myzod.default.required(import_myzod.default.string()), qAnswer: import_myzod.default.required(import_myzod.default.string()) }, { allowUnknown: true }).map(({ qTitle, qAnswer }) => ({ title: qTitle, answer: qAnswer }));
|
|
@@ -73,7 +80,7 @@ async function Fetch(options = {}) {
|
|
|
73
80
|
})
|
|
74
81
|
);
|
|
75
82
|
Fetch2.Options = (options = {}) => ({
|
|
76
|
-
url:
|
|
83
|
+
url: URL.Latest(),
|
|
77
84
|
parse: m_parse,
|
|
78
85
|
...options
|
|
79
86
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -19,6 +19,12 @@ interface Quiz {
|
|
|
19
19
|
readonly questions: ReadonlyArray<Question>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** The baseline quiz URL. */
|
|
23
|
+
declare function URL(): string;
|
|
24
|
+
declare namespace URL {
|
|
25
|
+
/** The latest quiz URL. */
|
|
26
|
+
const Latest: () => string;
|
|
27
|
+
}
|
|
22
28
|
/** Handles Fetching Quizzes. */
|
|
23
29
|
declare function Fetch(options?: Fetch.Options): Promise<Quiz>;
|
|
24
30
|
declare namespace Fetch {
|
|
@@ -31,8 +37,7 @@ declare namespace Fetch {
|
|
|
31
37
|
}
|
|
32
38
|
/**
|
|
33
39
|
* Handles resolving options to be used.
|
|
34
|
-
* @param options
|
|
35
|
-
* @returns
|
|
40
|
+
* @param options Options to resolve.
|
|
36
41
|
*/
|
|
37
42
|
const Options: (options?: Options) => Required<Options>;
|
|
38
43
|
}
|
|
@@ -41,8 +46,9 @@ declare const _exports_Fetch: typeof Fetch;
|
|
|
41
46
|
type _exports_Notes = Notes;
|
|
42
47
|
type _exports_Question = Question;
|
|
43
48
|
type _exports_Quiz = Quiz;
|
|
49
|
+
declare const _exports_URL: typeof URL;
|
|
44
50
|
declare namespace _exports {
|
|
45
|
-
export { _exports_Fetch as Fetch, type _exports_Notes as Notes, type _exports_Question as Question, type _exports_Quiz as Quiz };
|
|
51
|
+
export { _exports_Fetch as Fetch, type _exports_Notes as Notes, type _exports_Question as Question, type _exports_Quiz as Quiz, _exports_URL as URL };
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
export { _exports as TW50 };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ interface Quiz {
|
|
|
19
19
|
readonly questions: ReadonlyArray<Question>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** The baseline quiz URL. */
|
|
23
|
+
declare function URL(): string;
|
|
24
|
+
declare namespace URL {
|
|
25
|
+
/** The latest quiz URL. */
|
|
26
|
+
const Latest: () => string;
|
|
27
|
+
}
|
|
22
28
|
/** Handles Fetching Quizzes. */
|
|
23
29
|
declare function Fetch(options?: Fetch.Options): Promise<Quiz>;
|
|
24
30
|
declare namespace Fetch {
|
|
@@ -31,8 +37,7 @@ declare namespace Fetch {
|
|
|
31
37
|
}
|
|
32
38
|
/**
|
|
33
39
|
* Handles resolving options to be used.
|
|
34
|
-
* @param options
|
|
35
|
-
* @returns
|
|
40
|
+
* @param options Options to resolve.
|
|
36
41
|
*/
|
|
37
42
|
const Options: (options?: Options) => Required<Options>;
|
|
38
43
|
}
|
|
@@ -41,8 +46,9 @@ declare const _exports_Fetch: typeof Fetch;
|
|
|
41
46
|
type _exports_Notes = Notes;
|
|
42
47
|
type _exports_Question = Question;
|
|
43
48
|
type _exports_Quiz = Quiz;
|
|
49
|
+
declare const _exports_URL: typeof URL;
|
|
44
50
|
declare namespace _exports {
|
|
45
|
-
export { _exports_Fetch as Fetch, type _exports_Notes as Notes, type _exports_Question as Question, type _exports_Quiz as Quiz };
|
|
51
|
+
export { _exports_Fetch as Fetch, type _exports_Notes as Notes, type _exports_Question as Question, type _exports_Quiz as Quiz, _exports_URL as URL };
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
export { _exports as TW50 };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,8 @@ var __export = (target, all) => {
|
|
|
7
7
|
// source/_exports.ts
|
|
8
8
|
var exports_exports = {};
|
|
9
9
|
__export(exports_exports, {
|
|
10
|
-
Fetch: () => Fetch
|
|
10
|
+
Fetch: () => Fetch,
|
|
11
|
+
URL: () => URL
|
|
11
12
|
});
|
|
12
13
|
|
|
13
14
|
// source/fetch/index.ts
|
|
@@ -16,6 +17,12 @@ async function Fetch(options = {}) {
|
|
|
16
17
|
const { url, parse } = Fetch.Options(options);
|
|
17
18
|
return fetch(url).then(parse);
|
|
18
19
|
}
|
|
20
|
+
function URL() {
|
|
21
|
+
return "https://weeklyfifty-7617b.web.app/api";
|
|
22
|
+
}
|
|
23
|
+
((URL2) => {
|
|
24
|
+
URL2.Latest = () => `${URL2()}/getLatestQuiz`;
|
|
25
|
+
})(URL || (URL = {}));
|
|
19
26
|
((Fetch2) => {
|
|
20
27
|
const m_timestamp = z.object({ _seconds: z.required(z.number()), _nanoseconds: z.required(z.number()) }, { allowUnknown: true }).map(({ _seconds, _nanoseconds }) => new Date(_seconds * 1e3 + _nanoseconds / 1e6));
|
|
21
28
|
const m_question = z.object({ qTitle: z.required(z.string()), qAnswer: z.required(z.string()) }, { allowUnknown: true }).map(({ qTitle, qAnswer }) => ({ title: qTitle, answer: qAnswer }));
|
|
@@ -43,7 +50,7 @@ async function Fetch(options = {}) {
|
|
|
43
50
|
})
|
|
44
51
|
);
|
|
45
52
|
Fetch2.Options = (options = {}) => ({
|
|
46
|
-
url:
|
|
53
|
+
url: URL.Latest(),
|
|
47
54
|
parse: m_parse,
|
|
48
55
|
...options
|
|
49
56
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"name": "weekly-fifty",
|
|
6
6
|
"author": "Reuben Roessler",
|
|
7
7
|
"repository": "rroessler/npm.weekly-fifty",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "tsup ./source/index.ts --dts --format esm,cjs",
|
|
23
23
|
"// RELEASE //": "",
|
|
24
24
|
"release": "run-s build release:np",
|
|
25
|
-
"release:np": "np --no-tests --no-release-
|
|
25
|
+
"release:np": "np --no-tests --no-release-draft --message 'v%s'"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"myzod": "^1.12.1"
|