Comparing version 1.0.0-pre.1 to 1.0.0-pre.2
@@ -5,2 +5,3 @@ var canSymbol = require("can-symbol"); | ||
var QUnit = require("steal-qunit"); | ||
var dev = require("can-test-helpers").dev; | ||
@@ -48,10 +49,2 @@ QUnit.module('can-type - Type methods'); | ||
var matrix = { | ||
check: { | ||
check: strictEqual, | ||
throws: throwsBecauseOfWrongType | ||
}, | ||
maybe: { | ||
check: strictEqual, | ||
throws: throwsBecauseOfWrongType | ||
}, | ||
convert: { | ||
@@ -65,2 +58,16 @@ check: equal | ||
// type checking should not throw in production | ||
if(process.env.NODE_ENV !== 'production') { | ||
canReflect.assignMap(matrix, { | ||
check: { | ||
check: strictEqual, | ||
throws: throwsBecauseOfWrongType | ||
}, | ||
maybe: { | ||
check: strictEqual, | ||
throws: throwsBecauseOfWrongType | ||
} | ||
}); | ||
} | ||
var dateAsNumber = new Date(1815, 11, 10).getTime(); | ||
@@ -145,3 +152,3 @@ | ||
QUnit.test("type.late(fn) where the underlying type value is a builtin becomes a strict type", function(assert) { | ||
dev.devOnlyTest("type.late(fn) where the underlying type value is a builtin becomes a strict type", function(assert) { | ||
var typeType = type.late(() => Number); | ||
@@ -155,3 +162,3 @@ var result = canReflect.convert(45, typeType); | ||
} catch(err) { | ||
assert.ok(err, "Got an error becomes it is strict"); | ||
assert.ok(err, "Got an error because it is strict"); | ||
} | ||
@@ -158,0 +165,0 @@ }); |
@@ -165,2 +165,8 @@ var canReflect = require("can-reflect"); | ||
// type checking should not throw in production | ||
if(process.env.NODE_ENV === 'production') { | ||
exports.check = exports.convert; | ||
exports.maybe = exports.maybeConvert; | ||
} | ||
exports.Any = Any; | ||
@@ -167,0 +173,0 @@ exports.late = late; |
{ | ||
"name": "can-type", | ||
"version": "1.0.0-pre.1", | ||
"version": "1.0.0-pre.2", | ||
"description": "Type definitions", | ||
@@ -36,2 +36,3 @@ "homepage": "https://canjs.com/doc/can-type.html", | ||
"devDependencies": { | ||
"can-test-helpers": "^1.1.4", | ||
"jshint": "^2.9.1", | ||
@@ -38,0 +39,0 @@ "steal": "^2.1.6", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
31536
337
6
2