ts-interface-checker
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -504,3 +504,12 @@ "use strict"; | ||
never: new BasicType(function (v) { return false; }, "is unexpected"), | ||
Date: new BasicType(getIsNativeChecker("[object Date]"), "is not a Date"), | ||
RegExp: new BasicType(getIsNativeChecker("[object RegExp]"), "is not a RegExp"), | ||
}; | ||
// This approach for checking native object types mirrors that of lodash. Its advantage over | ||
// `isinstance` is that it can still return true for native objects created in different JS | ||
// execution environments. | ||
var nativeToString = Object.prototype.toString; | ||
function getIsNativeChecker(tag) { | ||
return function (v) { return typeof v === "object" && v && nativeToString.call(v) === tag; }; | ||
} | ||
if (typeof Buffer !== "undefined") { | ||
@@ -507,0 +516,0 @@ exports.basicTypes.Buffer = new BasicType(function (v) { return Buffer.isBuffer(v); }, "is not a Buffer"); |
{ | ||
"name": "ts-interface-checker", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Runtime library to validate data against TypeScript interfaces", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60216
1190