KOSASIH / SilkRoad

Found shorthand type coercions JS-0066
Anti-pattern
Minor
8 months agoa year old
3193	
3194			if (templateName === 'option' || templateName === 'item') {
3195				value = hash_key(data[self.settings.valueField]);
3196				cache = !!value;3197			}
3198	
3199			// pull markup from cache if it exists
use Boolean(self.settings.openOnFocus) instead
1731			if (!self.$activeItems.length) {
1732				self.showInput();
1733				self.setActiveItem(null);
1734				self.refreshOptions(!!self.settings.openOnFocus);1735			}
1736	
1737			self.refreshState();
 822	 * @returns {string}
 823	 */
 824	var escape_replace = function(str) {
 825		return (str + '').replace(/\$/g, '$$$$'); 826	};
 827	
 828	var hook = {};
 808	 * @returns {string}
 809	 */
 810	var escape_html = function(str) {
 811		return (str + '') 812			.replace(/&/g, '&')
 813			.replace(/</g, '&lt;')
 814			.replace(/>/g, '&gt;')
 798	var hash_key = function(value) {
 799		if (typeof value === 'undefined' || value === null) return null;
 800		if (typeof value === 'boolean') return value ? '1' : '0';
 801		return value + ''; 802	};
 803	
 804	/**