catto.js 0.0.4 → 0.0.6

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 CHANGED
@@ -3,6 +3,7 @@
3
3
  ![Build](https://github.com/BoryaGames/catto.js/actions/workflows/npm-publish.yml/badge.svg)
4
4
  ![Contributors](https://img.shields.io/github/contributors/BoryaGames/catto.js)
5
5
  ![Chat on Discord](https://img.shields.io/discord/916772281747931198?logo=discord)
6
+
6
7
  ✨ catto.js is a new version of universal catto package, which allows easy web server making, random generation and Discord authorization. ✨
7
8
  ## Features
8
9
  - Creating web server.
@@ -12,8 +13,7 @@
12
13
  - Authorizing users using Discord API OAuth2.
13
14
  - Generating random numbers and booleans.
14
15
  - Easy removing elements from Arrays.
15
- And of course Dillinger itself is open source with a [public repository][dill]
16
- on GitHub.
16
+
17
17
  ## Installation
18
18
  ```sh
19
19
  npm i catto.js
package/Server.js CHANGED
@@ -1,5 +1,3 @@
1
- /** @module Server */
2
-
3
1
  var events = require("events");
4
2
  var express = require("express");
5
3
  var expressWs = require("express-ws");
@@ -15,12 +13,6 @@ var FileStore = require("session-file-store")(session);
15
13
  if (typeof EventEmitter !== "undefined") {} else {
16
14
  var { EventEmitter } = events;
17
15
  }
18
-
19
- /**
20
- * Server.
21
- * @class
22
- * @param {object} options
23
- */
24
16
  class Server extends EventEmitter {
25
17
  constructor(options) {
26
18
  super();
@@ -137,8 +129,12 @@ class Server extends EventEmitter {
137
129
  this.app.ws(...args);
138
130
  return this;
139
131
  }
140
- static(folder) {
141
- this.app.use(express.static(path.join(__dirname,"..","..",folder)));
132
+ static(folder, path) {
133
+ if (path) {
134
+ this.app.use(path, express.static(path.join(__dirname,"..","..",folder)));
135
+ } else {
136
+ this.app.use(express.static(path.join(__dirname,"..","..",folder)));
137
+ }
142
138
  return this;
143
139
  }
144
140
  static fa(text) {
@@ -148,4 +144,4 @@ class Server extends EventEmitter {
148
144
  }
149
145
  }
150
146
 
151
- module.exports = Server;
147
+ module.exports = Server;
package/User.js CHANGED
@@ -47,7 +47,7 @@ module.exports = class {
47
47
  }
48
48
  get badges() {
49
49
  var i = 23;
50
- var p = this.options.badges;
50
+ var p = this.options.flags || this.options.public_flags;
51
51
  var f = [];
52
52
  while (--i > -1) {
53
53
  if (![21, 20, 15, 13, 12, 11, 5, 4].includes(i) && p >= (1 << i)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {