<commit_before>import { isFunction, isString, styleObjToCss, hashToClassName } from './util';

/** Global options
 *	@public
 *	@namespace options {Object}
 */
export default {

	/** If `true`, `prop` changes trigger synchronous component updates.
	 *	@name syncComponentUpdates
	 *	@type Boolean
	 *	@default true
	 */
	//syncComponentUpdates: true,

	/** Processes all created VNodes.
	 *	@param {VNode} vnode	A newly-created VNode to normalize/process
	 */
	vnode(n) {
		let attrs = n.attributes;
		if (!attrs || isFunction(n.nodeName)) return;

		// normalize className to class.
		let p = attrs.className;
		if (p) {
			attrs['class'] = p;
			delete attrs.className;
		}

		if (attrs['class']) normalize(attrs, 'class', hashToClassName);
		if (attrs.style) normalize(attrs, 'style', styleObjToCss);
	}
};


function normalize(obj, prop, fn) {
	let v = obj[prop];
	if (v && !isString(v)) {
		obj[prop] = fn(v);<commit_msg>Fix (needs a test) for `null`/`undefined` value when using `className` compat alias. Fixes #181<commit_after>import { isFunction, isString, styleObjToCss, hashToClassName } from './util';

/** Global options
 *	@public
 *	@namespace options {Object}
 */
export default {

	/** If `true`, `prop` changes trigger synchronous component updates.
	 *	@name syncComponentUpdates
	 *	@type Boolean
	 *	@default true
	 */
	//syncComponentUpdates: true,

	/** Processes all created VNodes.
	 *	@param {VNode} vnode	A newly-created VNode to normalize/process
	 */
	vnode(n) {
		let attrs = n.attributes;
		if (!attrs || isFunction(n.nodeName)) return;

		// normalize className to class.
		if ('className' in attrs) {
			attrs['class'] = attrs.className;
			delete attrs.className;
		}

		if (attrs['class']) normalize(attrs, 'class', hashToClassName);
		if (attrs.style) normalize(attrs, 'style', styleObjToCss);
	}
};


function normalize(obj, prop, fn) {
	let v = obj[prop];
	if (v && !isString(v)) {
		obj[prop] = fn(v);
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.0015463917525773195, 'mean_word_length': 3.951530612244898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2524243', 'n_tokens_mistral': 693, 'n_tokens_neox': 637, 'n_words': 183}