mqtt-pattern 2.0.0 → 2.1.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.
Files changed (3) hide show
  1. package/index.d.ts +2 -0
  2. package/package.json +4 -4
  3. package/test.ts +2 -1
package/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type { MqttParameters, FillTopic, CleanTopic } from "./parameters";
2
2
  import type { F } from "ts-toolbelt";
3
3
 
4
+ export type { MqttParameters } from './parameters'
5
+
4
6
  /**
5
7
  * Extract parameters from a topic based on the pattern provided
6
8
  * @param pattern Pattern to match against
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mqtt-pattern",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Fast library for matching MQTT patterns with named wildcards",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -26,10 +26,10 @@
26
26
  "devDependencies": {
27
27
  "eslint": "^3.19.0",
28
28
  "eslint-plugin-node": "^4.2.2",
29
- "tape": "^4.6.3",
30
- "ts-toolbelt": "^9.6.0"
29
+ "tape": "^4.6.3"
31
30
  },
32
31
  "dependencies": {
33
- "mqtt-match": "^1.0.2"
32
+ "mqtt-match": "^1.0.2",
33
+ "ts-toolbelt": "^9.6.0"
34
34
  }
35
35
  }
package/test.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { clean, exec, extract, fill, matches } from "./index";
1
+ import { clean, exec, extract, fill, matches, MqttParameters } from "./index";
2
2
  import { Test } from "ts-toolbelt";
3
3
  import test from "node:test";
4
4
  // Type Testing
@@ -9,6 +9,7 @@ const { check, checks } = Test;
9
9
  const execv = exec("foo/bar/+baz", "foo/bar/test");
10
10
  checks([
11
11
  check<typeof execv, { baz: string } | null, Test.Pass>(),
12
+ check<typeof execv, MqttParameters<"foo/bar/+baz"> | null, Test.Pass>(),
12
13
  check<typeof execv, { baz: string[] } | null, Test.Fail>(),
13
14
  ]);
14
15