babel-plugin-transform-strip-amd-declarations
Strips AMD declarations to "export" inner declarations in e.g. jsdocs
Last updated 4 years ago by kirilloid .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-strip-amd-declarations 
SYNC missed versions from official npm registry.

babel-plugin-deamdify

Strips AMD declarations to "export" inner declarations with jsdocs

— hey, google closure compiler, we have written jsdocs for our AMD-based code, maybe you can validate it?

define('math', [], function () {
  /** @constructor */
  function Math () {}

  /**
   * @param {number} a
   * @param {number} b
   * @return {number}
   */
  Module.prototype.pow = function (a, b) {
    var m = 1;
    while (b--) m *= a;
    return m;
  };

  return Math;
});
define('module', ['math'], function (Math) {
  var math = new Math();

  /** @constructor */
  function Module () {}

  /**
   * @param {number} a
   * @param {number} b
   * @return {number}
   */
  Module.prototype.method = function (a, b) {
    return math.pow(a, b);
  };

  return Module;
});

— sorry, I can't validate math in the second module, because it's declared inside another scope
— Okay, I'll transform them with babel plugin for you

See discussion on stackoverflow for some more details and tests for examples of transformations

Current Tags

  • 0.0.1                                ...           latest (4 years ago)

1 Versions

  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (6)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |