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

typedefs are rendered Multiple times. #40

Closed
vespakoen opened this issue Aug 3, 2015 · 5 comments
Closed

typedefs are rendered Multiple times. #40

vespakoen opened this issue Aug 3, 2015 · 5 comments

Comments

@vespakoen
Copy link

Here is my esdoc.json

{
  "source": "./src",
  "destination": "./docs",
  "title": "schema-mapper-spec"
}

In src there is one index.js file with the following contents:

import isObject from 'lodash.isobject';
/**
 * A container for data that also includes the schema and version.
 * @typedef {Object} DataInfo
 * @property {String} schema            The name of the schema
 * @property {(Number|String)} version  The version of the schema
 * @property {Object} data              An object containing the data
 */

/**
 * A schema describing the properties of data.
 * @typedef {Object} Schema
 * @property {String} name            The name of the schema
 * @property {Object} columns         An object of columns where the key is the unique id for the column and the value is an object of type Column
 */

/**
 * A column describing a single property of data.
 * @typedef {Object} Column
 * @property {String} name The name of the column
 * @property {String} type The type of the column
 */

/**
 * An array of changes containing items of type Change
 * @typedef {Array} Changes
 */

/**
 * A change indicating a modification to a schema or column.
 * @typedef {Object} Change
 * @property {String} id The id of the schema that this change applies to
 * @property {String} change A string indicating the type of change,
 * this can be any of:
 *  - schema.create
 *  - schema.rename
 *  - schema.remove
 *  - column.create
 *  - column.rename
 *  - column.remove
 *  - column.typechange
 */

 /**
  * A result of the validation containing errors when failed.
  * @typedef {Object} ValidationResult
  */

/**
 * A validator that can be used to validate the following objects:
 *  - DataInfo
 *  - Schema
 *  - Changes
 */
class SpecValidator {
  /**
   * Validate a DataInfo object
   * @param  {DataInfo} dataInfo A DataInfo object
   * @return {ValidationResult}  A ValidationResult
   */
  validateDataInfo(dataInfo) {
    if ( ! isObject(dataInfo)) {
    }
  }

  /**
   * Validate a Schema
   * @param  {Schema} schema A Schema
   * @return {ValidationResult} A ValidationResult
   */
  validateSchema(schema) {
  }

  /**
   * Validate Changes
   * @param  {Changes} changes A Changes array
   * @return {ValidationResult} A ValidationResult
   */
  validateChanges(changes) {
  }
}

export default new SpecValidator;

When I inspect the AST, I see the typedef showing up multiple times, here is the AST for index.js:

{
  "type": "Program",
  "body": [
    {
      "type": "ImportDeclaration",
      "specifiers": [
        {
          "type": "ImportDefaultSpecifier",
          "local": {
            "type": "Identifier",
            "name": "isObject",
            "range": [
              7,
              15
            ],
            "loc": {
              "start": {
                "line": 1,
                "column": 7
              },
              "end": {
                "line": 1,
                "column": 15
              }
            }
          },
          "range": [
            7,
            15
          ],
          "loc": {
            "start": {
              "line": 1,
              "column": 7
            },
            "end": {
              "line": 1,
              "column": 15
            }
          }
        }
      ],
      "source": {
        "type": "Literal",
        "value": "lodash.isobject",
        "raw": "'lodash.isobject'",
        "range": [
          21,
          38
        ],
        "loc": {
          "start": {
            "line": 1,
            "column": 21
          },
          "end": {
            "line": 1,
            "column": 38
          }
        }
      },
      "range": [
        0,
        39
      ],
      "loc": {
        "start": {
          "line": 1,
          "column": 0
        },
        "end": {
          "line": 1,
          "column": 39
        }
      },
      "trailingComments": [
        {
          "type": "Block",
          "value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema            The name of the schema\n * @property {(Number|String)} version  The version of the schema\n * @property {Object} data              An object containing the data\n ",
          "range": [
            40,
            343
          ],
          "loc": {
            "start": {
              "line": 2,
              "column": 0
            },
            "end": {
              "line": 8,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name            The name of the schema\n * @property {Object} columns         An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
          "range": [
            345,
            635
          ],
          "loc": {
            "start": {
              "line": 10,
              "column": 0
            },
            "end": {
              "line": 15,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
          "range": [
            637,
            822
          ],
          "loc": {
            "start": {
              "line": 17,
              "column": 0
            },
            "end": {
              "line": 22,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
          "range": [
            824,
            914
          ],
          "loc": {
            "start": {
              "line": 24,
              "column": 0
            },
            "end": {
              "line": 27,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n *  - schema.create\n *  - schema.rename\n *  - schema.remove\n *  - column.create\n *  - column.rename\n *  - column.remove\n *  - column.typechange\n ",
          "range": [
            916,
            1322
          ],
          "loc": {
            "start": {
              "line": 29,
              "column": 0
            },
            "end": {
              "line": 42,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n  * A result of the validation containing errors when failed.\n  * @typedef {Object} ValidationResult\n  ",
          "range": [
            1325,
            1434
          ],
          "loc": {
            "start": {
              "line": 44,
              "column": 1
            },
            "end": {
              "line": 47,
              "column": 4
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A validator that can be used to validate the following objects:\n *  - DataInfo\n *  - Schema\n *  - Changes\n ",
          "range": [
            1436,
            1552
          ],
          "loc": {
            "start": {
              "line": 49,
              "column": 0
            },
            "end": {
              "line": 54,
              "column": 3
            }
          }
        }
      ]
    },
    {
      "type": "Identifier",
      "id": {
        "type": "Identifier",
        "name": "SpecValidator",
        "range": [
          1559,
          1572
        ],
        "loc": {
          "start": {
            "line": 55,
            "column": 6
          },
          "end": {
            "line": 55,
            "column": 19
          }
        }
      },
      "superClass": null,
      "body": {
        "type": "ClassBody",
        "body": [
          {
            "type": "MethodDefinition",
            "key": {
              "type": "Identifier",
              "name": "validateDataInfo",
              "range": [
                1724,
                1740
              ],
              "loc": {
                "start": {
                  "line": 61,
                  "column": 2
                },
                "end": {
                  "line": 61,
                  "column": 18
                }
              }
            },
            "value": {
              "type": "FunctionExpression",
              "id": null,
              "params": [
                {
                  "type": "Identifier",
                  "name": "dataInfo",
                  "range": [
                    1741,
                    1749
                  ],
                  "loc": {
                    "start": {
                      "line": 61,
                      "column": 19
                    },
                    "end": {
                      "line": 61,
                      "column": 27
                    }
                  }
                }
              ],
              "body": {
                "type": "BlockStatement",
                "body": [
                  {
                    "type": "IfStatement",
                    "test": {
                      "type": "UnaryExpression",
                      "operator": "!",
                      "argument": {
                        "type": "CallExpression",
                        "callee": {
                          "type": "Identifier",
                          "name": "isObject",
                          "range": [
                            1764,
                            1772
                          ],
                          "loc": {
                            "start": {
                              "line": 62,
                              "column": 11
                            },
                            "end": {
                              "line": 62,
                              "column": 19
                            }
                          }
                        },
                        "arguments": [
                          {
                            "type": "Identifier",
                            "name": "dataInfo",
                            "range": [
                              1773,
                              1781
                            ],
                            "loc": {
                              "start": {
                                "line": 62,
                                "column": 20
                              },
                              "end": {
                                "line": 62,
                                "column": 28
                              }
                            }
                          }
                        ],
                        "range": [
                          1764,
                          1782
                        ],
                        "loc": {
                          "start": {
                            "line": 62,
                            "column": 11
                          },
                          "end": {
                            "line": 62,
                            "column": 29
                          }
                        }
                      },
                      "prefix": true,
                      "range": [
                        1762,
                        1782
                      ],
                      "loc": {
                        "start": {
                          "line": 62,
                          "column": 9
                        },
                        "end": {
                          "line": 62,
                          "column": 29
                        }
                      }
                    },
                    "consequent": {
                      "type": "BlockStatement",
                      "body": [],
                      "range": [
                        1784,
                        1791
                      ],
                      "loc": {
                        "start": {
                          "line": 62,
                          "column": 31
                        },
                        "end": {
                          "line": 63,
                          "column": 5
                        }
                      }
                    },
                    "alternate": null,
                    "range": [
                      1757,
                      1791
                    ],
                    "loc": {
                      "start": {
                        "line": 62,
                        "column": 4
                      },
                      "end": {
                        "line": 63,
                        "column": 5
                      }
                    }
                  }
                ],
                "range": [
                  1751,
                  1795
                ],
                "loc": {
                  "start": {
                    "line": 61,
                    "column": 29
                  },
                  "end": {
                    "line": 64,
                    "column": 3
                  }
                }
              },
              "generator": false,
              "expression": false,
              "range": [
                1740,
                1795
              ],
              "loc": {
                "start": {
                  "line": 61,
                  "column": 18
                },
                "end": {
                  "line": 64,
                  "column": 3
                }
              }
            },
            "kind": "method",
            "computed": false,
            "range": [
              1724,
              1795
            ],
            "loc": {
              "start": {
                "line": 61,
                "column": 2
              },
              "end": {
                "line": 64,
                "column": 3
              }
            },
            "leadingComments": [
              {
                "type": "Block",
                "value": "*\n   * Validate a DataInfo object\n   * @param  {DataInfo} dataInfo A DataInfo object\n   * @return {ValidationResult}  A ValidationResult\n   ",
                "range": [
                  1577,
                  1721
                ],
                "loc": {
                  "start": {
                    "line": 56,
                    "column": 2
                  },
                  "end": {
                    "line": 60,
                    "column": 5
                  }
                }
              }
            ],
            "trailingComments": [
              {
                "type": "Block",
                "value": "*\n   * Validate a Schema\n   * @param  {Schema} schema A Schema\n   * @return {ValidationResult} A ValidationResult\n   ",
                "range": [
                  1799,
                  1920
                ],
                "loc": {
                  "start": {
                    "line": 66,
                    "column": 2
                  },
                  "end": {
                    "line": 70,
                    "column": 5
                  }
                }
              }
            ],
            "static": false
          },
          {
            "type": "MethodDefinition",
            "key": {
              "type": "Identifier",
              "name": "validateSchema",
              "range": [
                1923,
                1937
              ],
              "loc": {
                "start": {
                  "line": 71,
                  "column": 2
                },
                "end": {
                  "line": 71,
                  "column": 16
                }
              }
            },
            "value": {
              "type": "FunctionExpression",
              "id": null,
              "params": [
                {
                  "type": "Identifier",
                  "name": "schema",
                  "range": [
                    1938,
                    1944
                  ],
                  "loc": {
                    "start": {
                      "line": 71,
                      "column": 17
                    },
                    "end": {
                      "line": 71,
                      "column": 23
                    }
                  }
                }
              ],
              "body": {
                "type": "BlockStatement",
                "body": [],
                "range": [
                  1946,
                  1951
                ],
                "loc": {
                  "start": {
                    "line": 71,
                    "column": 25
                  },
                  "end": {
                    "line": 72,
                    "column": 3
                  }
                }
              },
              "generator": false,
              "expression": false,
              "range": [
                1937,
                1951
              ],
              "loc": {
                "start": {
                  "line": 71,
                  "column": 16
                },
                "end": {
                  "line": 72,
                  "column": 3
                }
              }
            },
            "kind": "method",
            "computed": false,
            "range": [
              1923,
              1951
            ],
            "loc": {
              "start": {
                "line": 71,
                "column": 2
              },
              "end": {
                "line": 72,
                "column": 3
              }
            },
            "leadingComments": [
              {
                "type": "Block",
                "value": "*\n   * Validate a Schema\n   * @param  {Schema} schema A Schema\n   * @return {ValidationResult} A ValidationResult\n   ",
                "range": [
                  1799,
                  1920
                ],
                "loc": {
                  "start": {
                    "line": 66,
                    "column": 2
                  },
                  "end": {
                    "line": 70,
                    "column": 5
                  }
                }
              }
            ],
            "trailingComments": [
              {
                "type": "Block",
                "value": "*\n   * Validate Changes\n   * @param  {Changes} changes A Changes array\n   * @return {ValidationResult} A ValidationResult\n   ",
                "range": [
                  1955,
                  2084
                ],
                "loc": {
                  "start": {
                    "line": 74,
                    "column": 2
                  },
                  "end": {
                    "line": 78,
                    "column": 5
                  }
                }
              }
            ],
            "static": false
          },
          {
            "type": "MethodDefinition",
            "key": {
              "type": "Identifier",
              "name": "validateChanges",
              "range": [
                2087,
                2102
              ],
              "loc": {
                "start": {
                  "line": 79,
                  "column": 2
                },
                "end": {
                  "line": 79,
                  "column": 17
                }
              }
            },
            "value": {
              "type": "FunctionExpression",
              "id": null,
              "params": [
                {
                  "type": "Identifier",
                  "name": "changes",
                  "range": [
                    2103,
                    2110
                  ],
                  "loc": {
                    "start": {
                      "line": 79,
                      "column": 18
                    },
                    "end": {
                      "line": 79,
                      "column": 25
                    }
                  }
                }
              ],
              "body": {
                "type": "BlockStatement",
                "body": [],
                "range": [
                  2112,
                  2117
                ],
                "loc": {
                  "start": {
                    "line": 79,
                    "column": 27
                  },
                  "end": {
                    "line": 80,
                    "column": 3
                  }
                }
              },
              "generator": false,
              "expression": false,
              "range": [
                2102,
                2117
              ],
              "loc": {
                "start": {
                  "line": 79,
                  "column": 17
                },
                "end": {
                  "line": 80,
                  "column": 3
                }
              }
            },
            "kind": "method",
            "computed": false,
            "range": [
              2087,
              2117
            ],
            "loc": {
              "start": {
                "line": 79,
                "column": 2
              },
              "end": {
                "line": 80,
                "column": 3
              }
            },
            "leadingComments": [
              {
                "type": "Block",
                "value": "*\n   * Validate Changes\n   * @param  {Changes} changes A Changes array\n   * @return {ValidationResult} A ValidationResult\n   ",
                "range": [
                  1955,
                  2084
                ],
                "loc": {
                  "start": {
                    "line": 74,
                    "column": 2
                  },
                  "end": {
                    "line": 78,
                    "column": 5
                  }
                }
              }
            ],
            "static": false
          }
        ],
        "range": [
          1573,
          2119
        ],
        "loc": {
          "start": {
            "line": 55,
            "column": 20
          },
          "end": {
            "line": 81,
            "column": 1
          }
        }
      },
      "range": [
        1553,
        2119
      ],
      "loc": {
        "start": {
          "line": 55,
          "column": 0
        },
        "end": {
          "line": 81,
          "column": 1
        }
      },
      "leadingComments": [
        {
          "type": "Block",
          "value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema            The name of the schema\n * @property {(Number|String)} version  The version of the schema\n * @property {Object} data              An object containing the data\n ",
          "range": [
            40,
            343
          ],
          "loc": {
            "start": {
              "line": 2,
              "column": 0
            },
            "end": {
              "line": 8,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name            The name of the schema\n * @property {Object} columns         An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
          "range": [
            345,
            635
          ],
          "loc": {
            "start": {
              "line": 10,
              "column": 0
            },
            "end": {
              "line": 15,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
          "range": [
            637,
            822
          ],
          "loc": {
            "start": {
              "line": 17,
              "column": 0
            },
            "end": {
              "line": 22,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
          "range": [
            824,
            914
          ],
          "loc": {
            "start": {
              "line": 24,
              "column": 0
            },
            "end": {
              "line": 27,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n *  - schema.create\n *  - schema.rename\n *  - schema.remove\n *  - column.create\n *  - column.rename\n *  - column.remove\n *  - column.typechange\n ",
          "range": [
            916,
            1322
          ],
          "loc": {
            "start": {
              "line": 29,
              "column": 0
            },
            "end": {
              "line": 42,
              "column": 3
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n  * A result of the validation containing errors when failed.\n  * @typedef {Object} ValidationResult\n  ",
          "range": [
            1325,
            1434
          ],
          "loc": {
            "start": {
              "line": 44,
              "column": 1
            },
            "end": {
              "line": 47,
              "column": 4
            }
          }
        },
        {
          "type": "Block",
          "value": "*\n * A validator that can be used to validate the following objects:\n *  - DataInfo\n *  - Schema\n *  - Changes\n ",
          "range": [
            1436,
            1552
          ],
          "loc": {
            "start": {
              "line": 49,
              "column": 0
            },
            "end": {
              "line": 54,
              "column": 3
            }
          }
        }
      ]
    },
    {
      "type": "Identifier",
      "declaration": {
        "type": "NewExpression",
        "callee": {
          "type": "Identifier",
          "name": "SpecValidator",
          "range": [
            2140,
            2153
          ],
          "loc": {
            "start": {
              "line": 83,
              "column": 19
            },
            "end": {
              "line": 83,
              "column": 32
            }
          }
        },
        "arguments": [],
        "range": [
          2136,
          2153
        ],
        "loc": {
          "start": {
            "line": 83,
            "column": 15
          },
          "end": {
            "line": 83,
            "column": 32
          }
        }
      },
      "range": [
        2121,
        2154
      ],
      "loc": {
        "start": {
          "line": 83,
          "column": 0
        },
        "end": {
          "line": 83,
          "column": 33
        }
      }
    },
    {
      "type": "ExportDefaultDeclaration",
      "declaration": {
        "type": "ClassDeclaration",
        "id": {
          "type": "Identifier",
          "name": "SpecValidator",
          "range": [
            1559,
            1572
          ],
          "loc": {
            "start": {
              "line": 55,
              "column": 6
            },
            "end": {
              "line": 55,
              "column": 19
            }
          }
        },
        "superClass": null,
        "body": {
          "type": "ClassBody",
          "body": [
            {
              "type": "MethodDefinition",
              "key": {
                "type": "Identifier",
                "name": "validateDataInfo",
                "range": [
                  1724,
                  1740
                ],
                "loc": {
                  "start": {
                    "line": 61,
                    "column": 2
                  },
                  "end": {
                    "line": 61,
                    "column": 18
                  }
                }
              },
              "value": {
                "type": "FunctionExpression",
                "id": null,
                "params": [
                  {
                    "type": "Identifier",
                    "name": "dataInfo",
                    "range": [
                      1741,
                      1749
                    ],
                    "loc": {
                      "start": {
                        "line": 61,
                        "column": 19
                      },
                      "end": {
                        "line": 61,
                        "column": 27
                      }
                    }
                  }
                ],
                "body": {
                  "type": "BlockStatement",
                  "body": [
                    {
                      "type": "IfStatement",
                      "test": {
                        "type": "UnaryExpression",
                        "operator": "!",
                        "argument": {
                          "type": "CallExpression",
                          "callee": {
                            "type": "Identifier",
                            "name": "isObject",
                            "range": [
                              1764,
                              1772
                            ],
                            "loc": {
                              "start": {
                                "line": 62,
                                "column": 11
                              },
                              "end": {
                                "line": 62,
                                "column": 19
                              }
                            }
                          },
                          "arguments": [
                            {
                              "type": "Identifier",
                              "name": "dataInfo",
                              "range": [
                                1773,
                                1781
                              ],
                              "loc": {
                                "start": {
                                  "line": 62,
                                  "column": 20
                                },
                                "end": {
                                  "line": 62,
                                  "column": 28
                                }
                              }
                            }
                          ],
                          "range": [
                            1764,
                            1782
                          ],
                          "loc": {
                            "start": {
                              "line": 62,
                              "column": 11
                            },
                            "end": {
                              "line": 62,
                              "column": 29
                            }
                          }
                        },
                        "prefix": true,
                        "range": [
                          1762,
                          1782
                        ],
                        "loc": {
                          "start": {
                            "line": 62,
                            "column": 9
                          },
                          "end": {
                            "line": 62,
                            "column": 29
                          }
                        }
                      },
                      "consequent": {
                        "type": "BlockStatement",
                        "body": [],
                        "range": [
                          1784,
                          1791
                        ],
                        "loc": {
                          "start": {
                            "line": 62,
                            "column": 31
                          },
                          "end": {
                            "line": 63,
                            "column": 5
                          }
                        }
                      },
                      "alternate": null,
                      "range": [
                        1757,
                        1791
                      ],
                      "loc": {
                        "start": {
                          "line": 62,
                          "column": 4
                        },
                        "end": {
                          "line": 63,
                          "column": 5
                        }
                      }
                    }
                  ],
                  "range": [
                    1751,
                    1795
                  ],
                  "loc": {
                    "start": {
                      "line": 61,
                      "column": 29
                    },
                    "end": {
                      "line": 64,
                      "column": 3
                    }
                  }
                },
                "generator": false,
                "expression": false,
                "range": [
                  1740,
                  1795
                ],
                "loc": {
                  "start": {
                    "line": 61,
                    "column": 18
                  },
                  "end": {
                    "line": 64,
                    "column": 3
                  }
                }
              },
              "kind": "method",
              "computed": false,
              "range": [
                1724,
                1795
              ],
              "loc": {
                "start": {
                  "line": 61,
                  "column": 2
                },
                "end": {
                  "line": 64,
                  "column": 3
                }
              },
              "leadingComments": [
                {
                  "type": "Block",
                  "value": "*\n   * Validate a DataInfo object\n   * @param  {DataInfo} dataInfo A DataInfo object\n   * @return {ValidationResult}  A ValidationResult\n   ",
                  "range": [
                    1577,
                    1721
                  ],
                  "loc": {
                    "start": {
                      "line": 56,
                      "column": 2
                    },
                    "end": {
                      "line": 60,
                      "column": 5
                    }
                  }
                }
              ],
              "trailingComments": [
                {
                  "type": "Block",
                  "value": "*\n   * Validate a Schema\n   * @param  {Schema} schema A Schema\n   * @return {ValidationResult} A ValidationResult\n   ",
                  "range": [
                    1799,
                    1920
                  ],
                  "loc": {
                    "start": {
                      "line": 66,
                      "column": 2
                    },
                    "end": {
                      "line": 70,
                      "column": 5
                    }
                  }
                }
              ],
              "static": false
            },
            {
              "type": "MethodDefinition",
              "key": {
                "type": "Identifier",
                "name": "validateSchema",
                "range": [
                  1923,
                  1937
                ],
                "loc": {
                  "start": {
                    "line": 71,
                    "column": 2
                  },
                  "end": {
                    "line": 71,
                    "column": 16
                  }
                }
              },
              "value": {
                "type": "FunctionExpression",
                "id": null,
                "params": [
                  {
                    "type": "Identifier",
                    "name": "schema",
                    "range": [
                      1938,
                      1944
                    ],
                    "loc": {
                      "start": {
                        "line": 71,
                        "column": 17
                      },
                      "end": {
                        "line": 71,
                        "column": 23
                      }
                    }
                  }
                ],
                "body": {
                  "type": "BlockStatement",
                  "body": [],
                  "range": [
                    1946,
                    1951
                  ],
                  "loc": {
                    "start": {
                      "line": 71,
                      "column": 25
                    },
                    "end": {
                      "line": 72,
                      "column": 3
                    }
                  }
                },
                "generator": false,
                "expression": false,
                "range": [
                  1937,
                  1951
                ],
                "loc": {
                  "start": {
                    "line": 71,
                    "column": 16
                  },
                  "end": {
                    "line": 72,
                    "column": 3
                  }
                }
              },
              "kind": "method",
              "computed": false,
              "range": [
                1923,
                1951
              ],
              "loc": {
                "start": {
                  "line": 71,
                  "column": 2
                },
                "end": {
                  "line": 72,
                  "column": 3
                }
              },
              "leadingComments": [
                {
                  "type": "Block",
                  "value": "*\n   * Validate a Schema\n   * @param  {Schema} schema A Schema\n   * @return {ValidationResult} A ValidationResult\n   ",
                  "range": [
                    1799,
                    1920
                  ],
                  "loc": {
                    "start": {
                      "line": 66,
                      "column": 2
                    },
                    "end": {
                      "line": 70,
                      "column": 5
                    }
                  }
                }
              ],
              "trailingComments": [
                {
                  "type": "Block",
                  "value": "*\n   * Validate Changes\n   * @param  {Changes} changes A Changes array\n   * @return {ValidationResult} A ValidationResult\n   ",
                  "range": [
                    1955,
                    2084
                  ],
                  "loc": {
                    "start": {
                      "line": 74,
                      "column": 2
                    },
                    "end": {
                      "line": 78,
                      "column": 5
                    }
                  }
                }
              ],
              "static": false
            },
            {
              "type": "MethodDefinition",
              "key": {
                "type": "Identifier",
                "name": "validateChanges",
                "range": [
                  2087,
                  2102
                ],
                "loc": {
                  "start": {
                    "line": 79,
                    "column": 2
                  },
                  "end": {
                    "line": 79,
                    "column": 17
                  }
                }
              },
              "value": {
                "type": "FunctionExpression",
                "id": null,
                "params": [
                  {
                    "type": "Identifier",
                    "name": "changes",
                    "range": [
                      2103,
                      2110
                    ],
                    "loc": {
                      "start": {
                        "line": 79,
                        "column": 18
                      },
                      "end": {
                        "line": 79,
                        "column": 25
                      }
                    }
                  }
                ],
                "body": {
                  "type": "BlockStatement",
                  "body": [],
                  "range": [
                    2112,
                    2117
                  ],
                  "loc": {
                    "start": {
                      "line": 79,
                      "column": 27
                    },
                    "end": {
                      "line": 80,
                      "column": 3
                    }
                  }
                },
                "generator": false,
                "expression": false,
                "range": [
                  2102,
                  2117
                ],
                "loc": {
                  "start": {
                    "line": 79,
                    "column": 17
                  },
                  "end": {
                    "line": 80,
                    "column": 3
                  }
                }
              },
              "kind": "method",
              "computed": false,
              "range": [
                2087,
                2117
              ],
              "loc": {
                "start": {
                  "line": 79,
                  "column": 2
                },
                "end": {
                  "line": 80,
                  "column": 3
                }
              },
              "leadingComments": [
                {
                  "type": "Block",
                  "value": "*\n   * Validate Changes\n   * @param  {Changes} changes A Changes array\n   * @return {ValidationResult} A ValidationResult\n   ",
                  "range": [
                    1955,
                    2084
                  ],
                  "loc": {
                    "start": {
                      "line": 74,
                      "column": 2
                    },
                    "end": {
                      "line": 78,
                      "column": 5
                    }
                  }
                }
              ],
              "static": false
            }
          ],
          "range": [
            1573,
            2119
          ],
          "loc": {
            "start": {
              "line": 55,
              "column": 20
            },
            "end": {
              "line": 81,
              "column": 1
            }
          }
        },
        "range": [
          1553,
          2119
        ],
        "loc": {
          "start": {
            "line": 55,
            "column": 0
          },
          "end": {
            "line": 81,
            "column": 1
          }
        },
        "leadingComments": [
          {
            "type": "Block",
            "value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema            The name of the schema\n * @property {(Number|String)} version  The version of the schema\n * @property {Object} data              An object containing the data\n ",
            "range": [
              40,
              343
            ],
            "loc": {
              "start": {
                "line": 2,
                "column": 0
              },
              "end": {
                "line": 8,
                "column": 3
              }
            }
          },
          {
            "type": "Block",
            "value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name            The name of the schema\n * @property {Object} columns         An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
            "range": [
              345,
              635
            ],
            "loc": {
              "start": {
                "line": 10,
                "column": 0
              },
              "end": {
                "line": 15,
                "column": 3
              }
            }
          },
          {
            "type": "Block",
            "value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
            "range": [
              637,
              822
            ],
            "loc": {
              "start": {
                "line": 17,
                "column": 0
              },
              "end": {
                "line": 22,
                "column": 3
              }
            }
          },
          {
            "type": "Block",
            "value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
            "range": [
              824,
              914
            ],
            "loc": {
              "start": {
                "line": 24,
                "column": 0
              },
              "end": {
                "line": 27,
                "column": 3
              }
            }
          },
          {
            "type": "Block",
            "value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n *  - schema.create\n *  - schema.rename\n *  - schema.remove\n *  - column.create\n *  - column.rename\n *  - column.remove\n *  - column.typechange\n ",
            "range": [
              916,
              1322
            ],
            "loc": {
              "start": {
                "line": 29,
                "column": 0
              },
              "end": {
                "line": 42,
                "column": 3
              }
            }
          },
          {
            "type": "Block",
            "value": "*\n  * A result of the validation containing errors when failed.\n  * @typedef {Object} ValidationResult\n  ",
            "range": [
              1325,
              1434
            ],
            "loc": {
              "start": {
                "line": 44,
                "column": 1
              },
              "end": {
                "line": 47,
                "column": 4
              }
            }
          },
          {
            "type": "Block",
            "value": "*\n * A validator that can be used to validate the following objects:\n *  - DataInfo\n *  - Schema\n *  - Changes\n ",
            "range": [
              1436,
              1552
            ],
            "loc": {
              "start": {
                "line": 49,
                "column": 0
              },
              "end": {
                "line": 54,
                "column": 3
              }
            }
          }
        ],
        "__esdoc__pseudo_export": true,
        "trailingComments": []
      },
      "range": [
        2121,
        2154
      ],
      "loc": {
        "start": {
          "line": 83,
          "column": 0
        },
        "end": {
          "line": 83,
          "column": 33
        }
      },
      "leadingComments": null
    },
    {
      "type": "ExportDefaultDeclaration",
      "declaration": {
        "type": "VariableDeclaration",
        "kind": "let",
        "loc": {
          "start": {
            "line": 83,
            "column": 0
          },
          "end": {
            "line": 83,
            "column": 33
          }
        },
        "declarations": [
          {
            "type": "VariableDeclarator",
            "id": {
              "type": "Identifier",
              "name": "specValidator"
            },
            "init": {
              "type": "NewExpression",
              "callee": {
                "type": "Identifier",
                "name": "SpecValidator"
              }
            }
          }
        ],
        "leadingComments": [],
        "trailingComments": []
      },
      "range": [
        2121,
        2154
      ],
      "loc": {
        "start": {
          "line": 83,
          "column": 0
        },
        "end": {
          "line": 83,
          "column": 33
        }
      }
    }
  ],
  "sourceType": "module",
  "range": [
    0,
    2154
  ],
  "loc": {
    "start": {
      "line": 1,
      "column": 0
    },
    "end": {
      "line": 83,
      "column": 33
    }
  },
  "comments": [
    {
      "type": "Block",
      "value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema            The name of the schema\n * @property {(Number|String)} version  The version of the schema\n * @property {Object} data              An object containing the data\n ",
      "range": [
        40,
        343
      ],
      "loc": {
        "start": {
          "line": 2,
          "column": 0
        },
        "end": {
          "line": 8,
          "column": 3
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name            The name of the schema\n * @property {Object} columns         An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
      "range": [
        345,
        635
      ],
      "loc": {
        "start": {
          "line": 10,
          "column": 0
        },
        "end": {
          "line": 15,
          "column": 3
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
      "range": [
        637,
        822
      ],
      "loc": {
        "start": {
          "line": 17,
          "column": 0
        },
        "end": {
          "line": 22,
          "column": 3
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
      "range": [
        824,
        914
      ],
      "loc": {
        "start": {
          "line": 24,
          "column": 0
        },
        "end": {
          "line": 27,
          "column": 3
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n *  - schema.create\n *  - schema.rename\n *  - schema.remove\n *  - column.create\n *  - column.rename\n *  - column.remove\n *  - column.typechange\n ",
      "range": [
        916,
        1322
      ],
      "loc": {
        "start": {
          "line": 29,
          "column": 0
        },
        "end": {
          "line": 42,
          "column": 3
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n  * A result of the validation containing errors when failed.\n  * @typedef {Object} ValidationResult\n  ",
      "range": [
        1325,
        1434
      ],
      "loc": {
        "start": {
          "line": 44,
          "column": 1
        },
        "end": {
          "line": 47,
          "column": 4
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n * A validator that can be used to validate the following objects:\n *  - DataInfo\n *  - Schema\n *  - Changes\n ",
      "range": [
        1436,
        1552
      ],
      "loc": {
        "start": {
          "line": 49,
          "column": 0
        },
        "end": {
          "line": 54,
          "column": 3
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n   * Validate a DataInfo object\n   * @param  {DataInfo} dataInfo A DataInfo object\n   * @return {ValidationResult}  A ValidationResult\n   ",
      "range": [
        1577,
        1721
      ],
      "loc": {
        "start": {
          "line": 56,
          "column": 2
        },
        "end": {
          "line": 60,
          "column": 5
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n   * Validate a Schema\n   * @param  {Schema} schema A Schema\n   * @return {ValidationResult} A ValidationResult\n   ",
      "range": [
        1799,
        1920
      ],
      "loc": {
        "start": {
          "line": 66,
          "column": 2
        },
        "end": {
          "line": 70,
          "column": 5
        }
      }
    },
    {
      "type": "Block",
      "value": "*\n   * Validate Changes\n   * @param  {Changes} changes A Changes array\n   * @return {ValidationResult} A ValidationResult\n   ",
      "range": [
        1955,
        2084
      ],
      "loc": {
        "start": {
          "line": 74,
          "column": 2
        },
        "end": {
          "line": 78,
          "column": 5
        }
      }
    }
  ]
}

I am not sure why this is happening, hope you know more =)

@h13i32maru
Copy link
Member

@vespakoen Thanks this issue 😄
This is ESDoc bug and fix it!

@vespakoen
Copy link
Author

Awesome! Thanks a lot!

@h13i32maru
Copy link
Member

I publish ESDoc@0.2.0!

@vespakoen
Copy link
Author

Works great! Thanks a lot!

@h13i32maru
Copy link
Member

👍

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

No branches or pull requests

2 participants