UNPKG

es7-typescript-starter

Version:

An es7/typescript starter for building javascript libraries

66 lines 2.18 kB
/** * Multiplies a value by 2. (Also a full example of Typedoc's functionality.) * * ### Example (es module) * ```js * import { double } from 'es7-typescript-starter' * console.log(double(4)) * // => 8 * ``` * * ### Example (commonjs) * ```js * var double = require('es7-typescript-starter').double; * console.log(double(4)) * // => 8 * ``` * * @param value Comment describing the `value` parameter. * @returns Comment describing the return type. * @anotherNote Some other value. */ /** * Multiplies a value by 2. (Also a full example of Typedoc's functionality.) * * ### Example (es module) * ```js * import { double } from 'es7-typescript-starter' * console.log(double(4)) * // => 8 * ``` * * ### Example (commonjs) * ```js * var double = require('es7-typescript-starter').double; * console.log(double(4)) * // => 8 * ``` * * @param value Comment describing the `value` parameter. * @returns Comment describing the return type. * @anotherNote Some other value. */ export function double(value) { return value * 2; } /** * Raise the value of the first parameter to the power of the second using the es7 `**` operator. * * ### Example (es module) * ```js * import { power } from 'es7-typescript-starter' * console.log(power(2,3)) * // => 8 * ``` * * ### Example (commonjs) * ```js * var power = require('es7-typescript-starter').power; * console.log(power(2,3)) * // => 8 * ``` */ export function power(base, exponent) { // This is a proposed es7 operator, which should be transpiled by Typescript return Math.pow(base, exponent); } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtYmVyT3BzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9udW1iZXJPcHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBb0JHO0FBQ0gsQUFyQkE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBb0JHLENBQ0gsTUFBTSxpQkFBa0IsS0FBYTtJQUNuQyxNQUFNLENBQUMsS0FBSyxHQUFHLENBQUMsQ0FBQTtBQUNsQixDQUFDO0FBRUQ7Ozs7Ozs7Ozs7Ozs7Ozs7R0FnQkc7QUFDSCxNQUFNLGdCQUFpQixJQUFZLEVBQUUsUUFBZ0I7SUFDbkQsNEVBQTRFO0lBQzVFLE1BQU0sQ0FBQyxTQUFBLElBQUksRUFBSSxRQUFRLENBQUEsQ0FBQTtBQUN6QixDQUFDIn0=