Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getVal(rawItem, prop) {
const item = ko.unwrap(rawItem);
return item && prop ? ko.unwrap(item[prop]) : item;
}
() => {
const options = ko.unwrap(valueAccessor());
if (!isRouteOptions(options)) {
element.href = options;
return;
}
const $app = bindingContext.$root as App,
href = $app.router.getRoute(options.route, ko.toJS(options.params));
element.href = href;
},
null,
() => {
let options = ko.unwrap(valueAccessor());
if (!isRouteOptions(options)) {
options = {
route: options
} as IRouteOptions;
}
const $app = bindingContext.$root as App,
href = $app.router.getRoute(options.route, ko.toJS(options.params));
element.href = href;
},
null,
return function() {
const topicDetails = ko.unwrap(valueAccessor());
if (typeof topicDetails === 'string') {
huePubSub.publish(topicDetails);
} else if (typeof topicDetails === 'object') {
const keys = Object.keys(topicDetails);
if (keys.length === 1) {
huePubSub.publish(keys[0], topicDetails[keys[0]]);
}
}
};
},