static-type-js
Advanced tools
Comparing version 0.1.3 to 0.2.3
@@ -5,3 +5,3 @@ { | ||
"description": "Prototype inheritance and type system for js", | ||
"version": "0.1.3", | ||
"version": "0.2.3", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -322,3 +322,3 @@ describe('Typejs', function () { | ||
}); | ||
expect(message).toBe('"number" value: (1), is expected to be: "string" type.'); | ||
expect(message).toBe('TypeError key: username, value: "number" (1), is expected to be: "string" type.'); | ||
message = tryCatch(function () { | ||
@@ -332,11 +332,11 @@ us.username = null | ||
}); | ||
expect(message).toBe('"function" value: (function () { }), is expected to be: "string" type.'); | ||
expect(message).toBe('TypeError key: username, value: "function" (function () { }), is expected to be: "string" type.'); | ||
message = tryCatch(function () { | ||
us.username = new RegExp; | ||
}); | ||
expect(message).toBe('"regexp" value: (/(?:)/), is expected to be: "string" type.'); | ||
expect(message).toBe('TypeError key: username, value: "regexp" (/(?:)/), is expected to be: "string" type.'); | ||
message = tryCatch(function () { | ||
us.date = 1; | ||
}); | ||
expect(message).toBe('"number" value: (1), is expected to be: "date" type.'); | ||
expect(message).toBe('TypeError key: date, value: "number" (1), is expected to be: "date" type.'); | ||
@@ -398,3 +398,3 @@ message = tryCatch(function () { | ||
}); | ||
expect(message).toBe('"string" value: (test), is expected to be: "number" type.'); | ||
expect(message).toBe('TypeError key: one, value: "string" (test), is expected to be: "number" type.'); | ||
}); | ||
@@ -401,0 +401,0 @@ |
@@ -17,3 +17,3 @@ (function (root, factory) { | ||
if (!Object.preventExtensions) { | ||
Object.preventExtensions = Object.freeze = function() {}; // lte 8 to avoid try catch speed | ||
Object.preventExtensions = Object.freeze = function () {}; // lte 8 to avoid try catch speed | ||
} | ||
@@ -129,3 +129,3 @@ /** | ||
} else if (Type.isInitialized(nVal) && !Type.assert(type, nVal)) { | ||
throw new TypeError('"' + Type.getType(nVal) + '" value: (' + nVal + '), is expected to be: "' + type + '" type.'); | ||
throw new TypeError('TypeError key: ' + key + ', value: "' + Type.getType(nVal) + '" (' + nVal + '), is expected to be: "' + type + '" type.'); | ||
} | ||
@@ -132,0 +132,0 @@ this.__dynamic__[key] = nVal; |
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
31706