@eleven-am/pondsocket 0.1.1 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
@@ -8,6 +8,12 @@ export interface Resolver {
8
8
 
9
9
  export declare class BaseClass {
10
10
 
11
+ /**
12
+ * @desc checks if the pattern is matchable
13
+ * @param pattern - the pattern to check
14
+ */
15
+ protected static isPatternMatchable(pattern: string | RegExp): boolean;
16
+
11
17
  /**
12
18
  * @desc compares string to string | regex
13
19
  * @param string - the string to compare to the pattern
@@ -34,4 +40,14 @@ export declare class BaseClass {
34
40
  * @param obj2 - the second object
35
41
  */
36
42
  areEqual<T>(obj1: T, obj2: T): boolean;
43
+
44
+ /**
45
+ * @desc Creates an object from the params of a path
46
+ * @param path - the path to create the object from
47
+ *
48
+ * @example
49
+ * /api/id?name=abc should return { name: 'abc' }
50
+ * /api/id?name=abc&age=123 should return { name: 'abc', age: '123' }
51
+ */
52
+ protected _parseQueries(path: string): default_t<string>;
37
53
  }
@@ -10,6 +10,11 @@ export declare class Broadcast<T, A> {
10
10
  */
11
11
  subscribe(handler: (data: T) => A): Subscription;
12
12
 
13
+ /**
14
+ * @desc Gets the number of subscribers
15
+ */
16
+ public get subscriberCount(): number;
17
+
13
18
  /**
14
19
  * @desc Publish to the broadcast
15
20
  * @param data - The data to publish
@@ -20,6 +20,12 @@ class Broadcast {
20
20
  }
21
21
  };
22
22
  }
23
+ /**
24
+ * @desc Gets the number of subscribers
25
+ */
26
+ get subscriberCount() {
27
+ return this._subscribers.size;
28
+ }
23
29
  /**
24
30
  * @desc Publish to the broadcast
25
31
  * @param data - The data to publish