From 1178d0407906955a35fb8164be82823a5b55883d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 13:44:39 +0200 Subject: [PATCH] typescript(option): feat: custom toString method for better logging Signed-off-by: prescientmoon --- typescript/option/pnpm-lock.yaml | 495 +++++++++++++++++++++++++++++ typescript/option/src/internals.ts | 8 + 2 files changed, 503 insertions(+) create mode 100644 typescript/option/pnpm-lock.yaml diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml new file mode 100644 index 0000000..6b9c283 --- /dev/null +++ b/typescript/option/pnpm-lock.yaml @@ -0,0 +1,495 @@ +devDependencies: + rimraf: 3.0.0 + rollup: 1.27.13 + rollup-plugin-commonjs: 10.1.0_rollup@1.27.13 + rollup-plugin-dts: 1.1.13_rollup@1.27.13+typescript@3.7.3 + rollup-plugin-node-resolve: 5.2.0_rollup@1.27.13 + rollup-plugin-terser: 5.1.3_rollup@1.27.13 + rollup-plugin-typescript2: 0.25.3_rollup@1.27.13+typescript@3.7.3 + typescript: 3.7.3 +lockfileVersion: 5.1 +packages: + /@babel/code-frame/7.5.5: + dependencies: + '@babel/highlight': 7.5.0 + dev: true + resolution: + integrity: sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + /@babel/highlight/7.5.0: + dependencies: + chalk: 2.4.2 + esutils: 2.0.3 + js-tokens: 4.0.0 + dev: true + resolution: + integrity: sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== + /@types/estree/0.0.39: + dev: true + resolution: + integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + /@types/estree/0.0.40: + dev: true + resolution: + integrity: sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA== + /@types/node/12.12.21: + dev: true + resolution: + integrity: sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== + /@types/resolve/0.0.8: + dependencies: + '@types/node': 12.12.21 + dev: true + resolution: + integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + /acorn/7.1.0: + dev: true + engines: + node: '>=0.4.0' + hasBin: true + resolution: + integrity: sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + /ansi-styles/3.2.1: + dependencies: + color-convert: 1.9.3 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + /balanced-match/1.0.0: + dev: true + resolution: + integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + /brace-expansion/1.1.11: + dependencies: + balanced-match: 1.0.0 + concat-map: 0.0.1 + dev: true + resolution: + integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + /buffer-from/1.1.1: + dev: true + resolution: + integrity: sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + /builtin-modules/3.1.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== + /chalk/2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + /color-convert/1.9.3: + dependencies: + color-name: 1.1.3 + dev: true + resolution: + integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + /color-name/1.1.3: + dev: true + resolution: + integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + /commander/2.20.3: + dev: true + resolution: + integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + /commondir/1.0.1: + dev: true + resolution: + integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + /concat-map/0.0.1: + dev: true + resolution: + integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + /escape-string-regexp/1.0.5: + dev: true + engines: + node: '>=0.8.0' + resolution: + integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + /estree-walker/0.6.1: + dev: true + resolution: + integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + /esutils/2.0.3: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + /find-cache-dir/3.2.0: + dependencies: + commondir: 1.0.1 + make-dir: 3.0.0 + pkg-dir: 4.2.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== + /find-up/4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + /fs-extra/8.1.0: + dependencies: + graceful-fs: 4.2.3 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + engines: + node: '>=6 <7 || >=8' + resolution: + integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + /fs.realpath/1.0.0: + dev: true + resolution: + integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + /glob/7.1.6: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.0.4 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + resolution: + integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + /graceful-fs/4.2.3: + dev: true + resolution: + integrity: sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + /has-flag/3.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + /inflight/1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + resolution: + integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + /inherits/2.0.4: + dev: true + resolution: + integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + /is-module/1.0.0: + dev: true + resolution: + integrity: sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + /is-reference/1.1.4: + dependencies: + '@types/estree': 0.0.39 + dev: true + resolution: + integrity: sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw== + /jest-worker/24.9.0: + dependencies: + merge-stream: 2.0.0 + supports-color: 6.1.0 + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== + /js-tokens/4.0.0: + dev: true + resolution: + integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + /jsonfile/4.0.0: + dev: true + optionalDependencies: + graceful-fs: 4.2.3 + resolution: + integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + /locate-path/5.0.0: + dependencies: + p-locate: 4.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + /magic-string/0.25.4: + dependencies: + sourcemap-codec: 1.4.6 + dev: true + resolution: + integrity: sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw== + /make-dir/3.0.0: + dependencies: + semver: 6.3.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== + /merge-stream/2.0.0: + dev: true + resolution: + integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + /minimatch/3.0.4: + dependencies: + brace-expansion: 1.1.11 + dev: true + resolution: + integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + /once/1.4.0: + dependencies: + wrappy: 1.0.2 + dev: true + resolution: + integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + /p-limit/2.2.1: + dependencies: + p-try: 2.2.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== + /p-locate/4.1.0: + dependencies: + p-limit: 2.2.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + /p-try/2.2.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + /path-exists/4.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + /path-is-absolute/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + /path-parse/1.0.6: + dev: true + resolution: + integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + /pkg-dir/4.2.0: + dependencies: + find-up: 4.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + /resolve/1.12.0: + dependencies: + path-parse: 1.0.6 + dev: true + resolution: + integrity: sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== + /resolve/1.14.1: + dependencies: + path-parse: 1.0.6 + dev: true + resolution: + integrity: sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg== + /rimraf/3.0.0: + dependencies: + glob: 7.1.6 + dev: true + hasBin: true + resolution: + integrity: sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== + /rollup-plugin-commonjs/10.1.0_rollup@1.27.13: + dependencies: + estree-walker: 0.6.1 + is-reference: 1.1.4 + magic-string: 0.25.4 + resolve: 1.14.1 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + dev: true + peerDependencies: + rollup: '>=1.12.0' + resolution: + integrity: sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q== + /rollup-plugin-dts/1.1.13_rollup@1.27.13+typescript@3.7.3: + dependencies: + rollup: 1.27.13 + typescript: 3.7.3 + dev: true + optionalDependencies: + '@babel/code-frame': 7.5.5 + peerDependencies: + rollup: ^1.27.8 + typescript: ^3.7.3 + resolution: + integrity: sha512-vpCSjTFodt8saLkFAi/Xn7JFgs2ZnbFYRbYyirlZjQtxS81JhU7oXuuyC9UrkftIot+/JbuavPOtI9OQoVQIcQ== + /rollup-plugin-node-resolve/5.2.0_rollup@1.27.13: + dependencies: + '@types/resolve': 0.0.8 + builtin-modules: 3.1.0 + is-module: 1.0.0 + resolve: 1.14.1 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve. + dev: true + peerDependencies: + rollup: '>=1.11.0' + resolution: + integrity: sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== + /rollup-plugin-terser/5.1.3_rollup@1.27.13: + dependencies: + '@babel/code-frame': 7.5.5 + jest-worker: 24.9.0 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + serialize-javascript: 2.1.2 + terser: 4.4.3 + dev: true + peerDependencies: + rollup: '>=0.66.0 <2' + resolution: + integrity: sha512-FuFuXE5QUJ7snyxHLPp/0LFXJhdomKlIx/aK7Tg88Yubsx/UU/lmInoJafXJ4jwVVNcORJ1wRUC5T9cy5yk0wA== + /rollup-plugin-typescript2/0.25.3_rollup@1.27.13+typescript@3.7.3: + dependencies: + find-cache-dir: 3.2.0 + fs-extra: 8.1.0 + resolve: 1.12.0 + rollup: 1.27.13 + rollup-pluginutils: 2.8.1 + tslib: 1.10.0 + typescript: 3.7.3 + dev: true + peerDependencies: + rollup: '>=1.26.3' + typescript: '>=2.4.0' + resolution: + integrity: sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg== + /rollup-pluginutils/2.8.1: + dependencies: + estree-walker: 0.6.1 + dev: true + resolution: + integrity: sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg== + /rollup-pluginutils/2.8.2: + dependencies: + estree-walker: 0.6.1 + dev: true + resolution: + integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + /rollup/1.27.13: + dependencies: + '@types/estree': 0.0.40 + '@types/node': 12.12.21 + acorn: 7.1.0 + dev: true + hasBin: true + resolution: + integrity: sha512-hDi7M07MpmNSDE8YVwGVFA8L7n8jTLJ4lG65nMAijAyqBe//rtu4JdxjUBE7JqXfdpqxqDTbCDys9WcqdpsQvw== + /semver/6.3.0: + dev: true + hasBin: true + resolution: + integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + /serialize-javascript/2.1.2: + dev: true + resolution: + integrity: sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== + /source-map-support/0.5.16: + dependencies: + buffer-from: 1.1.1 + source-map: 0.6.1 + dev: true + resolution: + integrity: sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== + /source-map/0.6.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + /sourcemap-codec/1.4.6: + dev: true + resolution: + integrity: sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg== + /supports-color/5.5.0: + dependencies: + has-flag: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + /supports-color/6.1.0: + dependencies: + has-flag: 3.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + /terser/4.4.3: + dependencies: + commander: 2.20.3 + source-map: 0.6.1 + source-map-support: 0.5.16 + dev: true + engines: + node: '>=6.0.0' + hasBin: true + resolution: + integrity: sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA== + /tslib/1.10.0: + dev: true + resolution: + integrity: sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + /typescript/3.7.3: + dev: true + engines: + node: '>=4.2.0' + hasBin: true + resolution: + integrity: sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== + /universalify/0.1.2: + dev: true + engines: + node: '>= 4.0.0' + resolution: + integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + /wrappy/1.0.2: + dev: true + resolution: + integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +specifiers: + rimraf: ^3.0.0 + rollup: ^1.27.5 + rollup-plugin-commonjs: ^10.1.0 + rollup-plugin-dts: ^1.1.12 + rollup-plugin-node-resolve: ^5.2.0 + rollup-plugin-terser: ^5.1.2 + rollup-plugin-typescript2: ^0.25.2 + typescript: ^3.7.2 diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index 6e5911a..2ec597a 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -8,10 +8,18 @@ export class SomeClass { public constructor(value: T) { this[someValue] = value } + + public toString() { + return `Some(${this[someValue]})` + } } export class NoneClass { public [isOption] = true + + public toString() { + return 'None' + } } export default { NoneClass, SomeClass, isOption, someValue }