Have ideas to improve npm?Join in the discussion! »

    sumo-rank

    1.0.5 • Public • Published

    Documentation - How to use sumoRank

    "<RANK>".sumoRank("<DESIRED FORMAT>")

    Contents

    Quick Brief on Sumo Ranks
    Rank Input
    Format Input
    Common Usage Examples
    Use Guide
    Format Input Rules
    Rank Input Rules
    Content Errors
    Input Errors for Rank
    Input Errors for Format

    QUICK BRIEF ON SUMO RANKS

    Each rank has a name, number and direction - typically in that order.
    Example 1: The highest rank in sumo
    Long, all caps version: "Yokozuna 1 East"
    Short, partial caps version: "Y1e"
    Example 2: The lowest possible rank in the top division
    Long, all caps version: "Maegashira 17 West"
    Short, partial caps version: "M17w"

    RANK INPUT

    Named ranks (high to low) --> Yokozuna, Ozeki, Sekiwake, Komusubi, Maegashira, Juryo, Makushita, Sandanme, Jonidan, Jonokuchi
    Number ranks (high to low) --> 1 - 100+ (100 is a typical maximum, but it is unlimited in some cases)
    Direction ranks (high to low) --> East, West

    FORMAT INPUT

    Nn --> Yokozuna, Maegashira, Jonokuchi, etc.
    nn --> yokozuna, maegashira, Jonokuchi, etc.
    N --> Y, M, Jk, etc.
    n --> y, m, jk, etc.
    Dd --> East, West
    dd --> east, west
    D --> E, W
    d --> e, w
    # --> 1, 15, 68, 104, etc.

    COMMON USAGE EXAMPLES

    Nn # Dd --> Yokozuna 1 East, Maegashira 12 West, Jonokuchi 68 East, etc.
    nn # dd --> yokozuna 1 east, maegashira 12 west, jonokuchi 68 east, etc.
    N#D --> Y1E, M12W, Jk68E, etc.
    N#d --> Y1e, M12w, Jk68e, etc.
    N --> Y, M, Jk, etc.
    #d --> 1e, 12w, 68e, etc.

    USE GUIDE

    FORMAT INPUT RULES

    "<RANK>".sumoRank("<DESIRED FORMAT>")

    1. Format can be arranged in any combination
      "S1W".sumoRank("Nn") --> "Sekiwake"
      "S1W".sumoRank("N#d") --> "S1w"
    2. Spaces between rankings will be retained
      "S1W".sumoRank("nn # dd") --> "sekiwake 1 west"

    RANK INPUT RULES

    "<RANK>".sumoRank("<DESIRED FORMAT>")

    1. Input rank can be any arrangement
      "Komusubi 1 e".sumoRank("N#D") --> "K1E"
      "e 1 Komusubi".sumoRank("N#D") --> "K1E"
      "K1e".sumoRank("N#D") --> "K1E"
    2. Input rank IS caps sensitive
      "KomuSUBi 1 eASt".sumoRank("Nn") --> Error SR.304

    CONTENT ERRORS

    • SR.101 Non-existent Name/Number rankings throw error
      "Maegashira 18 East".sumoRank("N#D") --> Error
    • SR.202 (INCOMPLETE) Lower division rankings throw error
      "Sandanme 82 East".sumoRank("N#D") --> Error

    INPUT ERRORS FOR RANK

    • SR.301 Empty rank types throw error
      "".sumoRank("Dd") --> Error
    • SR.302 Blank rank types throw error
      " ".sumoRank("Nn#Dd") --> Error
    • SR.303 (ERROR DOES NOT EXIST)
    • SR.304 Non-rank item throw error
      "M two east".sumoRank("N#D") --> Error
      "i like turtles".sumoRank("N#D") --> Error
    • SR.305 Multiple instances of rank type throw error
      "Y Y".sumoRank("Nn#Dd) --> Error
      "Y y".sumoRank("Nn#Dd) --> Error
      "Y M".sumoRank("Nn#Dd) --> Error
      "Ozeki ozeki".sumoRank("Nn#Dd) --> Error
      "Ozeki Sekiwake".sumoRank("Nn#Dd) --> Error
    • SR.306 Rank Name not given, but requested
      "2 West".sumoRank("Nn") --> Error
    • SR.307 Rank Number not given, but requested
      "Ozeki West".sumoRank("#") --> Error
    • SR.308 Rank Direction not given, but requested
      "Ozeki 2".sumoRank("Dd") --> Error

    INPUT ERRORS FOR FORMAT

    • SR.401 Empty format types throw error
      "K2E".sumoRank("") --> Error
    • SR.402 Blank format types throw error
      "K2E".sumoRank(" ") --> Error
    • SR.403 Incorrect format types throw error
      "Y1E".sumoRank(123) --> Error
      "Y1E".sumoRank(true) --> Error
      "Y1E".sumoRank([]) --> Error
      "Y1E".sumoRank({}) --> Error
    • SR.404 Duplicate format types throw error
      "M5W".sumoRank("Dd Dd") --> Error
      "M5W".sumoRank("Dd d") --> Error
      "M5W".sumoRank("# #") --> Error

    Keywords

    none

    Install

    npm i sumo-rank

    DownloadsWeekly Downloads

    2

    Version

    1.0.5

    License

    ISC

    Unpacked Size

    15.6 kB

    Total Files

    3

    Last publish

    Collaborators

    • avatar