Skip to content
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

fix(types): Fix type definition for load().json #2334

Closed
wants to merge 1 commit into from

Commits on Sep 23, 2021

  1. fix(types): Fix type definition for load().json

    The "json" field in the load() argument object accepts (at least) two
    different types of information:
    
      Pattern: [{ [key: string]: string | number }]
    
        json: [
            {name: "www.site1.com", upload: 800, download: 500, total: 400},
        ]
    
      Pattern: {[key: string]: (string[]|number[])}
    
        json: {
            "data1": [220, 240, 270, 250, 280],
            "data2": [180, 150, 300, 70, 120]
        }
    
    In the first case, we need to add "number" to the existing value type for
    obvious reasons. In the second case, string might be needed in the
    array to provide formatted dates, e.g. "2021-01-01T01:02:03.456"
    
    Signed-off-by: Adrian Schmutzler <dev@schmutzler.it>
    adschm committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    a9771dc View commit details
    Browse the repository at this point in the history