<commit_before>'use strict';

var validObservableValue = require('observable-value/valid-observable-value');

module.exports = function (domjs) {
	var input = domjs.ns.input;

	return (domjs.ns.field = function (attrs) {
		if (attrs && (attrs.dbjs != null)) {
			return validObservableValue(attrs.dbjs)
				.toDOMInputComponent(domjs.document, attrs).dom;
		}
		return input.apply(this, arguments);
	});
};
<commit_msg>Support field for dbjs Type input<commit_after>'use strict';

var isObservableValue = require('observable-value/is-observable-value')
  , isDbjsType        = require('dbjs/is-dbjs-type');

module.exports = function (domjs) {
	var input = domjs.ns.input;

	return (domjs.ns.field = function (attrs) {
		var isType;
		if (attrs && (attrs.dbjs != null)) {
			if (!isObservableValue(attrs.dbjs)) {
				isType = isDbjsType(attrs.dbjs);
				if (!isType) throw new TypeError(attrs.dbjs + " is not dbjs observable or type");
			}
			return attrs.dbjs.toDOMInputComponent(domjs.document, attrs).dom;
		}
		return input.apply(this, arguments);
	});
};

{'fraction_non_alphanumeric': 0.14797360980207352, 'fraction_numerical': 0.0, 'mean_word_length': 4.257425742574258, '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': '3324724', 'n_tokens_mistral': 388, 'n_tokens_neox': 363, 'n_words': 75}