brain-implosion-energy 1.0.0
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/README.md +3 -0
- package/index.mts +64 -0
- package/package.json +16 -0
package/README.md
ADDED
package/index.mts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* About the package
|
|
3
|
+
*/
|
|
4
|
+
export function about() {
|
|
5
|
+
console.log([
|
|
6
|
+
"INFO ABOUT brain-implosion-energy:",
|
|
7
|
+
"A joke package cuz why not?",
|
|
8
|
+
"i really don't have a desc for this"
|
|
9
|
+
].join("\n"))
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A can of Brain Implosion Energy!
|
|
14
|
+
*/
|
|
15
|
+
export class Can<T> {
|
|
16
|
+
/**
|
|
17
|
+
* The content inside the can.
|
|
18
|
+
*/
|
|
19
|
+
protected content: T[];
|
|
20
|
+
constructor(c: T[] = []) {
|
|
21
|
+
this.content = c
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Please do not the drink.
|
|
25
|
+
*/
|
|
26
|
+
drink(): never {
|
|
27
|
+
throw new Error("TOO MUCH CAFFEINE.")
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Please do not the drink.
|
|
31
|
+
*/
|
|
32
|
+
dr = this.drink
|
|
33
|
+
/**
|
|
34
|
+
* Saves a object to a index
|
|
35
|
+
* @param c The object
|
|
36
|
+
* @param idx The index
|
|
37
|
+
*/
|
|
38
|
+
save(idx: number, ...c: T[]) {
|
|
39
|
+
if (this.content[idx]) {
|
|
40
|
+
this.content.splice(idx, 1, ...c)
|
|
41
|
+
} else {
|
|
42
|
+
this.content.splice(idx, 0, ...c)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Loads a thing from a index
|
|
47
|
+
* @param idx The index
|
|
48
|
+
* @returns A object
|
|
49
|
+
*/
|
|
50
|
+
load(idx: number){
|
|
51
|
+
return this.content[idx]
|
|
52
|
+
}
|
|
53
|
+
static aboutBIE = about
|
|
54
|
+
/**
|
|
55
|
+
* Generates a new can!
|
|
56
|
+
* @param c
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
static of<A>(...c: A[]){
|
|
60
|
+
return new Can<A>(c)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default about
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "brain-implosion-energy",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "10,000 packages of unutility!",
|
|
5
|
+
"main": "index.mts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "^25.5.2"
|
|
15
|
+
}
|
|
16
|
+
}
|