@linebridge/bootloader 1.0.0 → 1.0.2

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/globals.cjs CHANGED
@@ -1,51 +1 @@
1
- const { webcrypto: crypto } = require("node:crypto")
2
- const { Buffer } = require("node:buffer")
3
-
4
- global.isProduction = process.env.NODE_ENV === "production"
5
-
6
- global.b64Decode = (data) => {
7
- return Buffer.from(data, "base64").toString("utf-8")
8
- }
9
- global.b64Encode = (data) => {
10
- return Buffer.from(data, "utf-8").toString("base64")
11
- }
12
-
13
- global.nanoid = (t = 21) =>
14
- crypto
15
- .getRandomValues(new Uint8Array(t))
16
- .reduce(
17
- (t, e) =>
18
- (t +=
19
- (e &= 63) < 36
20
- ? e.toString(36)
21
- : e < 62
22
- ? (e - 26).toString(36).toUpperCase()
23
- : e > 62
24
- ? "-"
25
- : "_"),
26
- "",
27
- )
28
-
29
- Array.prototype.updateFromObjectKeys = function (obj) {
30
- this.forEach((value, index) => {
31
- if (obj[value] !== undefined) {
32
- this[index] = obj[value]
33
- }
34
- })
35
-
36
- return this
37
- }
38
-
39
- global.ToBoolean = (value) => {
40
- if (typeof value === "boolean") {
41
- return value
42
- }
43
-
44
- if (typeof value === "string") {
45
- return value.toLowerCase() === "true"
46
- }
47
-
48
- return false
49
- }
50
-
51
1
  global.Boot = require("./boot_function.cjs")
package/index.cjs ADDED
@@ -0,0 +1,5 @@
1
+ const BootFN = require("./boot_function.cjs")
2
+
3
+ global.Boot = BootFN
4
+
5
+ module.exports = BootFN
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import BootFN from "./boot_function.cjs"
2
+
3
+ declare function Boot(server: any): Promise<void>
4
+
5
+ declare global {
6
+ var Boot: Boot
7
+ }
8
+
9
+ export default Boot
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@linebridge/bootloader",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
+ "author": "ragestudio",
5
+ "license": "MIT",
6
+ "description": "Bootloader for Linebridge",
4
7
  "type": "commonjs",
5
- "main": "./run.cjs",
8
+ "main": "./index.cjs",
9
+ "types": "./index.d.ts",
6
10
  "private": false,
7
11
  "publishConfig": {
8
12
  "access": "public"
@@ -10,6 +14,13 @@
10
14
  "bin": {
11
15
  "linebridge-boot": "./bin"
12
16
  },
17
+ "exports": {
18
+ ".": {
19
+ "import": "./index.cjs",
20
+ "require": "./index.cjs",
21
+ "types": "./index.d.ts"
22
+ }
23
+ },
13
24
  "dependencies": {
14
25
  "chokidar": "^5.0.0",
15
26
  "dotenv": "^17.4.2",
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "http://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ESNext",
5
+ "module": "nodenext",
6
+ "moduleResolution": "nodenext",
7
+ "allowSyntheticDefaultImports": true,
8
+ "noEmit": true,
9
+ "strict": false,
10
+ "noImplicitAny": false,
11
+ "allowJs": true,
12
+ "skipLibCheck": true,
13
+ "esModuleInterop": true,
14
+ },
15
+ "files": ["./index.cjs", "./index.d.ts"],
16
+ }