Skip to content

Commit 383d298

Browse files
new project name --> PuddySql
1 parent d925a6f commit 383d298

File tree

12 files changed

+290
-100
lines changed

12 files changed

+290
-100
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# TinySQL
1+
# PuddySql

package-lock.json

Lines changed: 106 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "tinysql",
2+
"name": "puddysql",
33
"description": "",
44
"version": "1.0.0-beta",
55
"main": "./dist/index.cjs",
@@ -16,10 +16,12 @@
1616
"author": "Yasmin Seidel (JasminDreasond)",
1717
"license": "GPL-3.0-only",
1818
"dependencies": {
19+
"@types/pg": "^8.11.14",
20+
"@types/sqlite3": "^3.1.11",
1921
"pg": "^8.14.1",
2022
"sqlite": "^5.1.1",
2123
"sqlite3": "^5.1.7",
22-
"tiny-essentials": "^1.0.0"
24+
"tiny-essentials": "^1.7.1"
2325
},
2426
"keywords": [],
2527
"scripts": {

src/Events.mjs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* List of event names used by PuddySql in the EventEmitter.
3+
* Each key maps to its string identifier.
4+
*/
5+
class PuddySqlEvents {
6+
/**
7+
* This class is not meant to be instantiated.
8+
*
9+
* TinyOlmEvents is a static-only class. All its members should be accessed directly through the class.
10+
*
11+
* @throws {Error} Always throws an error saying you can't summon it like a tiny pudding.
12+
*/
13+
constructor() {
14+
throw new Error(
15+
"Oops! PuddySqlEvents isn't something you can summon like a tiny pudding. Just use it statically 🍮 :3",
16+
);
17+
}
18+
19+
static Test = 'Test';
20+
21+
/**
22+
* @returns {string[]}
23+
*/
24+
static get all() {
25+
const items = [];
26+
for (const key of Object.getOwnPropertyNames(this)) {
27+
// Skip getters or non-string static properties
28+
if (key !== 'name') {
29+
const descriptor = Object.getOwnPropertyDescriptor(this, key);
30+
if (descriptor && typeof descriptor.value === 'string') items.push(descriptor.value);
31+
}
32+
}
33+
return items;
34+
}
35+
36+
/**
37+
* @param {string} event
38+
* @returns {boolean}
39+
*/
40+
static isValid(event) {
41+
return this.all.includes(event);
42+
}
43+
}
44+
45+
export default PuddySqlEvents;

0 commit comments

Comments
 (0)