UNPKG

ream.js

Version:

A comprehensive, functional datetime library for JavaScript/TypeScript with immutable data structures, real IANA timezone database support, DST handling, and a plugin system

51 lines 1.78 kB
/** * Multiplies a value by 2. (Also a full example of TypeDoc's functionality.) * * ### Example (es module) * ```js * import { double } from 'typescript-starter' * console.log(double(4)) * // => 8 * ``` * * ### Example (commonjs) * ```js * var double = require('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 const double = (value) => { return value * 2; }; /** * Raise the value of the first parameter to the power of the second using the * es7 exponentiation operator (`**`). * * ### Example (es module) * ```js * import { power } from 'typescript-starter' * console.log(power(2,3)) * // => 8 * ``` * * ### Example (commonjs) * ```js * var power = require('typescript-starter').power; * console.log(power(2,3)) * // => 8 * ``` * @param base - the base to exponentiate * @param exponent - the power to which to raise the base */ export const power = (base, exponent) => { /** * This es7 exponentiation operator is transpiled by TypeScript */ return base ** exponent; }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtYmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9udW1iZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBb0JHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLENBQUMsS0FBYSxFQUFFLEVBQUU7SUFDdEMsT0FBTyxLQUFLLEdBQUcsQ0FBQyxDQUFDO0FBQ25CLENBQUMsQ0FBQztBQUVGOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLENBQUMsSUFBWSxFQUFFLFFBQWdCLEVBQUUsRUFBRTtJQUN0RDs7T0FFRztJQUNILE9BQU8sSUFBSSxJQUFJLFFBQVEsQ0FBQztBQUMxQixDQUFDLENBQUMifQ==