最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jsdoc - How to write dynamic key in nested object? - Stack Overflow

programmeradmin3浏览0评论

I had this JSDoc

    * @param {object} object
    * @param {object} object.a - comment a
    * @param {string} object.a.b - comment b
    * @param {number} object.a.c - comment c
    * @param {string} object.d - comment d

if my data like this

{
  a: {
    1: {
      b: 'text',
      c: 0
    },
    2: {
      b: 'text2',
      c: 1
    }
  },
  d: '2024-12-12'
}

What I want is to, when I hover my cursor on b and c it should display comment like a and d does.

Also 1, 2 is a dynamic key like index so if I want to add more data I write like 3, 4, 5.

发布评论

评论列表(0)

  1. 暂无评论