New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing when there aren't any card's number #3

Closed
denysdovhan opened this Issue Nov 18, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@denysdovhan
Copy link

denysdovhan commented Nov 18, 2015

I'm trying to process plain text through this package as pard of typographer. If I process text without any card's number, get an error:

Usage:

bar(foo(cards("Phone number: +180951100392")))

Output:

.../node_modules/typographic-bank-card/index.js:28
        for (var i = 0; i < cards.length; i++) {
                                 ^

TypeError: Cannot read property 'length' of null
    at formatCards (.../node_modules/typographic-bank-card/index.js:28:34)
    at module.exports (.../node_modules/typographic-bank-card/index.js:36:12)
    at Object.<anonymous> (.../foo.js:6:13)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3
@iamstarkov

This comment has been minimized.

Copy link

iamstarkov commented Nov 19, 2015

@beshkenadze @denysdovhan can anybody add tests for this case?

@beshkenadze

This comment has been minimized.

@iamstarkov

This comment has been minimized.

Copy link

iamstarkov commented Nov 19, 2015

great

@denysdovhan

This comment has been minimized.

Copy link

denysdovhan commented Nov 19, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment