UNPKG

@barguide/template

Version:
58 lines (51 loc) 1.55 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Component = {})); })(this, (function (exports) { 'use strict'; /** * @name addition * @description A very simple function that adds two numbers * @param a {number} * @param b {number} */ const addition = (a, b) => a + b; /** * @name addition * @description A very simple function that subtracts two numbers * @param a {number} * @param b {number} */ const subtraction = (a, b) => a - b; /** * @name Calculator * @description tbd... */ class Calculator { constructor(opts) { const { debug } = opts; this.debug = debug; } logger(message) { // eslint-disable-next-line no-console if (this.debug) console.log(message); } } Calculator.addition = addition; Calculator.subtraction = subtraction; const myLib = { calculator: new Calculator({ debug: false, testing: false }), numberOfGreetings: 0, makeGreeting(str) { this.numberOfGreetings += 1; return `${this.numberOfGreetings}: ${str}`; } }; exports.Calculator = Calculator; exports.myLib = myLib; Object.defineProperty(exports, '__esModule', { value: true }); }));