Noodles, Poodles and More!

    is-pandigital

    1.2.3 • Public • Published

    is-pandigital

    NPM Version Build Status Coverage Status

    Test if a number is pandigital: made up of the digits 1-9, once each

    Install

    $ npm install is-pandigital
    
    var isPandigital = require('is-pandigital');

    Usage

    console.log(isPandigital(192384576)); // true
    console.log(isPandigital(918273645)); // true
    console.log(isPandigital(9136485234)); // false
    console.log(isPandigital(9183645)); // false

    Optionally, pass in a second number to specify a base (defaults to 9):

    console.log(isPandigital(1234, 4)); // true
    console.log(isPandigital(425631, 6)); // true
    console.log(isPandigital(918273645, 2)); // false

    Tests

    To run the test suite, first install the dependencies, then run npm test:

    $ npm install
    $ npm test
    

    To test code coverage:

    $ npm run cover
    

    Install

    npm i is-pandigital

    DownloadsWeekly Downloads

    1

    Version

    1.2.3

    License

    ISC

    Last publish

    Collaborators

    • dsernst