From ded82f11cf80fa9cc43e776e6728284615e43412 Mon Sep 17 00:00:00 2001 From: Mark Griffiths <mark@thebespokepixel.com> Date: Mon, 12 Aug 2019 17:23:25 +0100 Subject: [PATCH] Update Documentation --- docs/index.html | 28 ++++++++++++++-------------- index.js | 37 ++++++++++++++++++++++++++----------- index.mjs | 37 ++++++++++++++++++++++++++----------- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 68 insertions(+), 38 deletions(-) diff --git a/docs/index.html b/docs/index.html index a1b7076..e4e60f9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="utf-8" /> - <title>@thebespokepixel/string 0.5.7 | Documentation</title> + <title>@thebespokepixel/string 0.5.8 | Documentation</title> <meta name='description' content='Esoteric string formatting'> <meta name="viewport" content="width=device-width,initial-scale=1"> <link href="assets/css/ace.min.css" rel="stylesheet"> @@ -15,7 +15,7 @@ <div id='split-left' class='overflow-auto fs0 height-viewport-100 sidebar'> <div class='py1 px2'> <h3 class="m0 no-anchor">@thebespokepixel/string</h3> - <div class="mb1"><code>0.5.7</code></div> + <div class="mb1"><code>0.5.8</code></div> <input placeholder="Filter" id="filter-input" @@ -271,7 +271,7 @@ <h3 class='left m0 panel-title' id='constructor'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L13-L15'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L13-L15'> <span>src/index.js</span> </a> @@ -339,7 +339,7 @@ <h3 class='left m0 panel-title' id='pad'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L51-L55'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L51-L55'> <span>src/index.js</span> </a> @@ -426,7 +426,7 @@ <h3 class='left m0 panel-title' id='tosub'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L61-L63'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L61-L63'> <span>src/index.js</span> </a> @@ -488,7 +488,7 @@ <h3 class='left m0 panel-title' id='tosuper'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L69-L71'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L69-L71'> <span>src/index.js</span> </a> @@ -550,7 +550,7 @@ <h3 class='left m0 panel-title' id='asemoji'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L79-L82'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L79-L82'> <span>src/index.js</span> </a> @@ -613,7 +613,7 @@ <h3 class='left m0 panel-title' id='inbox'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L89-L106'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L89-L106'> <span>src/index.js</span> </a> @@ -690,7 +690,7 @@ <h3 class='left m0 panel-title' id='bespokestring'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L122-L124'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L122-L124'> <span>src/index.js</span> </a> @@ -766,7 +766,7 @@ <h3 class='left m0 panel-title' id='pad'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L133-L135'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L133-L135'> <span>src/index.js</span> </a> @@ -860,7 +860,7 @@ <h3 class='left m0 panel-title' id='box'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L143-L145'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L143-L145'> <span>src/index.js</span> </a> @@ -945,7 +945,7 @@ <h3 class='left m0 panel-title' id='tosubscript'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L152-L154'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L152-L154'> <span>src/index.js</span> </a> @@ -1021,7 +1021,7 @@ <h3 class='left m0 panel-title' id='tosuperscript'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L161-L163'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L161-L163'> <span>src/index.js</span> </a> @@ -1097,7 +1097,7 @@ <h3 class='left m0 panel-title' id='emoji'> </h3> - <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/de9521415a3065f37f52d2801e38f27c44ff8cf6/src/index.js#L170-L172'> + <a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/35b67a86d8d10eff4303304d04815421e414df5e/src/index.js#L170-L172'> <span>src/index.js</span> </a> diff --git a/index.js b/index.js index 4e297d7..4332644 100644 --- a/index.js +++ b/index.js @@ -22,20 +22,35 @@ function _defineProperty(obj, key, value) { return obj; } -function _objectSpread(target) { +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -88,7 +103,7 @@ class BespokeString { } inBox(options = {}) { - return new BespokeString(boxen(this.valueOf(), _objectSpread({ + return new BespokeString(boxen(this.valueOf(), _objectSpread2({ borderColor: 'blue', borderStyle: 'round', dimBorder: true, diff --git a/index.mjs b/index.mjs index fc8c665..7af2ec2 100644 --- a/index.mjs +++ b/index.mjs @@ -16,20 +16,35 @@ function _defineProperty(obj, key, value) { return obj; } -function _objectSpread(target) { +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -82,7 +97,7 @@ class BespokeString { } inBox(options = {}) { - return new BespokeString(boxen(this.valueOf(), _objectSpread({ + return new BespokeString(boxen(this.valueOf(), _objectSpread2({ borderColor: 'blue', borderStyle: 'round', dimBorder: true, diff --git a/package-lock.json b/package-lock.json index e8225e9..bd1c160 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@thebespokepixel/string", - "version": "0.5.7", + "version": "0.5.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4fb609f..4aa966d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@thebespokepixel/string", - "version": "0.5.7", + "version": "0.5.8", "description": "Esoteric string formatting", "main": "index.js", "module": "index.mjs",