New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

can-type

Package Overview
Dependencies
Maintainers
4
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-type - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

test-ie.html

12

can-type-test.js

@@ -18,3 +18,5 @@ var canSymbol = require("can-symbol");

function isNaN(assert, result) {
assert.ok(Number.isNaN(result), "Is NaN value");
// result !== result is used because Number.isNaN doesn’t exist in IE11
// result !== result works because NaN is the only value not equal to itself in JS
assert.ok(result !== result, "Is NaN value");
}

@@ -145,3 +147,5 @@

QUnit.test("type.late(fn) takes a function to define the type later", function(assert) {
var theType = type.late(() => type.convert(Number));
var theType = type.late(function() {
return type.convert(Number);
});
var result = canReflect.convert("45", theType);

@@ -152,3 +156,5 @@ assert.equal(result, 45, "Defined late but then converted");

dev.devOnlyTest("type.late(fn) where the underlying type value is a builtin becomes a strict type", function(assert) {
var typeType = type.late(() => Number);
var typeType = type.late(function() {
return Number;
});
var result = canReflect.convert(45, typeType);

@@ -155,0 +161,0 @@ assert.equal(result, 45, "works with numbers");

@@ -10,4 +10,7 @@ var canReflect = require("can-reflect");

var primitives = new Map();
[Number, String, Boolean].forEach(function(Type) {
var typeString = Type.name.toLowerCase();
canReflect.each({
"boolean": Boolean,
"number": Number,
"string": String
}, function(Type, typeString) {
primitives.set(Type, {

@@ -112,3 +115,3 @@ isMember: function(val) {

function check(Type, val) {
throw new Error(`Type value ${typeof val === "string" ? '"' + val + '"' : val} is not of type ${canReflect.getName(Type)}.`);
throw new Error('Type value ' + typeof val === "string" ? '"' + val + '"' : val + ' is not of type ' + canReflect.getName(Type) + '.' );
}

@@ -115,0 +118,0 @@

{
"name": "can-type",
"version": "0.2.2",
"version": "0.2.3",
"description": "Type definitions",

@@ -15,3 +15,5 @@ "homepage": "https://canjs.com/doc/can-type.html",

},
"browserslist": "ie 11",
"scripts": {
"ci": "npm run test && node test-saucelabs.js",
"preversion": "npm test",

@@ -21,2 +23,3 @@ "postpublish": "git push --tags && git push",

"test": "npm run jshint && npm run testee",
"http-server": "http-server -p 3000 --silent",
"jshint": "jshint ./*.js --config",

@@ -38,2 +41,3 @@ "release:patch": "npm version patch && npm publish",

"can-test-helpers": "^1.1.4",
"http-server": "^0.11.1",
"jshint": "^2.9.1",

@@ -43,2 +47,3 @@ "steal": "^2.1.6",

"steal-tools": "^2.0.9",
"test-saucelabs": "0.0.6",
"testee": "^0.9.1"

@@ -45,0 +50,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc