Comparing version 0.0.2 to 0.0.3
// Generated by CoffeeScript 1.9.2 | ||
/*! Nwang 0.0.2 //// MIT Licence //// http://nwang.richplastow.com/ */ | ||
/*! Nwang 0.0.3 //// MIT Licence //// http://nwang.richplastow.com/ */ | ||
@@ -10,3 +10,3 @@ (function() { | ||
ªV = '0.0.2'; | ||
ªV = '0.0.3'; | ||
@@ -98,7 +98,8 @@ ªA = 'array'; | ||
Main.prototype.sf3 = function(x) { | ||
var tx, u; | ||
var M, tx, u; | ||
M = '/nwang/src/class-main.litcoffee:Main:sf3()\n '; | ||
tx = typeof x; | ||
if (ªN === tx) { | ||
if (-10000 > x) { | ||
throw RangeError(this.C + ":sf3()\n `x` is < -10000"); | ||
throw RangeError(M + "`x` is < -10000"); | ||
} | ||
@@ -139,5 +140,5 @@ if (-1000 > x) { | ||
if (x !== x) { | ||
throw RangeError(this.C + ":sf3()\n `x` is not a number"); | ||
throw RangeError(M + "`x` is not a number"); | ||
} | ||
throw RangeError(this.C + ":sf3()\n `x` is > 10000"); | ||
throw RangeError(M + "`x` is > 10000"); | ||
} | ||
@@ -147,3 +148,3 @@ if (ªS === tx) { | ||
if (0xAC00 > u) { | ||
throw RangeError(this.C + ":sf3()\n `x` codepoint " + u + " < " + 0xAC00); | ||
throw RangeError(M + "`x` codepoint " + u + " < " + 0xAC00); | ||
} | ||
@@ -184,7 +185,7 @@ if (0xAF85 > u) { | ||
if (u !== u) { | ||
throw RangeError(this.C + ":sf3()\n `x` is an empty string"); | ||
throw RangeError(M + "`x` is an empty string"); | ||
} | ||
throw RangeError(this.C + ":sf3()\n `x` codepoint " + u + " > " + 0xD6F8); | ||
throw RangeError(M + "`x` codepoint " + u + " > " + 0xD6F8); | ||
} | ||
throw TypeError(this.C + ":sf3()\n `x` is " + tx + " not number|string"); | ||
throw TypeError(M + "`x` is " + tx + " not number|string"); | ||
}; | ||
@@ -191,0 +192,0 @@ |
// Generated by CoffeeScript 1.9.2 | ||
/*! Nwang 0.0.2 //// MIT Licence //// http://nwang.richplastow.com/ */ | ||
/*! Nwang 0.0.3 //// MIT Licence //// http://nwang.richplastow.com/ */ | ||
@@ -11,3 +11,3 @@ (function() { | ||
ªV = '0.0.2'; | ||
ªV = '0.0.3'; | ||
@@ -99,7 +99,8 @@ ªA = 'array'; | ||
Main.prototype.sf3 = function(x) { | ||
var tx, u; | ||
var M, tx, u; | ||
M = '/nwang/src/class-main.litcoffee:Main:sf3()\n '; | ||
tx = typeof x; | ||
if (ªN === tx) { | ||
if (-10000 > x) { | ||
throw RangeError(this.C + ":sf3()\n `x` is < -10000"); | ||
throw RangeError(M + "`x` is < -10000"); | ||
} | ||
@@ -140,5 +141,5 @@ if (-1000 > x) { | ||
if (x !== x) { | ||
throw RangeError(this.C + ":sf3()\n `x` is not a number"); | ||
throw RangeError(M + "`x` is not a number"); | ||
} | ||
throw RangeError(this.C + ":sf3()\n `x` is > 10000"); | ||
throw RangeError(M + "`x` is > 10000"); | ||
} | ||
@@ -148,3 +149,3 @@ if (ªS === tx) { | ||
if (0xAC00 > u) { | ||
throw RangeError(this.C + ":sf3()\n `x` codepoint " + u + " < " + 0xAC00); | ||
throw RangeError(M + "`x` codepoint " + u + " < " + 0xAC00); | ||
} | ||
@@ -185,7 +186,7 @@ if (0xAF85 > u) { | ||
if (u !== u) { | ||
throw RangeError(this.C + ":sf3()\n `x` is an empty string"); | ||
throw RangeError(M + "`x` is an empty string"); | ||
} | ||
throw RangeError(this.C + ":sf3()\n `x` codepoint " + u + " > " + 0xD6F8); | ||
throw RangeError(M + "`x` codepoint " + u + " > " + 0xD6F8); | ||
} | ||
throw TypeError(this.C + ":sf3()\n `x` is " + tx + " not number|string"); | ||
throw TypeError(M + "`x` is " + tx + " not number|string"); | ||
}; | ||
@@ -545,25 +546,25 @@ | ||
return nwang.sf3('\uBCDEabc'); | ||
}, "Throws errors as expected", tudor["throw"], "pass a boolean", "Nwang:sf3()\n `x` is boolean not number|string", function(nwang) { | ||
}, "Throws errors as expected", tudor["throw"], "pass a boolean", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is boolean not number|string", function(nwang) { | ||
return nwang.sf3(true); | ||
}, "-Infinity is too low", "Nwang:sf3()\n `x` is < -10000", function(nwang) { | ||
}, "-Infinity is too low", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is < -10000", function(nwang) { | ||
return nwang.sf3(-Infinity); | ||
}, "-123456 is too low", "Nwang:sf3()\n `x` is < -10000", function(nwang) { | ||
}, "-123456 is too low", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is < -10000", function(nwang) { | ||
return nwang.sf3(-123456); | ||
}, "-10000.0001 is too low", "Nwang:sf3()\n `x` is < -10000", function(nwang) { | ||
}, "-10000.0001 is too low", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is < -10000", function(nwang) { | ||
return nwang.sf3(-10000.0001); | ||
}, "Infinity is too high", "Nwang:sf3()\n `x` is > 10000", function(nwang) { | ||
}, "Infinity is too high", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is > 10000", function(nwang) { | ||
return nwang.sf3(Infinity); | ||
}, "23456 is too high", "Nwang:sf3()\n `x` is > 10000", function(nwang) { | ||
}, "23456 is too high", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is > 10000", function(nwang) { | ||
return nwang.sf3(23456); | ||
}, "10000.0001 is too high", "Nwang:sf3()\n `x` is > 10000", function(nwang) { | ||
}, "10000.0001 is too high", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is > 10000", function(nwang) { | ||
return nwang.sf3(10000.0001); | ||
}, "NaN is, er, not a number", "Nwang:sf3()\n `x` is not a number", function(nwang) { | ||
}, "NaN is, er, not a number", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is not a number", function(nwang) { | ||
return nwang.sf3(NaN); | ||
}, "An empty string", "Nwang:sf3()\n `x` is an empty string", function(nwang) { | ||
}, "An empty string", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` is an empty string", function(nwang) { | ||
return nwang.sf3(''); | ||
}, "The codepoint of 'A' is too low", "Nwang:sf3()\n `x` codepoint 65 < 44032", function(nwang) { | ||
}, "The codepoint of 'A' is too low", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` codepoint 65 < 44032", function(nwang) { | ||
return nwang.sf3('A'); | ||
}, "The codepoint of 'U+ABFF' is too low", "Nwang:sf3()\n `x` codepoint 44031 < 44032", function(nwang) { | ||
}, "The codepoint of 'U+ABFF' is too low", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` codepoint 44031 < 44032", function(nwang) { | ||
return nwang.sf3('\uABFF'); | ||
}, "The codepoint of 'U+D6F9' is too high", "Nwang:sf3()\n `x` codepoint 55033 > 55032", function(nwang) { | ||
}, "The codepoint of 'U+D6F9' is too high", "/nwang/src/class-main.litcoffee:Main:sf3()\n `x` codepoint 55033 > 55032", function(nwang) { | ||
return nwang.sf3('\uD6F9'); | ||
@@ -570,0 +571,0 @@ }, "Converts numbers to glyphs as expected", tudor.equal, "-10000 returns U+AC00", String.fromCharCode(0xAC00), function(nwang) { |
{ | ||
"name": "nwang", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A suite of functions which convert numbers into asian glyphs and back again", | ||
@@ -5,0 +5,0 @@ "main": "build/nwang.js", |
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
124452
1130