statebus 6.1.29 → 6.1.30
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 +1 -1
- package/statebus.js +5 -5
- package/extras/esm-test.jsm +0 -3
package/package.json
CHANGED
package/statebus.js
CHANGED
|
@@ -663,7 +663,7 @@
|
|
|
663
663
|
|
|
664
664
|
function pattern_matcher (pattern) {
|
|
665
665
|
var param_names = []
|
|
666
|
-
var regex = new RegExp('^' + pattern.replace(/(?<=^|\/):[^/()]+|\*/g, match
|
|
666
|
+
var regex = new RegExp('^' + pattern.replace(/(?<=^|\/):[^/()]+|\*/g, function (match) {
|
|
667
667
|
// Replace * with .*
|
|
668
668
|
if (match === '*') return '.*'
|
|
669
669
|
|
|
@@ -672,11 +672,11 @@
|
|
|
672
672
|
return '([^/]+)'
|
|
673
673
|
}) + '$')
|
|
674
674
|
|
|
675
|
-
return path
|
|
675
|
+
return function (path) {
|
|
676
676
|
var match = path.match(regex)
|
|
677
677
|
if (!match) return null
|
|
678
678
|
var params = {}
|
|
679
|
-
match.slice(1).forEach((val, i)
|
|
679
|
+
match.slice(1).forEach(function (val, i) { return params[param_names[i]] = val} )
|
|
680
680
|
return params
|
|
681
681
|
}
|
|
682
682
|
}
|
|
@@ -856,8 +856,8 @@
|
|
|
856
856
|
// Delete empty parts (this ensures that empty strings
|
|
857
857
|
// will properly result in empty KSON, and allows trailing
|
|
858
858
|
// commas)
|
|
859
|
-
.filter(part
|
|
860
|
-
.forEach(part
|
|
859
|
+
.filter(function (part) { return part.length })
|
|
860
|
+
.forEach(function (part) {
|
|
861
861
|
// If the part has a comma, its a key:value, otherwise
|
|
862
862
|
// it's just a singleton
|
|
863
863
|
var [k, v] = split_once(part, ":")
|
package/extras/esm-test.jsm
DELETED