JSPM

cem-plugin-jsdoc-function

0.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 195
  • Score
    100M100P100Q90780F
  • License MIT

@function JSDoc tag for variables

Package Exports

  • cem-plugin-jsdoc-function
  • cem-plugin-jsdoc-function/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cem-plugin-jsdoc-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cem-plugin-jsdoc-function

Allows JSDoc @function tag to override variable declarations

Example

custom-elements-manifest.config.js

import { jsdocFunctionPlugin } from 'cem-plugin-jsdoc-function';

export default {
  plugins: [
    jsdocFunctionPlugin(),
  ]
}

jsdoc-function.ts

/**
 * @function
 * @template T
 * @param {T} x
 * @return T
 */
export const identity = x => x;

Output

{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "jsdoc-function.js",
      "declarations": [
        {
          "kind": "function",
          "name": "identity",
          "parameters": [
            {
              "name": "x",
              "type": {
                "text": "T"
              }
            }
          ],
          "return": {
            "type": {
              "text": ""
            }
          }
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "identity",
          "declaration": {
            "name": "identity",
            "module": "jsdoc-function.js"
          }
        }
      ]
    }
  ]
}