intertype
Advanced tools
Comparing version 0.0.2 to 0.0.3
// Generated by CoffeeScript 2.3.2 | ||
(function() { | ||
'use strict'; | ||
var CND, alert, assign, badge, cnd_by_ity, debug, flatten, get_rprs_of_tprs, help, info, isa, isa_type, ity_by_cnd, jr, rpr, urge, warn, whisper, | ||
var CND, _xrpr, alert, assign, badge, cnd_by_ity, debug, flatten, get_rprs_of_tprs, help, info, inspect, isa, isa_type, ity_by_cnd, jr, rpr, urge, warn, whisper, xrpr, | ||
indexOf = [].indexOf, | ||
@@ -33,2 +33,19 @@ modulo = function(a, b) { return (+a % (b = +b) + b) % b; }; | ||
//........................................................................................................... | ||
({inspect} = require('util')); | ||
_xrpr = function(x) { | ||
return inspect(x, { | ||
colors: true, | ||
breakLength: 2e308, | ||
maxArrayLength: 2e308, | ||
depth: 2e308 | ||
}); | ||
}; | ||
xrpr = function(x) { | ||
return (_xrpr(x)).slice(0, 501); | ||
}; | ||
//........................................................................................................... | ||
isa_type = Symbol('isa_type'); | ||
@@ -135,3 +152,3 @@ | ||
} else { | ||
message = `µ63154 expected a ${type}, got a ${CND.type_of(x)}${srpr_of_tprs} (value: ${rpr(x)})`; | ||
message = `µ63154 expected a ${type}, got a ${CND.type_of(x)}${srpr_of_tprs} (value: ${xrpr(x)})`; | ||
} | ||
@@ -190,3 +207,3 @@ throw new Error(prv_message + message); | ||
({rpr_of_tprs, srpr_of_tprs} = get_rprs_of_tprs(tprs)); | ||
throw new Error(`µ11111 not a valid ${type}${srpr_of_tprs}: ${rpr(x)}`); | ||
throw new Error(`µ11111 not a valid ${type}${srpr_of_tprs}: ${xrpr(x)}`); | ||
} | ||
@@ -193,0 +210,0 @@ return R; |
@@ -216,2 +216,121 @@ // Generated by CoffeeScript 2.3.2 | ||
//----------------------------------------------------------------------------------------------------------- | ||
this["nasty error message, tamed"] = function(T, done) { | ||
var error; | ||
try { | ||
isa.validate.text({ isa: 'disk', path: 'dsk0', size: 1000000, free: -5572, files: [ { path: | ||
'/media/somewhere/foobar/lib/main.js', size: 11282 }, { path: '/media/somewhere/foobar/lib/main.js.map', | ||
size: 18962 }, { path: '/media/somewhere/foobar/node_modules/unset-value/index.js', size: 756 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/LICENSE', size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/index.js', size: 426 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/LICENSE', size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js', | ||
size: 317 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE', | ||
size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json', | ||
size: 2120 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md', | ||
size: 2999 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/package.json', size: 2372 }, { | ||
path: '/media/somewhere/foobar/node_modules/unset-value/node_modules/has-value/README.md', size: 3244 }, { | ||
path: '/media/somewhere/foobar/node_modules/unset-value/node_modules/has-values/index.js', size: 615 }, { | ||
path: '/media/somewhere/foobar/node_modules/unset-value/node_modules/has-values/LICENSE', size: 1088 }, { | ||
path: '/media/somewhere/foobar/node_modules/unset-value/node_modules/has-values/package.json', size: 2294 | ||
}, { path: '/media/somewhere/foobar/node_modules/unset-value/node_modules/has-values/README.md', size: | ||
2821 }, { path: '/media/somewhere/foobar/node_modules/unset-value/package.json', size: 2459 }, { path: | ||
'/media/somewhere/foobar/node_modules/unset-value/README.md', size: 5239 }, { path: | ||
'/media/somewhere/foobar/node_modules/fragment-cache/index.js', size: 3075 }, { path: | ||
'/media/somewhere/foobar/node_modules/fragment-cache/LICENSE', size: 1087 }, { path: | ||
'/media/somewhere/foobar/node_modules/fragment-cache/package.json', size: 2094 }, { path: | ||
'/media/somewhere/foobar/node_modules/fragment-cache/README.md', size: 4585 }, { path: | ||
'/media/somewhere/foobar/node_modules/map-visit/index.js', size: 967 }, { path: | ||
'/media/somewhere/foobar/node_modules/map-visit/LICENSE', size: 1087 }, { path: | ||
'/media/somewhere/foobar/node_modules/map-visit/package.json', size: 2446 }, { path: | ||
'/media/somewhere/foobar/node_modules/map-visit/README.md', size: 4942 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/test/index.js', size: 983 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/index.js', size: 674 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/LICENSE', size: 1071 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/package.json', size: 1393 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/README.md', size: 29 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/.npmignore', size: 42 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-tee/.travis.yml', size: 43 }, { path: | ||
'/media/somewhere/foobar/node_modules/static-extend/index.js', size: 2271 }, { path: | ||
'/media/somewhere/foobar/node_modules/static-extend/LICENSE', size: 1083 }, { path: | ||
'/media/somewhere/foobar/node_modules/static-extend/node_modules/define-property/index.js', size: 753 }, { | ||
path: '/media/somewhere/foobar/node_modules/static-extend/node_modules/define-property/LICENSE', size: | ||
1083 }, { path: | ||
'/media/somewhere/foobar/node_modules/static-extend/node_modules/define-property/package.json', size: 1936 | ||
}, { path: '/media/somewhere/foobar/node_modules/static-extend/node_modules/define-property/README.md', | ||
size: 2413 }, { path: '/media/somewhere/foobar/node_modules/static-extend/package.json', size: 2265 }, { | ||
path: '/media/somewhere/foobar/node_modules/inherits/inherits_browser.js', size: 672 }, { path: | ||
'/media/somewhere/foobar/node_modules/inherits/LICENSE', size: 749 }, { path: | ||
'/media/somewhere/foobar/node_modules/inherits/package.json', size: 1475 }, { path: | ||
'/media/somewhere/foobar/node_modules/inherits/README.md', size: 1625 }, { path: | ||
'/media/somewhere/foobar/node_modules/inherits/inherits.js', size: 192 }, { path: | ||
'/media/somewhere/foobar/node_modules/object.pick/index.js', size: 630 }, { path: | ||
'/media/somewhere/foobar/node_modules/object.pick/LICENSE', size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/object.pick/package.json', size: 2102 }, { path: | ||
'/media/somewhere/foobar/node_modules/object.pick/README.md', size: 3435 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/index.js', size: 23853 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/lib/compilers.js', size: 1827 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/lib/parsers.js', size: 2027 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/lib/.DS_Store', size: 6148 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/lib/cache.js', size: 52 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/lib/utils.js', size: 7258 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/LICENSE', size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/CHANGELOG.md', size: 1129 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/package.json', size: 4586 }, { path: | ||
'/media/somewhere/foobar/node_modules/micromatch/README.md', size: 38227 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/index.js', size: 22642 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/lib/compilers.js', size: 8449 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/lib/parsers.js', size: 7627 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/lib/cache.js', size: 52 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/lib/utils.js', size: 8808 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/LICENSE', size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/CHANGELOG.md', size: 1490 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/package.json', size: 3707 }, { path: | ||
'/media/somewhere/foobar/node_modules/nanomatch/README.md', size: 33388 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/lib/index.js', size: 6555 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/lib/util.js', size: 2616 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/lib/sets.js', size: 2230 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/lib/positions.js', size: 367 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/lib/types.js', size: 166 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/LICENSE', size: 1061 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/package.json', size: 1603 }, { path: | ||
'/media/somewhere/foobar/node_modules/ret/README.md', size: 4241 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/test/index.js', size: 4176 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/test/order.js', size: 480 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/index.js', size: 1534 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/LICENSE', size: 1071 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/package.json', size: 1543 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/README.md', size: 951 }, { path: | ||
'/media/somewhere/foobar/node_modules/pull-paramap/.travis.yml', size: 54 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/glob.js', size: 19433 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/changelog.md', size: 1430 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/LICENSE', size: 765 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/package.json', size: 1922 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/README.md', size: 14664 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/sync.js', size: 12002 }, { path: | ||
'/media/somewhere/foobar/node_modules/glob/common.js', size: 6167 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/index.js', size: 8172 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/lib/compilers.js', size: 4001 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/lib/parsers.js', size: 3172 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/lib/.DS_Store', size: 6148 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/lib/utils.js', size: 1274 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/lib/extglob.js', size: 1735 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/changelog.md', size: 589 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/LICENSE', size: 1088 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/node_modules/extend-shallow/index.js', size: 576 }, { path: | ||
'/media/somewhere/foobar/node_modules/extglob/node_modules/extend-shallow/LICENSE', size: 1088 }, ] }); | ||
} catch (error1) { | ||
error = error1; | ||
T.ok((error.message.match(/not a valid text:/)) != null); | ||
} | ||
if (error == null) { | ||
T.fail("no error raised"); | ||
} | ||
return done(); | ||
}; | ||
//########################################################################################################### | ||
@@ -223,2 +342,3 @@ if (module.parent == null) { | ||
// test @[ "multiple tests" ] | ||
// test @[ "nasty error message, tamed" ] | ||
@@ -225,0 +345,0 @@ }).call(this); |
{ | ||
"name": "intertype", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A JavaScript typechecker", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
196673
1223