abstract-state-router
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -240,4 +240,7 @@ var StateState = require('./state-state') | ||
} | ||
stateProviderEmitter.stateIsActive = function stateIsActive(stateName) { | ||
return current.get().name.indexOf(stateName) === 0 | ||
stateProviderEmitter.stateIsActive = function stateIsActive(stateName, opts) { | ||
var currentState = current.get() | ||
return currentState.name.indexOf(stateName) === 0 && (typeof opts === 'undefined' || Object.keys(opts).every(function matches(key) { | ||
return opts[key] === currentState.parameters[key] | ||
})) | ||
} | ||
@@ -244,0 +247,0 @@ |
{ | ||
"name": "abstract-state-router", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "The basics of a client-side state router ala the AngularJS ui-router, but without any DOM interactions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -283,3 +283,3 @@ var test = require('tape') | ||
t.plan(4) | ||
t.plan(6) | ||
@@ -310,7 +310,10 @@ stateRouter.addState({ | ||
t.notOk(stateRouter.stateIsActive('parent.child1', { butts: 'no' }), 'shouldn\'t match wuth butts=no') | ||
t.ok(stateRouter.stateIsActive('parent.child1', { butts: 'yes' }), 'should match with butts=yes') | ||
t.end() | ||
}) | ||
stateRouter.go('parent.child1') | ||
stateRouter.go('parent.child1', { butts: 'yes' }) | ||
}) | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76294
2241