这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ function is(x) {
noop();

var thirteenStrings = [
1101, // Binary 13
"XIII", // Roman numeral 13
'1101', // Binary 13
"xiii", // Roman numeral 13
"0xD", // Hex 13

"https://scontent.cdninstagram.com/hphotos-xtf1/t51.2885-15/s320x320/e35/12237511_444845689040315_1101385461_n.jpg", // Just because we can
"https://www.youtube.com/watch?v=pte3Jg-2Ax4", // Thirteen by Big Star
"rem hadley", // And because he's 13
"Olivia Wilde", // AND because SHE's 13
"https://www.youtube.com/watch?v=pte3jg-2ax4", // Thirteen by Big Star
"remy hadley", // And because he's 13
"olivia wilde", // AND because SHE's 13
"baker's dozen", // Bakers gonna bake
"Dr. Remy Beauregard Hadley", // Why not 13's real name?!
"dr. remy beauregard hadley", // Why not 13's real name?!

// Imaginary 13's
"13+0i",
Expand All @@ -47,12 +47,12 @@ function is(x) {
"trinaest", // Croatian
"tretten", // Danish / Norwegian
"kolmteist", // Estonian
"שלוש עשרה", // Hebrew
"labintatlo", // Filipino
"kolmetoista", // Finnish
"treize", // French
"dreizehn", // German
"तेरह", //Hindi
"שלוש עשרה", // Hebrew
"तेरह", //Hindi
"tizenhárom", // Hungarian
"déag", // Irish
"tredici", // Italian
Expand Down
31 changes: 18 additions & 13 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
'use strict';

const tap = require('tap');
const is = require('./');


tap.equal(is(13).thirteen(), true);

tap.equal(is('13').thirteen(), false);
tap.equal(is('13').thirteen(), true);
tap.equal(is(1101).thirteen(), true);
tap.equal(is('1101').thirteen(), true);
tap.equal(is('XIII').thirteen(), true);
tap.equal(is('xiii').thirteen(), true);
tap.equal(is('0xD').thirteen(), true);
tap.equal(is('0xd').thirteen(), true);

tap.equal(is('https://scontent.cdninstagram.com/hphotos-xtf1/t51.2885-15/s320x320/e35/12237511_444845689040315_1101385461_n.jpg').thirteen(), true);
tap.equal(is('http://www.metal-archives.com/images/1/5/3/7/153772.jpg').thirteen(), false);
tap.equal(is('https://www.youtube.com/watch?v=pte3Jg-2Ax4').thirteen(), true);
tap.equal(is('thirteen').thirteen(), true);
tap.equal(is('Thirteen').thirteen(), true);
tap.equal(is('dreizehn').thirteen(), true);
tap.equal(is('שלוש עשרה').thirteen(), true);
tap.equal(is('Remy Hadley').thirteen(), true);
tap.equal(is('Olivia Wilde').thirteen(), true);
tap.equal(is("baker's dozen").thirteen(), true);
tap.equal(is("Dr. Remy Beauregard Hadley").thirteen(), true);

tap.equal(is('https://scontent.cdninstagram.com/hphotos-xtf1/t51.2885-15/s320x320/e35/12237511_444845689040315_1101385461_n.jpg').thirteen(), true);
tap.equal(is('http://www.metal-archives.com/images/1/5/3/7/153772.jpg').thirteen(), false);
tap.equal(is('https://www.youtube.com/watch?v=pte3Jg-2Ax4').thirteen(), true);

tap.equal(is(1101).thirteen(), true);
tap.equal(is('1101').thirteen(), true);

// Imaginary 13's tests
tap.equal(is("13+0i").thirteen(), true);
tap.equal(is("13i").thirteen(), true);
tap.equal(is("13i+13").thirteen(), true);
tap.equal(is("13 + 13i").thirteen(), true);
tap.equal(is("12i").thirteen(), false);

// Password variations tests
tap.equal(is("th1rt33n").thirteen(), true);
tap.equal(is("th1rte3n").thirteen(), true);
tap.equal(is("th1rteen").thirteen(), true);
tap.equal(is("thirt3en").thirteen(), true);
tap.equal(is("thirt33n").thirteen(), true);
tap.equal(is("thirte3n").thirteen(), true);

// Languages tests
tap.equal(is("dertien").thirteen(), true); // Afrikaans / Dutch
tap.equal(is("dertiendertien").thirteen(), true); // Double Dutch
tap.equal(is("tretze").thirteen(), true); // Catalan
Expand All @@ -45,6 +49,7 @@ tap.equal(is("labintatlo").thirteen(), true); // Filipino
tap.equal(is("kolmetoista").thirteen(), true); // Finnish
tap.equal(is("treize").thirteen(), true); // French
tap.equal(is("dreizehn").thirteen(), true); // German
tap.equal(is('שלוש עשרה').thirteen(), true); // Hebrew
tap.equal(is("तेरह").thirteen(), true); // Hindi
tap.equal(is("tizenhárom").thirteen(), true); // Hungarian
tap.equal(is("déag").thirteen(), true); // Irish
Expand Down