Don't create when instanceof (#201)

This commit is contained in:
Jaco Greeff
2018-10-04 14:24:01 +02:00
committed by GitHub
parent c7970c231a
commit 59e97832a3
+3 -1
View File
@@ -143,5 +143,7 @@ export default function createType (type: Text | string, value?: any): Base {
getTypeDef(type)
);
return new Type(value);
return value instanceof Type
? value
: new Type(value);
}