logo

Datasource#

  • New feature that you can customise your data and our data. There is 2 options which is merge and own
  • Output data also print in devtool > console. Please reload TSI after make changes
Use below data as your starting point.
[ ["MYX:MAYBANK", {"s": 1}]

Ways to Validate your data#

  • Use typescript playgroundlink(recommended)

    In case website doesnt work you can play around with this TS code to validate it
    type availableTSIExchanges = 'MYX' | 'NASDAQ' | 'NYSE' | 'SSE' | 'SZSE' | 'IDX' // only these is supported exchange. You also can put any exchanges as well. Refer below 'TSX:RY'
    type stockCode = `${availableTSIExchanges | string}:${string}` // you can put like this 'exchange:stockcode',
    type TSI = [stockCode, { s: 0 | 1}][] // s stand for shariah and its valid value ony 0 or 1
    
    const mydata: TSI = 
    ////////////////////////////////////////
    // please change inside below lines only.
    ////////////////////////////////////////
    [ 
      ["MYX:MAYBANK", {"s": 1}], 
      ["NASDAQ:GOOG", {"s": 0}], 
      ["TSX:RY", {"s": 0}]
    ]
    
  • Use JSON schema

    Use this json schema and validate this in any json schema validator
    {
      "type": "array",
      "items": {
        "type": "array",
        "items": [
          {
            "type": "string",
            "pattern": "(MYX|NASDAQ|IDX|NYSE|SZSE|SSE|[A-Z]+):\\w+([&-]?\\w+)+"
          },
          {
            "type": "object",
            "properties": {
              "s": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 1
                  }
                ]
              }
            },
            "required": [
              "s"
            ]
          }
        ],
        "additionalItems": false,
        "minItems": 2,
        "maxItems": 2
      }
    }
  • Use our custom validate