'use strict';

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

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

	domjs.ns.input = function (attrs) {
		if (attrs && (attrs.dbjs != null)) {
			return validObservableValue(attrs.dbjs)
				.toDOMInput(domjs.document, attrs).dom;
		}
		return input.apply(this, arguments);
	};
};

@@ -12,21 +12,18 @@
 ';%0A%0Avar 
-valid
+is
 Observab
@@ -58,21 +58,18 @@
 e-value/
-valid
+is
 -observa
@@ -79,16 +79,69 @@
 -value')
+%0A  , isDbjsType        = require('dbjs/is-dbjs-type')
 ;%0A%0Amodul
@@ -284,20 +284,15 @@
 %0A%09%09%09
-return valid
+if (!is
 Obse
@@ -318,13 +318,137 @@
 bjs)
-%0A%09%09%09%09
+ && !isDbjsType(attrs.dbjs)) %7B%0A%09%09%09%09throw new TypeError(attrs.dbjs + %22 is not dbjs observable or type%22);%0A%09%09%09%7D%0A%09%09%09return attrs.dbjs
 .toD

Allow dbjs types as input objects