Skip to content

Commit 8bdfcb7

Browse files
committedNov 2, 2021
Merge branch 'release/v2.0.0'
2 parents 6c77f1c + 845f929 commit 8bdfcb7

22 files changed

+30659
-8868
lines changed
 

‎.codeclimate.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ engines:
77
- javascript
88
eslint:
99
enabled: true
10+
checks:
11+
comma-dangle:
12+
enabled: false
1013
config:
1114
config: test/fixtures/config/.eslintrc
1215
fixme:
@@ -18,5 +21,4 @@ exclude_paths:
1821
- test/
1922
- docs/
2023
- index.js
21-
- index.mjs
22-
- gulpfile.js
24+
- index.d.ts

‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/coverage
2+
/node_modules
3+
*.sublime-project
4+
*.sublime-workspace

‎.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ branches:
77
language: node_js
88
node_js:
99
- stable
10-
- 12
11-
- 10
10+
- "--lts"
1211
env:
1312
global:
1413
- CC_TEST_REPORTER_ID=40b1513b98e60239cc6d5ee9b6a98ba1cf8438189dd2066c67a75fdfb8be5cff
@@ -20,7 +19,7 @@ before_script:
2019
- chmod +x ./cc-test-reporter
2120
- ./cc-test-reporter before-build
2221
after_script:
23-
- "[ $TRAVIS_NODE_VERSION = stable ] && nyc report --reporter=lcov && ./cc-test-reporter
22+
- "[ $TRAVIS_NODE_VERSION = stable ] && c8 report --reporter=lcov --reporter=text && ./cc-test-reporter
2423
after-build --debug -t lcov --exit-code $TRAVIS_TEST_RESULT || echo 'Coverage skipped'"
2524
notifications:
2625
slack:

‎ava.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = {
2+
files: ['test/*.js'],
3+
}
4+
5+
export default config

‎docs/assets/css/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/assets/js/anchor.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/assets/js/site.js

+154-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,154 @@
1-
!function(){"use strict";function u(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(a)throw i}}}}anchors.options.placement="left",anchors.add("h3").remove(".no-anchor");var d=document.querySelector("#toc").querySelectorAll("li");document.querySelector("#filter-input").addEventListener("keyup",function(e){if("Enter"===e.key){var t,n=f(d);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!r.classList.contains("display-none"))return location.replace(r.firstChild.href),e.preventDefault()}}catch(e){n.e(e)}finally{n.f()}}var o=function(){return!0},i=document.querySelector("#filter-input").value.toLowerCase();i.match(/^\s*$/)||(o=function(e){return e.firstChild.innerHTML&&e.firstChild.innerHTML.toLowerCase().includes(i)});var l,a=f(d);try{for(a.s();!(l=a.n()).done;){var s=l.value,c=u(s.querySelectorAll("li"));o(s)||c.some(function(e){return o(e)})?s.classList.remove("display-none"):s.classList.add("display-none")}}catch(e){a.e(e)}finally{a.f()}});var e,t=f(document.querySelectorAll(".toggle-sibling"));try{for(t.s();!(e=t.n()).done;){e.value.addEventListener("click",n)}}catch(e){t.e(e)}finally{t.f()}function n(){var e=this.parentNode.querySelectorAll(".toggle-target")[0],t=this.querySelectorAll(".icon")[0],n="display-none";e.classList.contains(n)?(e.classList.remove(n),t.innerHTML="▾"):(e.classList.add(n),t.innerHTML="▸")}function o(e){var t=document.getElementById(e);t&&0===t.offsetHeight&&t.parentNode.parentNode.classList.contains("display-none")&&t.parentNode.parentNode.classList.remove("display-none")}window.addEventListener("hashchange",function(){o(location.hash.slice(1))}),o(location.hash.slice(1));var i,l=f(document.querySelectorAll(".pre-open"));try{for(l.s();!(i=l.n()).done;){i.value.addEventListener("mousedown",a,!1)}}catch(e){l.e(e)}finally{l.f()}function a(){o(this.hash.slice(1))}var c=document.querySelector("#split-left"),y=document.querySelector("#split-right");function p(){history.replaceState({leftTop:c.scrollTop,rightTop:y.scrollTop},document.title)}function h(e){e&&history.replaceState(e.state,document.title),history.state&&(c.scrollTop=history.state.leftTop,y.scrollTop=history.state.rightTop)}c.style.overflow="hidden",c.style.overflow="",Split(["#split-left","#split-right"],{elementStyle:function(e,t,n){return{"flex-basis":"calc("+t+"% - "+n+"px)"}},gutterStyle:function(e,t){return{"flex-basis":t+"px"}},gutterSize:20,sizes:[20,80]}),window.addEventListener("load",function(){setTimeout(function(){h(),p(),c.addEventListener("scroll",p),y.addEventListener("scroll",p)},1)}),window.addEventListener("popstate",h)}();
1+
(function () {
2+
'use strict';
3+
4+
/* eslint-env browser */
5+
/* eslint new-cap:0,no-undef:0,unicorn/prefer-query-selector:0 */
6+
/* global anchors */
7+
8+
// add anchor links to headers
9+
anchors.options.placement = 'left';
10+
anchors.add('h3').remove('.no-anchor');
11+
12+
// Filter UI
13+
const tocElements = document.querySelector('#toc').querySelectorAll('li');
14+
15+
document.querySelector('#filter-input').addEventListener('keyup', event_ => {
16+
// Enter key
17+
if (event_.key === 'Enter') {
18+
// Go to the first displayed item in the toc
19+
for (const element of tocElements) {
20+
if (!element.classList.contains('display-none')) {
21+
location.replace(element.firstChild.href);
22+
return event_.preventDefault()
23+
}
24+
}
25+
}
26+
27+
let match = () => true;
28+
29+
const value = document.querySelector('#filter-input').value.toLowerCase();
30+
31+
if (!/^\s*$/.test(value)) {
32+
match = element =>
33+
element.firstChild.innerHTML
34+
&& element.firstChild.innerHTML.toLowerCase().includes(value);
35+
}
36+
37+
for (const element of tocElements) {
38+
const children = [...element.querySelectorAll('li')];
39+
if (match(element) || children.some(child => match(child))) {
40+
element.classList.remove('display-none');
41+
} else {
42+
element.classList.add('display-none');
43+
}
44+
}
45+
});
46+
47+
const toggles = document.querySelectorAll('.toggle-sibling');
48+
49+
for (const toggle of toggles) {
50+
toggle.addEventListener('click', toggleSibling);
51+
}
52+
53+
function toggleSibling() {
54+
const stepSibling = this.parentNode.querySelectorAll('.toggle-target')[0];
55+
const icon = this.querySelectorAll('.icon')[0];
56+
const klass = 'display-none';
57+
if (stepSibling.classList.contains(klass)) {
58+
stepSibling.classList.remove(klass);
59+
icon.innerHTML = '▾';
60+
} else {
61+
stepSibling.classList.add(klass);
62+
icon.innerHTML = '▸';
63+
}
64+
}
65+
66+
function showHashTarget(targetId) {
67+
const hashTarget = document.getElementById(targetId);
68+
// New target is hidden
69+
if (hashTarget && hashTarget.offsetHeight === 0
70+
&& hashTarget.parentNode.parentNode.classList.contains('display-none')) {
71+
hashTarget.parentNode.parentNode.classList.remove('display-none');
72+
}
73+
}
74+
75+
window.addEventListener('hashchange', () => {
76+
showHashTarget(location.hash.slice(1));
77+
});
78+
79+
showHashTarget(location.hash.slice(1));
80+
81+
const toclinks = document.querySelectorAll('.pre-open');
82+
83+
for (const toclink of toclinks) {
84+
toclink.addEventListener('mousedown', preOpen, false);
85+
}
86+
87+
function preOpen() {
88+
showHashTarget(this.hash.slice(1));
89+
}
90+
91+
const splitLeft = document.querySelector('#split-left');
92+
const splitRight = document.querySelector('#split-right');
93+
// TODO const splitParent = splitLeft.parentNode
94+
// TODO const cwWithSb = splitLeft.clientWidth
95+
splitLeft.style.overflow = 'hidden';
96+
// TODO const cwWithoutSb = splitLeft.clientWidth
97+
splitLeft.style.overflow = '';
98+
99+
Split(['#split-left', '#split-right'], {
100+
elementStyle(dimension, size, gutterSize) {
101+
return {
102+
'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)',
103+
}
104+
},
105+
gutterStyle(dimension, gutterSize) {
106+
return {
107+
'flex-basis': gutterSize + 'px',
108+
}
109+
},
110+
gutterSize: 20,
111+
sizes: [20, 80],
112+
});
113+
114+
// Chrome doesn't remember scroll position properly so do it ourselves.
115+
// Also works on Firefox and Edge.
116+
117+
function updateState() {
118+
history.replaceState(
119+
{
120+
leftTop: splitLeft.scrollTop,
121+
rightTop: splitRight.scrollTop,
122+
},
123+
document.title,
124+
);
125+
}
126+
127+
function loadState(ev) {
128+
if (ev) {
129+
// Edge doesn't replace change history.state on popstate.
130+
history.replaceState(ev.state, document.title);
131+
}
132+
133+
if (history.state) {
134+
splitLeft.scrollTop = history.state.leftTop;
135+
splitRight.scrollTop = history.state.rightTop;
136+
}
137+
}
138+
139+
window.addEventListener('load', () => {
140+
// Restore after Firefox scrolls to hash.
141+
setTimeout(() => {
142+
loadState();
143+
// Update with initial scroll position.
144+
updateState();
145+
// Update scroll positions only after we've loaded because Firefox
146+
// emits an initial scroll event with 0.
147+
splitLeft.addEventListener('scroll', updateState);
148+
splitRight.addEventListener('scroll', updateState);
149+
}, 1);
150+
});
151+
152+
window.addEventListener('popstate', loadState);
153+
154+
})();

‎docs/assets/js/split.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/index.html

+21-23
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>@thebespokepixel/string 1.0.3 | Documentation</title>
5+
<title>@thebespokepixel/string 2.0.0 | Documentation</title>
66
<meta name='description' content='Esoteric string formatting'>
77
<meta name="viewport" content="width=device-width,initial-scale=1">
88
<link href="assets/css/ace.min.css" rel="stylesheet">
@@ -15,7 +15,7 @@
1515
<div id='split-left' class='overflow-auto fs0 height-viewport-100 sidebar'>
1616
<div class='py1 px2'>
1717
<h3 class="m0 no-anchor">@thebespokepixel/string</h3>
18-
<div class="mb1"><code>1.0.3</code></div>
18+
<div class="mb1"><code>2.0.0</code></div>
1919
<input
2020
placeholder="Filter"
2121
id="filter-input"
@@ -166,11 +166,11 @@ <h3 class="m0 no-anchor">@thebespokepixel/string</h3>
166166

167167
</ul>
168168
</div>
169-
<div class="badges"><p><p><a href="https://github.com/thebespokepixel/string" title="Github"><img src="https://img.shields.io/badge/github-source-4E73B6" alt="Github"></a> <a href="https://travis-ci.org/thebespokepixel/string" title="Travis"><img src="https://img.shields.io/travis/thebespokepixel/string/master?logo=travis" alt="Travis"></a> <br>
170-
</p> <p><a href="https://codeclimate.com/github/thebespokepixel/string/maintainability" title="Code-climate"><img src="https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/maintainability" alt="Code-climate"></a> <a href="https://codeclimate.com/github/thebespokepixel/string/test_coverage" title="Coverage"><img src="https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/test_coverage" alt="Coverage"></a> <br>
171-
</p> <p><a href="https://snyk.io/test/github/thebespokepixel/string" title="Snyk"><img src="https://snyk.io/test/github/thebespokepixel/string/badge.svg" alt="Snyk"></a> <a href="https://david-dm.org/thebespokepixel/string/master" title="David"><img src="https://david-dm.org/thebespokepixel/string/master/status.svg" alt="David"></a> <br>
172-
</p> <br>
173-
</p></div>
169+
<div class="badges"><p><p><p><a href="https://github.com/thebespokepixel/string" title="github"><img src="https://img.shields.io/badge/github-source-4E73B6" alt="github" title="github"></a> </p><p><a href="https://travis-ci.com/thebespokepixel/string" title="Travis"><img src="https://img.shields.io/travis/com/thebespokepixel/string/master?logo=travis" alt="Travis" title="Travis"></a> </p><br>
170+
</p><p><p><a href="https://codeclimate.com/github/thebespokepixel/string/maintainability" title="Code-Climate"><img src="https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/maintainability" alt="Code-Climate" title="Code-Climate"></a> </p><p><a href="https://codeclimate.com/github/thebespokepixel/string/test_coverage" title="Code-Climate Coverage"><img src="https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/test_coverage" alt="Code-Climate Coverage" title="Code-Climate Coverage"></a> </p><br>
171+
</p><p><p><a href="https://snyk.io/test/github/thebespokepixel/string" title="Snyk"><img src="https://snyk.io/test/github/thebespokepixel/string/badge.svg" alt="Snyk" title="Snyk"></a> </p><p><a href="https://libraries.io/github/thebespokepixel/string" title="Libraries.io"><img src="https://img.shields.io/librariesio/release/npm/@thebespokepixel/string/latest?&#x26;logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01Ljk5OTMxNDIyLDE1LjI3NyBMNiwyMyBDNiwyMy41NTIyODQ3IDUuNTUyMjg0NzUsMjQgNSwyNCBMMiwyNCBDMS40NDc3MTUyNSwyNCAxLDIzLjU1MjI4NDcgMSwyMyBMMC45OTkzMTQyMjIsMTkuMTg0IEw1Ljk5OTMxNDIyLDE1LjI3NyBaIE0xNC40OTkzMTQyLDguNjM2IEwxNC41LDIzIEMxNC41LDIzLjU1MjI4NDcgMTQuMDUyMjg0NywyNCAxMy41LDI0IEwxMC41LDI0IEM5Ljk0NzcxNTI1LDI0IDkuNSwyMy41NTIyODQ3IDkuNSwyMyBMOS40OTkzMTQyMiwxMi41NDMgTDE0LjQ5OTMxNDIsOC42MzYgWiBNMTcuOTk5MzE0Miw4LjMzNCBMMjIuOTk5MzE0MiwxMi4xMDIgTDIzLDIzIEMyMywyMy41NTIyODQ3IDIyLjU1MjI4NDcsMjQgMjIsMjQgTDE5LDI0IEMxOC40NDc3MTUzLDI0IDE4LDIzLjU1MjI4NDcgMTgsMjMgTDE3Ljk5OTMxNDIsOC4zMzQgWiBNNSwwIEM1LjU1MjI4NDc1LDAgNiwwLjQ0NzcxNTI1IDYsMSBMNS45OTkzMTQyMiwxMS40NzEgTDAuOTk5MzE0MjIyLDE1LjM3OCBMMSwxIEMxLDAuNDQ3NzE1MjUgMS40NDc3MTUyNSwwIDIsMCBMNSwwIFogTTEzLjUsMCBDMTQuMDUyMjg0NywwIDE0LjUsMC40NDc3MTUyNSAxNC41LDEgTDE0LjQ5OTMxNDIsNC44MzEgTDkuNDk5MzE0MjIsOC43MzcgTDkuNSwxIEM5LjUsMC40NDc3MTUyNSA5Ljk0NzcxNTI1LDAgMTAuNSwwIEwxMy41LDAgWiBNMjIsMCBDMjIuNTUyMjg0NywwIDIzLDAuNDQ3NzE1MjUgMjMsMSBMMjIuOTk5MzE0Miw4LjM0NyBMMTcuOTk5MzE0Miw0LjU3OSBMMTgsMSBDMTgsMC40NDc3MTUyNSAxOC40NDc3MTUzLDAgMTksMCBMMjIsMCBaIi8%2BCjwvc3ZnPgo%3D" alt="Libraries.io" title="Libraries.io"></a> </p><br>
172+
</p></p>
173+
</div>
174174
<div class="mt1 h6 quiet">
175175
<a href="http://documentation.js.org/reading-documentation.html">Need help reading this?</a>
176176
</div>
@@ -188,15 +188,14 @@ <h2 id="usage" class="m0">
188188
</h2>
189189

190190

191-
192191

193192

194193
<h4>Installation</h4>
195194
<pre class='hljs'>npm install --save @thebespokepixel/string</pre>
196195
<h4>Example</h4>
197-
<pre class='hljs'><span class="hljs-keyword">const</span> bString = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@thebespokepixel/string'</span>)
196+
<pre class='hljs'><span class="hljs-keyword">const</span> bString = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;@thebespokepixel/string&#x27;</span>)
198197

199-
<span class="hljs-built_in">console</span>.log(bString.subScript(<span class="hljs-string">'String to print'</span>))</pre>
198+
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(bString.<span class="hljs-title function_">subScript</span>(<span class="hljs-string">&#x27;String to print&#x27;</span>))</pre>
200199
<h4>.pad(string, char, length)</h4>
201200
<p>Pads <code>string</code>, using <code>char</code> to <code>length</code> characters. If length is negative, pads the right rather than the left of <code>string</code>. If length is less than <code>string.length</code>, it will crop <code>string</code> to fit.</p>
202201
<h4>.toSuperscript(string) | .toSubscript(string)</h4>
@@ -251,7 +250,6 @@ <h2 id="api" class="m0">
251250
</h2>
252251

253252

254-
255253

256254

257255
</section>
@@ -270,7 +268,7 @@ <h3 class='left m0 panel-title' id='constructor'>
270268
</h3>
271269

272270

273-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L13-L15'>
271+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L13-L15'>
274272
<span>src/index.js</span>
275273
</a>
276274

@@ -338,7 +336,7 @@ <h3 class='left m0 panel-title' id='pad'>
338336
</h3>
339337

340338

341-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L51-L55'>
339+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L51-L55'>
342340
<span>src/index.js</span>
343341
</a>
344342

@@ -425,7 +423,7 @@ <h3 class='left m0 panel-title' id='tosub'>
425423
</h3>
426424

427425

428-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L61-L63'>
426+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L61-L63'>
429427
<span>src/index.js</span>
430428
</a>
431429

@@ -487,7 +485,7 @@ <h3 class='left m0 panel-title' id='tosuper'>
487485
</h3>
488486

489487

490-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L69-L71'>
488+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L69-L71'>
491489
<span>src/index.js</span>
492490
</a>
493491

@@ -549,7 +547,7 @@ <h3 class='left m0 panel-title' id='asemoji'>
549547
</h3>
550548

551549

552-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L79-L82'>
550+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L79-L82'>
553551
<span>src/index.js</span>
554552
</a>
555553

@@ -612,7 +610,7 @@ <h3 class='left m0 panel-title' id='inbox'>
612610
</h3>
613611

614612

615-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L89-L106'>
613+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L89-L106'>
616614
<span>src/index.js</span>
617615
</a>
618616

@@ -689,7 +687,7 @@ <h3 class='left m0 panel-title' id='bespokestring'>
689687
</h3>
690688

691689

692-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L122-L124'>
690+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L122-L124'>
693691
<span>src/index.js</span>
694692
</a>
695693

@@ -765,7 +763,7 @@ <h3 class='left m0 panel-title' id='pad'>
765763
</h3>
766764

767765

768-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L133-L135'>
766+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L133-L135'>
769767
<span>src/index.js</span>
770768
</a>
771769

@@ -859,7 +857,7 @@ <h3 class='left m0 panel-title' id='box'>
859857
</h3>
860858

861859

862-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L143-L145'>
860+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L143-L145'>
863861
<span>src/index.js</span>
864862
</a>
865863

@@ -944,7 +942,7 @@ <h3 class='left m0 panel-title' id='tosubscript'>
944942
</h3>
945943

946944

947-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L152-L154'>
945+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L152-L154'>
948946
<span>src/index.js</span>
949947
</a>
950948

@@ -1020,7 +1018,7 @@ <h3 class='left m0 panel-title' id='tosuperscript'>
10201018
</h3>
10211019

10221020

1023-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L161-L163'>
1021+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L161-L163'>
10241022
<span>src/index.js</span>
10251023
</a>
10261024

@@ -1096,7 +1094,7 @@ <h3 class='left m0 panel-title' id='emoji'>
10961094
</h3>
10971095

10981096

1099-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L170-L172'>
1097+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/595934c88d4bfa3bb6a543f662f53935aa17385b/src/index.js#L170-L172'>
11001098
<span>src/index.js</span>
11011099
</a>
11021100

‎gulpfile.js

-47
This file was deleted.

‎index.d.ts

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
export class BespokeString {
2+
/**
3+
* Contruct a BespokeString instance.
4+
* @param {String} content The string content.
5+
*/
6+
constructor(content: string);
7+
_string: string;
8+
charSets(set_: any): any;
9+
original(original_: any): BespokeString;
10+
_original: any;
11+
typist(printer_: any): any;
12+
toSuperSub(set: any): BespokeString;
13+
/**
14+
* Pad the contents.
15+
* @param {Number} length [description]
16+
* @param {String} char [description]
17+
* @return {BespokeString} A BespokeString instance.
18+
*/
19+
pad(length?: number, char?: string): BespokeString;
20+
/**
21+
* Transform the contents to subscript characters.
22+
* @return {BespokeString} A BespokeString instance.
23+
*/
24+
toSub(): BespokeString;
25+
/**
26+
* Transform the contents to superscript characters.
27+
* @return {BespokeString} A BespokeString instance.
28+
*/
29+
toSuper(): BespokeString;
30+
/**
31+
* Print Emoji characters.
32+
*
33+
* Totally naïve implentation right now, just pad wide emoji chars with a space.
34+
* @return {BespokeString} A BespokeString instance.
35+
*/
36+
asEmoji(): BespokeString;
37+
/**
38+
* Print the content as a graphic box.
39+
* @param {Object} options Boxen options.
40+
* @return {BespokeString} A BespokeString instance.
41+
*/
42+
inBox(options?: any): BespokeString;
43+
valueOf(): string;
44+
toString(): string;
45+
}
46+
/**
47+
* Helper method for creating a BespokeString instance
48+
* @param {String} content - String content.
49+
* @return {BespokeString} A BespokeString instance.
50+
*/
51+
export function bespokeString(content: string): BespokeString;
52+
/**
53+
* Helper method for creating a visual box (using boxen)
54+
* @param {String} content Box content.
55+
* @param {Object} options Boxen options.
56+
* @return {String} The contructed box.
57+
*/
58+
export function box(content: string, options: any): string;
59+
/**
60+
* Helper method from creating a wide Emoji character.
61+
* @param {String} content The emoji to print.
62+
* @return {String} The Emoji string.
63+
*/
64+
export function emoji(content: string): string;
65+
/**
66+
* Helper method for padding a string.
67+
* @param {String} content The string to pad.
68+
* @param {Number} length Target length.
69+
* @param {String} char Character to use for pad.
70+
* @return {String} The padded string.
71+
*/
72+
export function pad(content: string, length: number, char: string): string;
73+
/**
74+
* Helper method from creating a simple Unicode subscript representation.
75+
* @param {String} content The string to transform to subscript.
76+
* @return {String} The subscript string.
77+
*/
78+
export function toSubscript(content: string): string;
79+
/**
80+
* Helper method from creating a simple Unicode superscript representation.
81+
* @param {String} content The string to transform to superscript.
82+
* @return {String} The superscript string.
83+
*/
84+
export function toSuperscript(content: string): string;

‎index.js

+136-147
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,152 @@
1-
'use strict';
2-
3-
Object.defineProperty(exports, '__esModule', { value: true });
4-
5-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6-
7-
var termNG = _interopDefault(require('term-ng'));
8-
var boxen = _interopDefault(require('boxen'));
9-
10-
function _defineProperty(obj, key, value) {
11-
if (key in obj) {
12-
Object.defineProperty(obj, key, {
13-
value: value,
14-
enumerable: true,
15-
configurable: true,
16-
writable: true
17-
});
18-
} else {
19-
obj[key] = value;
20-
}
21-
22-
return obj;
23-
}
24-
25-
function ownKeys(object, enumerableOnly) {
26-
var keys = Object.keys(object);
27-
28-
if (Object.getOwnPropertySymbols) {
29-
var symbols = Object.getOwnPropertySymbols(object);
30-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
31-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
32-
});
33-
keys.push.apply(keys, symbols);
34-
}
35-
36-
return keys;
37-
}
38-
39-
function _objectSpread2(target) {
40-
for (var i = 1; i < arguments.length; i++) {
41-
var source = arguments[i] != null ? arguments[i] : {};
42-
43-
if (i % 2) {
44-
ownKeys(Object(source), true).forEach(function (key) {
45-
_defineProperty(target, key, source[key]);
46-
});
47-
} else if (Object.getOwnPropertyDescriptors) {
48-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
49-
} else {
50-
ownKeys(Object(source)).forEach(function (key) {
51-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
52-
});
53-
}
54-
}
55-
56-
return target;
57-
}
1+
import termNG from 'term-ng';
2+
import boxen from 'boxen';
583

594
class BespokeString {
60-
constructor(content) {
61-
this._string = String(content);
62-
}
63-
64-
charSets(set_) {
65-
return {
66-
basic: '0123456789+-=:. abcdefghijklmnopqrstuvwxyz()ABCDEFGHIJKLMNOPQRSTUVWXYZ/|',
67-
super: '⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁼⋅ ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵍʳˢᵗᵘᵛʷˣʸᶻ⁽⁾ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴼᴿˢᵀᵁⱽᵂˣʸᶻ╵╵',
68-
sub: '₀₁₂₃₄₅₆₇₈₉₊₋₌₌. ₐₓₓₓₑₓₓₕᵢⱼₖₗₘₙₒₚₓᵣₛₜᵤᵥₓₓₓₓ₍₎ᴀʙcᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ╷╷'
69-
}[set_];
70-
}
71-
72-
original(original_) {
73-
this._original = original_._original ? original_._original : original_;
74-
return this;
75-
}
76-
77-
typist(printer_) {
78-
return (this._original ? this._original.valueOf() : this.valueOf()).split('').map(char_ => printer_(char_)).join('');
79-
}
80-
81-
toSuperSub(set) {
82-
const setOut = termNG.font.enhanced ? this.charSets(set) : this.charSets('basic');
83-
return new BespokeString(this.typist(char_ => {
84-
const subIndx = this.charSets('basic').indexOf(char_);
85-
return subIndx >= 0 ? setOut[subIndx] : char_;
86-
})).original(this);
87-
}
88-
89-
pad(length = 8, char = ' ') {
90-
return new BespokeString(length > 0 ? (this + char.repeat(length)).slice(0, length) : (char.repeat(-length) + this).slice(length));
91-
}
92-
93-
toSub() {
94-
return this.toSuperSub('sub');
95-
}
96-
97-
toSuper() {
98-
return this.toSuperSub('super');
99-
}
100-
101-
asEmoji() {
102-
return new BespokeString(`${this} `).original(this);
103-
}
104-
105-
inBox(options = {}) {
106-
return new BespokeString(boxen(this.valueOf(), _objectSpread2({
107-
borderColor: 'blue',
108-
borderStyle: 'round',
109-
dimBorder: true,
110-
padding: {
111-
left: 3,
112-
right: 3
113-
},
114-
margin: {
115-
top: 1,
116-
bottom: 1,
117-
left: 1,
118-
right: 1
119-
}
120-
}, options)), this);
121-
}
122-
123-
valueOf() {
124-
return this._string;
125-
}
126-
127-
toString() {
128-
return this._string.toString();
129-
}
130-
5+
/**
6+
* Contruct a BespokeString instance.
7+
* @param {String} content The string content.
8+
*/
9+
constructor(content) {
10+
this._string = String(content);
11+
}
12+
charSets(set_) {
13+
return {
14+
basic: '0123456789+-=:. abcdefghijklmnopqrstuvwxyz()ABCDEFGHIJKLMNOPQRSTUVWXYZ/|',
15+
super: '⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁼⋅ ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵍʳˢᵗᵘᵛʷˣʸᶻ⁽⁾ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴼᴿˢᵀᵁⱽᵂˣʸᶻ╵╵',
16+
sub: '₀₁₂₃₄₅₆₇₈₉₊₋₌₌. ₐₓₓₓₑₓₓₕᵢⱼₖₗₘₙₒₚₓᵣₛₜᵤᵥₓₓₓₓ₍₎ᴀʙcᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ╷╷'
17+
}[set_]
18+
}
19+
original(original_) {
20+
this._original = original_._original ? original_._original : original_;
21+
return this
22+
}
23+
typist(printer_) {
24+
return (this._original ? this._original.valueOf() : this.valueOf())
25+
.split('')
26+
.map(char_ => printer_(char_))
27+
.join('')
28+
}
29+
toSuperSub(set) {
30+
const setOut = termNG.font.enhanced ? this.charSets(set) : this.charSets('basic');
31+
return new BespokeString(this.typist(char_ => {
32+
const subIndx = this.charSets('basic').indexOf(char_);
33+
return subIndx >= 0 ? setOut[subIndx] : char_
34+
})).original(this)
35+
}
36+
/**
37+
* Pad the contents.
38+
* @param {Number} length [description]
39+
* @param {String} char [description]
40+
* @return {BespokeString} A BespokeString instance.
41+
*/
42+
pad(length = 8, char = ' ') {
43+
return new BespokeString((length > 0) ?
44+
(this + char.repeat(length)).slice(0, length) :
45+
(char.repeat(-length) + this).slice(length))
46+
}
47+
/**
48+
* Transform the contents to subscript characters.
49+
* @return {BespokeString} A BespokeString instance.
50+
*/
51+
toSub() {
52+
return this.toSuperSub('sub')
53+
}
54+
/**
55+
* Transform the contents to superscript characters.
56+
* @return {BespokeString} A BespokeString instance.
57+
*/
58+
toSuper() {
59+
return this.toSuperSub('super')
60+
}
61+
/**
62+
* Print Emoji characters.
63+
*
64+
* Totally naïve implentation right now, just pad wide emoji chars with a space.
65+
* @return {BespokeString} A BespokeString instance.
66+
*/
67+
asEmoji() {
68+
return new BespokeString(`${this} `).original(this)
69+
}
70+
/**
71+
* Print the content as a graphic box.
72+
* @param {Object} options Boxen options.
73+
* @return {BespokeString} A BespokeString instance.
74+
*/
75+
inBox(options = {}) {
76+
return new BespokeString(boxen(this.valueOf(), {
77+
borderColor: 'blue',
78+
borderStyle: 'round',
79+
dimBorder: true,
80+
padding: {
81+
left: 3,
82+
right: 3
83+
},
84+
margin: {
85+
top: 1,
86+
bottom: 1,
87+
left: 1,
88+
right: 1
89+
},
90+
...options
91+
}), this)
92+
}
93+
valueOf() {
94+
return this._string
95+
}
96+
toString() {
97+
return this._string.toString()
98+
}
13199
}
132-
100+
/**
101+
* Helper method for creating a BespokeString instance
102+
* @param {String} content - String content.
103+
* @return {BespokeString} A BespokeString instance.
104+
*/
133105
function bespokeString(content) {
134-
return new BespokeString(content);
106+
return new BespokeString(content)
135107
}
136-
108+
/**
109+
* Helper method for padding a string.
110+
* @param {String} content The string to pad.
111+
* @param {Number} length Target length.
112+
* @param {String} char Character to use for pad.
113+
* @return {String} The padded string.
114+
*/
137115
function pad(content, length, char) {
138-
return new BespokeString(content).pad(length, char).toString();
116+
return new BespokeString(content).pad(length, char).toString()
139117
}
140-
118+
/**
119+
* Helper method for creating a visual box (using boxen)
120+
* @param {String} content Box content.
121+
* @param {Object} options Boxen options.
122+
* @return {String} The contructed box.
123+
*/
141124
function box(content, options) {
142-
return bespokeString(content).inBox(options).toString();
125+
return bespokeString(content).inBox(options).toString()
143126
}
144-
127+
/**
128+
* Helper method from creating a simple Unicode subscript representation.
129+
* @param {String} content The string to transform to subscript.
130+
* @return {String} The subscript string.
131+
*/
145132
function toSubscript(content) {
146-
return bespokeString(content).toSub().toString();
133+
return bespokeString(content).toSub().toString()
147134
}
148-
135+
/**
136+
* Helper method from creating a simple Unicode superscript representation.
137+
* @param {String} content The string to transform to superscript.
138+
* @return {String} The superscript string.
139+
*/
149140
function toSuperscript(content) {
150-
return bespokeString(content).toSuper().toString();
141+
return bespokeString(content).toSuper().toString()
151142
}
152-
143+
/**
144+
* Helper method from creating a wide Emoji character.
145+
* @param {String} content The emoji to print.
146+
* @return {String} The Emoji string.
147+
*/
153148
function emoji(content) {
154-
return bespokeString(content).asEmoji().toString();
149+
return bespokeString(content).asEmoji().toString()
155150
}
156151

157-
exports.BespokeString = BespokeString;
158-
exports.bespokeString = bespokeString;
159-
exports.box = box;
160-
exports.emoji = emoji;
161-
exports.pad = pad;
162-
exports.toSubscript = toSubscript;
163-
exports.toSuperscript = toSuperscript;
152+
export { BespokeString, bespokeString, box, emoji, pad, toSubscript, toSuperscript };

‎index.mjs

-151
This file was deleted.

‎license

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Mark Griffiths
3+
Copyright (c) 2021 Mark Griffiths
44

55
Permission is hereby granted, free of charge, to any person
66
obtaining a copy of this software and associated documentation

‎package-lock.json

+30,182-8,435
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+25-34
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
11
{
22
"name": "@thebespokepixel/string",
3-
"version": "1.0.3",
3+
"version": "2.0.0",
44
"description": "Esoteric string formatting",
55
"main": "index.js",
6-
"module": "index.mjs",
6+
"types": "index.d.ts",
7+
"type": "module",
78
"files": [
89
"index.js",
9-
"index.mjs"
10+
"index.d.ts"
1011
],
1112
"dependencies": {
12-
"boxen": "^4.2.0",
13-
"term-ng": "^2.0.1"
13+
"boxen": "^6.2.1",
14+
"term-ng": "^3.0.1"
1415
},
1516
"devDependencies": {
16-
"@ava/babel": "^1.0.1",
17-
"@babel/core": "^7.10.5",
18-
"@babel/preset-env": "^7.10.4",
19-
"ava": "^3.10.1",
20-
"documentation-theme-bespoke": "^1.1.6",
21-
"gulp": "^4.0.2",
22-
"gulp-better-rollup": "^4.0.1",
23-
"gulp-rename": "^2.0.0",
24-
"gulp-strip-comments": "^2.5.2",
25-
"nyc": "^15.1.0",
26-
"rollup": "^2.21.0",
27-
"rollup-plugin-babel": "^4.4.0",
28-
"rollup-plugin-commonjs": "^10.1.0",
29-
"rollup-plugin-node-resolve": "^5.2.0",
30-
"xo": "^0.32.1"
17+
"@rollup/plugin-commonjs": "^21.0.1",
18+
"@rollup/plugin-node-resolve": "^13.0.6",
19+
"@types/estree": "^0.0.50",
20+
"ava": "^4.0.0-rc.1",
21+
"c8": "^7.10.0",
22+
"documentation-theme-bespoke": "^2.0.12",
23+
"rollup": "^2.59.0",
24+
"rollup-plugin-cleanup": "^3.2.1",
25+
"xo": "^0.46.3"
3126
},
3227
"scripts": {
33-
"test": "xo && nyc ava",
28+
"build": "rollup -c && npm run readme",
29+
"test": "xo && c8 --reporter=text ava",
3430
"doc-serve": "documentation serve --watch --theme node_modules/documentation-theme-bespoke --github --config src/docs/documentation.yml --project-name $npm_package_name --project-version $npm_package_version src/index.js",
3531
"doc-build": "documentation build --format html --output docs --theme node_modules/documentation-theme-bespoke --github --config src/docs/documentation.yml --project-name $npm_package_name --project-version $npm_package_version src/index.js",
3632
"readme": "compile-readme -u src/docs/example.md src/docs/readme.md > readme.md",
37-
"coverage": "nyc ava && nyc report --reporter=lcov --report-dir test/coverage; open test/coverage/lcov-report/index.html"
33+
"coverage": "c8 --reporter=lcov ava; open coverage/lcov-report/index.html",
34+
"prepublishOnly": "npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly"
3835
},
3936
"repository": {
4037
"type": "git",
@@ -60,20 +57,15 @@
6057
"esnext": true,
6158
"ignores": [
6259
"index.js",
63-
"index.mjs",
60+
"index.d.ts",
6461
"docs/**",
65-
"test/coverage/**"
66-
]
67-
},
68-
"ava": {
69-
"babel": true,
70-
"files": [
71-
"test/*.js"
62+
"coverage/**"
7263
]
7364
},
7465
"badges": {
7566
"github": "thebespokepixel",
7667
"npm": "thebespokepixel",
68+
"libraries-io": "TheBespokePixel",
7769
"codeclimate": "57bf94c1bc96b928b8cd",
7870
"name": "string",
7971
"providers": {
@@ -92,7 +84,7 @@
9284
"Publishing Status": [
9385
[
9486
"npm",
95-
"david"
87+
"libraries-io-npm"
9688
],
9789
[
9890
"travis-com",
@@ -102,8 +94,7 @@
10294
"Development Status": [
10395
[
10496
"travis-com-dev",
105-
"david-dev",
106-
"david-devdeps-dev"
97+
"libraries-io-github"
10798
],
10899
[
109100
"snyk",
@@ -127,7 +118,7 @@
127118
],
128119
[
129120
"snyk",
130-
"david"
121+
"libraries-io-npm"
131122
]
132123
]
133124
},

‎readme.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
55
##### Publishing Status
66

7-
[![npm](https://img.shields.io/npm/v/@thebespokepixel/string?logo=npm)](https://www.npmjs.com/package/@thebespokepixel/string "npm") [![David](https://david-dm.org/thebespokepixel/string/master/status.svg)](https://david-dm.org/thebespokepixel/string/master "David")
8-
[![Travis](https://img.shields.io/travis/com/thebespokepixel/string/master?logo=travis)](https://travis-ci.com/thebespokepixel/string "Travis") [![Rollup](https://img.shields.io/badge/es6-module%3Amjs_%E2%9C%94-64CA39?&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBhdGggZmlsbD0iI0ZGMzMzMyIgZD0iTTEwLjkwNDI4MjQsMy4wMDkxMDY4MyBDMTEuMjM4NzA1NSwzLjU4MjgzNzEzIDExLjQyODU3MTQsNC4yNDQ4MzM2MyAxMS40Mjg1NzE0LDQuOTUwOTYzMjIgQzExLjQyODU3MTQsNi40MTc4NjM0IDEwLjYwODY5NTcsNy42OTU2MjE3MiA5LjM5MTgyNzM5LDguMzc2NTMyNCBDOS4zMDU1MjQ2OCw4LjQyNDg2ODY1IDkuMjczMTYxMTYsOC41MzIwNDkwNCA5LjMxODQ3MDA5LDguNjE4MjEzNjYgTDExLjQyODU3MTQsMTMgTDUuMjU4NjgyODEsMTMgTDIuMzM5Nzc3MjMsMTMgQzIuMTUyMTIzNDUsMTMgMiwxMi44NDgyNzU3IDIsMTIuNjUzODA0OCBMMiwxLjM0NjE5NTIyIEMyLDEuMTU0OTk2ODggMi4xNDgzMTU0MywxIDIuMzM5Nzc3MjMsMSBMNy42NjAyMjI3NywxIEM3LjcwMTU0MTQ5LDEgNy43NDExMzc2NCwxLjAwNzM1NTg4IDcuNzc3NzY2NTgsMS4wMjA5MDQyOSBDOS4wNjQ1MzgyOCwxLjE0NDU0MDA0IDEwLjE3MzM4ODQsMS44NTM4NTI5MSAxMC44MjIyOTQ5LDIuODcyNTA0MzggQzEwLjc5OTE5NTMsMi44NDQ4NDgwNiAxMC44NDQ0OTkxLDIuOTQ5MTc0NzYgMTAuOTA0MjgyNCwzLjAwOTEwNjgzIFoiLz4KICAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGZpbGwtb3BhY2l0eT0iLjMxIiBkPSJNOC44NTcxNDI4NiwzLjU3MTQyODU3IEw2LjcxNDI4NTcxLDYuNTcxNDI4NTcgTDkuMjg1NzE0MjksNS4yODU3MTQyOSBDOS4yODU3MTQyOSw1LjI4NTcxNDI5IDkuNzE0Mjg1NzEsNC44NTcxNDI4NiA5LjI4NTcxNDI5LDQuNDI4NTcxNDMgQzkuMjg1NzE0MjksNCA4Ljg1NzE0Mjg2LDMuNTcxNDI4NTcgOC44NTcxNDI4NiwzLjU3MTQyODU3IFoiLz4KICAgIDxwYXRoIGZpbGw9IiNGQkIwNDAiIGQ9Ik0yLjg0Njc0NjAzLDEyLjk5NTg0OTUgQzMuMjY0OTIwNjIsMTIuOTk1ODQ5NSAzLjE4NTkzMDM0LDEyLjk0NjM2NjkgMy4zMTYxMTYzOCwxMi44NzM5MDU0IEMzLjYxODE3NTg3LDEyLjcwNTc3OTMgNS42ODk0NDA5OSw4LjcxMjc4NDU5IDcuNzE3NTU0NzYsNi44MjEzNjYwMiBDOS43NDU2Njg1Miw0LjkyOTk0NzQ2IDEwLjAwNDU3NjcsNS41NjA0MjAzMiA4Ljg4NDc5ODk1LDMuNTAyOTc3MjMgQzguODg0Nzk4OTUsMy41MDI5NzcyMyA5Ljc0NzgyNjA5LDUuMTQyMjA2NjUgOS4wMTQyNTMwMiw1LjI2ODMwMTIzIEM4LjQzODE4MjQxLDUuMzY3MDc1MzEgNy4xMTk5MDg0Nyw0LjEyMjk0MjIxIDcuNjExODMzOTMsMy4wMDQ5MDM2OCBDOC4wOTA4MTM5OSwxLjkxNDE4NTY0IDEwLjAxOTY3OTYsMi4xMjAxNDAxMSAxMC45MDY0NCwzLjAwOTEwNjgzIEMxMC44NzgzOTE2LDIuOTYyODcyMTUgMTAuODUwMzQzMiwyLjkxNjYzNzQ4IDEwLjgyMjI5NDksMi44NzI1MDQzOCBDMTAuMzA0NDc4NiwyLjI1MjUzOTQgOS41MDQwMjA5MiwxLjkwMzY3Nzc2IDguNzEwMDM1OTYsMS45MDM2Nzc3NiBDNy4xOTk3Mzg0OCwxLjkwMzY3Nzc2IDYuODIwMDA2NTQsMi40MjY5NzAyMyAzLjkyMDIzNTM3LDcuNjE5OTY0OTcgQzIuMzg3Nzk5MzQsMTAuMzY1NDA2NyAyLjAxMDgzMTkzLDExLjU3MzUwNzkgMi4wMDYyOTA2OSwxMi4xNjk4MTgyIEMyLDEyLjk5NTg0OTUgMi4wMDYyOTA2OSwxMi45OTU4NDk1IDIuODQ2NzQ2MDMsMTIuOTk1ODQ5NSBaIi8%2BCiAgPC9nPgo8L3N2Zz4K)](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")
7+
[![npm](https://img.shields.io/npm/v/@thebespokepixel/string?logo=npm "npm")](https://www.npmjs.com/package/@thebespokepixel/string "npm")&#x20;[![Libraries.io](https://img.shields.io/librariesio/release/npm/@thebespokepixel/string/latest?\&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01Ljk5OTMxNDIyLDE1LjI3NyBMNiwyMyBDNiwyMy41NTIyODQ3IDUuNTUyMjg0NzUsMjQgNSwyNCBMMiwyNCBDMS40NDc3MTUyNSwyNCAxLDIzLjU1MjI4NDcgMSwyMyBMMC45OTkzMTQyMjIsMTkuMTg0IEw1Ljk5OTMxNDIyLDE1LjI3NyBaIE0xNC40OTkzMTQyLDguNjM2IEwxNC41LDIzIEMxNC41LDIzLjU1MjI4NDcgMTQuMDUyMjg0NywyNCAxMy41LDI0IEwxMC41LDI0IEM5Ljk0NzcxNTI1LDI0IDkuNSwyMy41NTIyODQ3IDkuNSwyMyBMOS40OTkzMTQyMiwxMi41NDMgTDE0LjQ5OTMxNDIsOC42MzYgWiBNMTcuOTk5MzE0Miw4LjMzNCBMMjIuOTk5MzE0MiwxMi4xMDIgTDIzLDIzIEMyMywyMy41NTIyODQ3IDIyLjU1MjI4NDcsMjQgMjIsMjQgTDE5LDI0IEMxOC40NDc3MTUzLDI0IDE4LDIzLjU1MjI4NDcgMTgsMjMgTDE3Ljk5OTMxNDIsOC4zMzQgWiBNNSwwIEM1LjU1MjI4NDc1LDAgNiwwLjQ0NzcxNTI1IDYsMSBMNS45OTkzMTQyMiwxMS40NzEgTDAuOTk5MzE0MjIyLDE1LjM3OCBMMSwxIEMxLDAuNDQ3NzE1MjUgMS40NDc3MTUyNSwwIDIsMCBMNSwwIFogTTEzLjUsMCBDMTQuMDUyMjg0NywwIDE0LjUsMC40NDc3MTUyNSAxNC41LDEgTDE0LjQ5OTMxNDIsNC44MzEgTDkuNDk5MzE0MjIsOC43MzcgTDkuNSwxIEM5LjUsMC40NDc3MTUyNSA5Ljk0NzcxNTI1LDAgMTAuNSwwIEwxMy41LDAgWiBNMjIsMCBDMjIuNTUyMjg0NywwIDIzLDAuNDQ3NzE1MjUgMjMsMSBMMjIuOTk5MzE0Miw4LjM0NyBMMTcuOTk5MzE0Miw0LjU3OSBMMTgsMSBDMTgsMC40NDc3MTUyNSAxOC40NDc3MTUzLDAgMTksMCBMMjIsMCBaIi8%2BCjwvc3ZnPgo%3D "Libraries.io")](https://libraries.io/github/thebespokepixel/string "Libraries.io")&#x20;
8+
[![Travis](https://img.shields.io/travis/com/thebespokepixel/string/master?logo=travis "Travis")](https://travis-ci.com/thebespokepixel/string "Travis")&#x20;[![Rollup](https://img.shields.io/badge/es6-type%3A%20module%20%E2%9C%94-64CA39?\&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBhdGggZmlsbD0iI0ZGMzMzMyIgZD0iTTEwLjkwNDI4MjQsMy4wMDkxMDY4MyBDMTEuMjM4NzA1NSwzLjU4MjgzNzEzIDExLjQyODU3MTQsNC4yNDQ4MzM2MyAxMS40Mjg1NzE0LDQuOTUwOTYzMjIgQzExLjQyODU3MTQsNi40MTc4NjM0IDEwLjYwODY5NTcsNy42OTU2MjE3MiA5LjM5MTgyNzM5LDguMzc2NTMyNCBDOS4zMDU1MjQ2OCw4LjQyNDg2ODY1IDkuMjczMTYxMTYsOC41MzIwNDkwNCA5LjMxODQ3MDA5LDguNjE4MjEzNjYgTDExLjQyODU3MTQsMTMgTDUuMjU4NjgyODEsMTMgTDIuMzM5Nzc3MjMsMTMgQzIuMTUyMTIzNDUsMTMgMiwxMi44NDgyNzU3IDIsMTIuNjUzODA0OCBMMiwxLjM0NjE5NTIyIEMyLDEuMTU0OTk2ODggMi4xNDgzMTU0MywxIDIuMzM5Nzc3MjMsMSBMNy42NjAyMjI3NywxIEM3LjcwMTU0MTQ5LDEgNy43NDExMzc2NCwxLjAwNzM1NTg4IDcuNzc3NzY2NTgsMS4wMjA5MDQyOSBDOS4wNjQ1MzgyOCwxLjE0NDU0MDA0IDEwLjE3MzM4ODQsMS44NTM4NTI5MSAxMC44MjIyOTQ5LDIuODcyNTA0MzggQzEwLjc5OTE5NTMsMi44NDQ4NDgwNiAxMC44NDQ0OTkxLDIuOTQ5MTc0NzYgMTAuOTA0MjgyNCwzLjAwOTEwNjgzIFoiLz4KICAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGZpbGwtb3BhY2l0eT0iLjMxIiBkPSJNOC44NTcxNDI4NiwzLjU3MTQyODU3IEw2LjcxNDI4NTcxLDYuNTcxNDI4NTcgTDkuMjg1NzE0MjksNS4yODU3MTQyOSBDOS4yODU3MTQyOSw1LjI4NTcxNDI5IDkuNzE0Mjg1NzEsNC44NTcxNDI4NiA5LjI4NTcxNDI5LDQuNDI4NTcxNDMgQzkuMjg1NzE0MjksNCA4Ljg1NzE0Mjg2LDMuNTcxNDI4NTcgOC44NTcxNDI4NiwzLjU3MTQyODU3IFoiLz4KICAgIDxwYXRoIGZpbGw9IiNGQkIwNDAiIGQ9Ik0yLjg0Njc0NjAzLDEyLjk5NTg0OTUgQzMuMjY0OTIwNjIsMTIuOTk1ODQ5NSAzLjE4NTkzMDM0LDEyLjk0NjM2NjkgMy4zMTYxMTYzOCwxMi44NzM5MDU0IEMzLjYxODE3NTg3LDEyLjcwNTc3OTMgNS42ODk0NDA5OSw4LjcxMjc4NDU5IDcuNzE3NTU0NzYsNi44MjEzNjYwMiBDOS43NDU2Njg1Miw0LjkyOTk0NzQ2IDEwLjAwNDU3NjcsNS41NjA0MjAzMiA4Ljg4NDc5ODk1LDMuNTAyOTc3MjMgQzguODg0Nzk4OTUsMy41MDI5NzcyMyA5Ljc0NzgyNjA5LDUuMTQyMjA2NjUgOS4wMTQyNTMwMiw1LjI2ODMwMTIzIEM4LjQzODE4MjQxLDUuMzY3MDc1MzEgNy4xMTk5MDg0Nyw0LjEyMjk0MjIxIDcuNjExODMzOTMsMy4wMDQ5MDM2OCBDOC4wOTA4MTM5OSwxLjkxNDE4NTY0IDEwLjAxOTY3OTYsMi4xMjAxNDAxMSAxMC45MDY0NCwzLjAwOTEwNjgzIEMxMC44NzgzOTE2LDIuOTYyODcyMTUgMTAuODUwMzQzMiwyLjkxNjYzNzQ4IDEwLjgyMjI5NDksMi44NzI1MDQzOCBDMTAuMzA0NDc4NiwyLjI1MjUzOTQgOS41MDQwMjA5MiwxLjkwMzY3Nzc2IDguNzEwMDM1OTYsMS45MDM2Nzc3NiBDNy4xOTk3Mzg0OCwxLjkwMzY3Nzc2IDYuODIwMDA2NTQsMi40MjY5NzAyMyAzLjkyMDIzNTM3LDcuNjE5OTY0OTcgQzIuMzg3Nzk5MzQsMTAuMzY1NDA2NyAyLjAxMDgzMTkzLDExLjU3MzUwNzkgMi4wMDYyOTA2OSwxMi4xNjk4MTgyIEMyLDEyLjk5NTg0OTUgMi4wMDYyOTA2OSwxMi45OTU4NDk1IDIuODQ2NzQ2MDMsMTIuOTk1ODQ5NSBaIi8%2BCiAgPC9nPgo8L3N2Zz4K "Rollup")](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")&#x20;
9+
910

1011
##### Development Status
1112

12-
[![Travis](https://img.shields.io/travis/com/thebespokepixel/string/develop?logo=travis)](https://travis-ci.com/thebespokepixel/string "Travis") [![David](https://david-dm.org/thebespokepixel/string/develop/status.svg)](https://david-dm.org/thebespokepixel/string/develop "David") [![David-developer](https://david-dm.org/thebespokepixel/string/develop/dev-status.svg)](https://david-dm.org/thebespokepixel/string/develop?type=dev "David-developer")
13-
[![Snyk](https://snyk.io/test/github/thebespokepixel/string/badge.svg)](https://snyk.io/test/github/thebespokepixel/string "Snyk") [![Code-climate](https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/maintainability)](https://codeclimate.com/github/thebespokepixel/string/maintainability "Code-climate") [![Coverage](https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/test_coverage)](https://codeclimate.com/github/thebespokepixel/string/test_coverage "Coverage")
13+
[![Travis](https://img.shields.io/travis/com/thebespokepixel/string/develop?logo=travis "Travis")](https://travis-ci.com/thebespokepixel/string "Travis")&#x20;[![Libraries.io](https://img.shields.io/librariesio/github/TheBespokePixel/string?\&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01Ljk5OTMxNDIyLDE1LjI3NyBMNiwyMyBDNiwyMy41NTIyODQ3IDUuNTUyMjg0NzUsMjQgNSwyNCBMMiwyNCBDMS40NDc3MTUyNSwyNCAxLDIzLjU1MjI4NDcgMSwyMyBMMC45OTkzMTQyMjIsMTkuMTg0IEw1Ljk5OTMxNDIyLDE1LjI3NyBaIE0xNC40OTkzMTQyLDguNjM2IEwxNC41LDIzIEMxNC41LDIzLjU1MjI4NDcgMTQuMDUyMjg0NywyNCAxMy41LDI0IEwxMC41LDI0IEM5Ljk0NzcxNTI1LDI0IDkuNSwyMy41NTIyODQ3IDkuNSwyMyBMOS40OTkzMTQyMiwxMi41NDMgTDE0LjQ5OTMxNDIsOC42MzYgWiBNMTcuOTk5MzE0Miw4LjMzNCBMMjIuOTk5MzE0MiwxMi4xMDIgTDIzLDIzIEMyMywyMy41NTIyODQ3IDIyLjU1MjI4NDcsMjQgMjIsMjQgTDE5LDI0IEMxOC40NDc3MTUzLDI0IDE4LDIzLjU1MjI4NDcgMTgsMjMgTDE3Ljk5OTMxNDIsOC4zMzQgWiBNNSwwIEM1LjU1MjI4NDc1LDAgNiwwLjQ0NzcxNTI1IDYsMSBMNS45OTkzMTQyMiwxMS40NzEgTDAuOTk5MzE0MjIyLDE1LjM3OCBMMSwxIEMxLDAuNDQ3NzE1MjUgMS40NDc3MTUyNSwwIDIsMCBMNSwwIFogTTEzLjUsMCBDMTQuMDUyMjg0NywwIDE0LjUsMC40NDc3MTUyNSAxNC41LDEgTDE0LjQ5OTMxNDIsNC44MzEgTDkuNDk5MzE0MjIsOC43MzcgTDkuNSwxIEM5LjUsMC40NDc3MTUyNSA5Ljk0NzcxNTI1LDAgMTAuNSwwIEwxMy41LDAgWiBNMjIsMCBDMjIuNTUyMjg0NywwIDIzLDAuNDQ3NzE1MjUgMjMsMSBMMjIuOTk5MzE0Miw4LjM0NyBMMTcuOTk5MzE0Miw0LjU3OSBMMTgsMSBDMTgsMC40NDc3MTUyNSAxOC40NDc3MTUzLDAgMTksMCBMMjIsMCBaIi8%2BCjwvc3ZnPgo%3D "Libraries.io")](https://libraries.io/github/thebespokepixel/string "Libraries.io")&#x20;
14+
[![Snyk](https://snyk.io/test/github/thebespokepixel/string/badge.svg "Snyk")](https://snyk.io/test/github/thebespokepixel/string "Snyk")&#x20;[![Code-Climate](https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/maintainability "Code-Climate")](https://codeclimate.com/github/thebespokepixel/string/maintainability "Code-Climate")&#x20;[![Code-Climate Coverage](https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/test_coverage "Code-Climate Coverage")](https://codeclimate.com/github/thebespokepixel/string/test_coverage "Code-Climate Coverage")&#x20;
15+
1416

1517
##### Documentation/Help
1618

17-
[![Inch](https://inch-ci.org/github/thebespokepixel/string.svg?branch=master&style=shields)](https://inch-ci.org/github/thebespokepixel/string "Inch") [![Twitter](https://img.shields.io/twitter/follow/thebespokepixel?style=social)](https://twitter.com/thebespokepixel "Twitter")
19+
[![Inch.io](https://inch-ci.org/github/thebespokepixel/string.svg?branch=master\&style=shields "Inch.io")](https://inch-ci.org/github/thebespokepixel/string "Inch.io")&#x20;[![Twitter](https://img.shields.io/twitter/follow/thebespokepixel?style=social "Twitter")](https://twitter.com/thebespokepixel "Twitter")&#x20;
1820

1921

2022
## Usage
21-
2223
#### Installation
2324

2425
```shell
@@ -47,17 +48,16 @@ Unless the environment has `TERM_FONT=full` set (see [Term-NG][termNG]) and you
4748

4849
##### Character set (Github display is incomplete)
4950

50-
| Class | Numerals | Symbols | Lower case | Upper case | |
51-
| ----------- | ------------ | ------------ | ---------------------------- | ---------------------------- | ---------------------------- |
52-
| Basic | `0123456789` | \`+-=:()/ | . \` | `abcdefghijklmnopqrstuvwxyz` | `ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
53-
| Superscript | `⁰¹²³⁴⁵⁶⁷⁸⁹` | `⁺⁻⁼⁼⁽⁾╵╵⋅ ` | `ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵍʳˢᵗᵘᵛʷˣʸᶻ` | `ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴼᴿˢᵀᵁⱽᵂˣʸᶻ` | |
54-
| Subscript | `₀₁₂₃₄₅₆₇₈₉` | `₊₋₌₌₍₎╷╷. ` | `ₐₓₓₓₑₓₓₕᵢⱼₖₗₘₙₒₚₓᵣₛₜᵤᵥₓₓₓₓ` | `ᴀʙcᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ` | |
51+
| Class | Numerals | Symbols | Lower case | Upper case |
52+
|-------------|------------|-----------|----------------------------|----------------------------|
53+
| Basic | `0123456789` | `+-=:()/|. ` | `abcdefghijklmnopqrstuvwxyz` | `ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
54+
| Superscript | `⁰¹²³⁴⁵⁶⁷⁸⁹` | `⁺⁻⁼⁼⁽⁾╵╵⋅ ` | `ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵍʳˢᵗᵘᵛʷˣʸᶻ` | `ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴼᴿˢᵀᵁⱽᵂˣʸᶻ` |
55+
| Subscript | `₀₁₂₃₄₅₆₇₈₉` | `₊₋₌₌₍₎╷╷. ` | `ₐₓₓₓₑₓₓₕᵢⱼₖₗₘₙₒₚₓᵣₛₜᵤᵥₓₓₓₓ` | `ᴀʙcᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ` |
5556

5657
[termNG]: https://www.npmjs.com/package/term-ng
5758

5859

5960
## Documentation
60-
6161
Full documentation can be found at [https://thebespokepixel.github.io/string/][1]
6262

6363
[1]: https://thebespokepixel.github.io/string/

‎rollup.config.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import commonjs from '@rollup/plugin-commonjs'
2+
import resolve from '@rollup/plugin-node-resolve'
3+
import cleanup from 'rollup-plugin-cleanup'
4+
5+
const external = id => !id.startsWith('src') && !id.startsWith('.') && !id.startsWith('/') && !id.startsWith('\0')
6+
7+
const config = [{
8+
external,
9+
plugins: [resolve(), commonjs(), cleanup({comments: [/^\*\*/]})],
10+
input: 'src/index.js',
11+
output: {
12+
file: 'index.js',
13+
format: 'es',
14+
},
15+
}]
16+
17+
export default config

‎test/boxen.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import test from 'ava'
2-
import {bespokeString} from '..'
2+
import {bespokeString} from '../index.js'
33

44
test('inBox → Boxed string', t => {
55
t.is(
66
bespokeString('Hello world!')
77
.inBox({
88
borderColor: null,
9-
dimBorder: false
9+
dimBorder: false,
1010
})
1111
.toString(),
12-
'\n ╭──────────────────╮\n │ Hello world! │\n ╰──────────────────╯\n'
12+
'\n ╭──────────────────╮\n │ Hello world! │\n ╰──────────────────╯\n',
1313
)
1414
})

‎test/emoji.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava'
2-
import {emoji} from '..'
2+
import {emoji} from '../index.js'
33

44
test('Emoji → 🤔', t => {
55
t.is(emoji('🤔'), '🤔 ')

‎test/padding.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava'
2-
import {bespokeString, pad} from '..'
2+
import {bespokeString, pad} from '../index.js'
33

44
test('Basic padding 12345 with " ", -10 chars (left pad)', t => {
55
t.is(pad('12345', -10), ' 12345')

‎test/sub-super-script.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava'
2-
import {toSubscript, toSuperscript} from '..'
2+
import {toSubscript, toSuperscript} from '../index.js'
33

44
test('Basic digits 123... → ¹²³⋅⋅⋅/₁₂₃...', t => {
55
t.plan(2)

0 commit comments

Comments
 (0)
Please sign in to comment.