Skip to content

Commit 78a0782

Browse files
committedJul 17, 2020
Merge branch 'release/v1.0.2'
2 parents 5684b08 + 8ad560f commit 78a0782

10 files changed

+3467
-4638
lines changed
 

‎.travis.yml

-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ branches:
33
only:
44
- master
55
- develop
6-
- /^greenkeeper/.*$/
76
- /^feature/.*$/
87
language: node_js
98
node_js:
@@ -16,15 +15,12 @@ env:
1615
- CC_TEST_REPORTER_ID=40b1513b98e60239cc6d5ee9b6a98ba1cf8438189dd2066c67a75fdfb8be5cff
1716
before_install:
1817
- npm i -g npm
19-
- npm install -g greenkeeper-lockfile
2018
install: npm ci --no-optional
2119
before_script:
22-
- greenkeeper-lockfile-update
2320
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
2421
- chmod +x ./cc-test-reporter
2522
- ./cc-test-reporter before-build
2623
after_script:
27-
- greenkeeper-lockfile-upload
2824
- "[ $TRAVIS_NODE_VERSION = stable ] && nyc report --reporter=lcov && ./cc-test-reporter
2925
after-build --debug -t lcov --exit-code $TRAVIS_TEST_RESULT || echo 'Coverage skipped'"
3026
notifications:

‎docs/assets/js/site.js

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

‎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

+28-28
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.1 | Documentation</title>
5+
<title>@thebespokepixel/string 1.0.2 | 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.1</code></div>
18+
<div class="mb1"><code>1.0.2</code></div>
1919
<input
2020
placeholder="Filter"
2121
id="filter-input"
@@ -270,7 +270,7 @@ <h3 class='left m0 panel-title' id='constructor'>
270270
</h3>
271271

272272

273-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L13-L15'>
273+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L13-L15'>
274274
<span>src/index.js</span>
275275
</a>
276276

@@ -280,7 +280,7 @@ <h3 class='left m0 panel-title' id='constructor'>
280280
<p>Contruct a BespokeString instance.</p>
281281

282282

283-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>constructor(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</div>
283+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>constructor(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</div>
284284

285285

286286

@@ -297,7 +297,7 @@ <h3 class='left m0 panel-title' id='constructor'>
297297

298298
<div class='space-bottom0'>
299299
<div>
300-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
300+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
301301
The string content.
302302

303303
</div>
@@ -338,7 +338,7 @@ <h3 class='left m0 panel-title' id='pad'>
338338
</h3>
339339

340340

341-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L51-L55'>
341+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L51-L55'>
342342
<span>src/index.js</span>
343343
</a>
344344

@@ -425,7 +425,7 @@ <h3 class='left m0 panel-title' id='tosub'>
425425
</h3>
426426

427427

428-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L61-L63'>
428+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L61-L63'>
429429
<span>src/index.js</span>
430430
</a>
431431

@@ -487,7 +487,7 @@ <h3 class='left m0 panel-title' id='tosuper'>
487487
</h3>
488488

489489

490-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L69-L71'>
490+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L69-L71'>
491491
<span>src/index.js</span>
492492
</a>
493493

@@ -549,7 +549,7 @@ <h3 class='left m0 panel-title' id='asemoji'>
549549
</h3>
550550

551551

552-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L79-L82'>
552+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L79-L82'>
553553
<span>src/index.js</span>
554554
</a>
555555

@@ -612,7 +612,7 @@ <h3 class='left m0 panel-title' id='inbox'>
612612
</h3>
613613

614614

615-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L89-L106'>
615+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L89-L106'>
616616
<span>src/index.js</span>
617617
</a>
618618

@@ -689,7 +689,7 @@ <h3 class='left m0 panel-title' id='bespokestring'>
689689
</h3>
690690

691691

692-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L122-L124'>
692+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L122-L124'>
693693
<span>src/index.js</span>
694694
</a>
695695

@@ -699,7 +699,7 @@ <h3 class='left m0 panel-title' id='bespokestring'>
699699
<p>Helper method for creating a BespokeString instance</p>
700700

701701

702-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>bespokeString(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → BespokeString</div>
702+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>bespokeString(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → BespokeString</div>
703703

704704

705705

@@ -716,7 +716,7 @@ <h3 class='left m0 panel-title' id='bespokestring'>
716716

717717
<div class='space-bottom0'>
718718
<div>
719-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
719+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
720720
String content.
721721

722722
</div>
@@ -765,7 +765,7 @@ <h3 class='left m0 panel-title' id='pad'>
765765
</h3>
766766

767767

768-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L133-L135'>
768+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L133-L135'>
769769
<span>src/index.js</span>
770770
</a>
771771

@@ -775,7 +775,7 @@ <h3 class='left m0 panel-title' id='pad'>
775775
<p>Helper method for padding a string.</p>
776776

777777

778-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>pad(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, length: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>, char: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
778+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>pad(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, length: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>, char: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
779779

780780

781781

@@ -792,7 +792,7 @@ <h3 class='left m0 panel-title' id='pad'>
792792

793793
<div class='space-bottom0'>
794794
<div>
795-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
795+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
796796
The string to pad.
797797

798798
</div>
@@ -859,7 +859,7 @@ <h3 class='left m0 panel-title' id='box'>
859859
</h3>
860860

861861

862-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L143-L145'>
862+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L143-L145'>
863863
<span>src/index.js</span>
864864
</a>
865865

@@ -869,7 +869,7 @@ <h3 class='left m0 panel-title' id='box'>
869869
<p>Helper method for creating a visual box (using boxen)</p>
870870

871871

872-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>box(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
872+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>box(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
873873

874874

875875

@@ -886,7 +886,7 @@ <h3 class='left m0 panel-title' id='box'>
886886

887887
<div class='space-bottom0'>
888888
<div>
889-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
889+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
890890
Box content.
891891

892892
</div>
@@ -944,7 +944,7 @@ <h3 class='left m0 panel-title' id='tosubscript'>
944944
</h3>
945945

946946

947-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L152-L154'>
947+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L152-L154'>
948948
<span>src/index.js</span>
949949
</a>
950950

@@ -954,7 +954,7 @@ <h3 class='left m0 panel-title' id='tosubscript'>
954954
<p>Helper method from creating a simple Unicode subscript representation.</p>
955955

956956

957-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>toSubscript(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
957+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>toSubscript(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
958958

959959

960960

@@ -971,7 +971,7 @@ <h3 class='left m0 panel-title' id='tosubscript'>
971971

972972
<div class='space-bottom0'>
973973
<div>
974-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
974+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
975975
The string to transform to subscript.
976976

977977
</div>
@@ -1020,7 +1020,7 @@ <h3 class='left m0 panel-title' id='tosuperscript'>
10201020
</h3>
10211021

10221022

1023-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L161-L163'>
1023+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L161-L163'>
10241024
<span>src/index.js</span>
10251025
</a>
10261026

@@ -1030,7 +1030,7 @@ <h3 class='left m0 panel-title' id='tosuperscript'>
10301030
<p>Helper method from creating a simple Unicode superscript representation.</p>
10311031

10321032

1033-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>toSuperscript(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
1033+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>toSuperscript(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
10341034

10351035

10361036

@@ -1047,7 +1047,7 @@ <h3 class='left m0 panel-title' id='tosuperscript'>
10471047

10481048
<div class='space-bottom0'>
10491049
<div>
1050-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
1050+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
10511051
The string to transform to superscript.
10521052

10531053
</div>
@@ -1096,7 +1096,7 @@ <h3 class='left m0 panel-title' id='emoji'>
10961096
</h3>
10971097

10981098

1099-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/a5a3939dfb2834b451a283169aa254bf41522b74/src/index.js#L170-L172'>
1099+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L170-L172'>
11001100
<span>src/index.js</span>
11011101
</a>
11021102

@@ -1106,7 +1106,7 @@ <h3 class='left m0 panel-title' id='emoji'>
11061106
<p>Helper method from creating a wide Emoji character.</p>
11071107

11081108

1109-
<div class='pre p1 bg-darken-1 mt0 rounded signature'>emoji(str: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
1109+
<div class='pre p1 bg-darken-1 mt0 rounded signature'>emoji(content: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>) → <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
11101110

11111111

11121112

@@ -1123,7 +1123,7 @@ <h3 class='left m0 panel-title' id='emoji'>
11231123

11241124
<div class='space-bottom0'>
11251125
<div>
1126-
<span class='code bold'>str</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
1126+
<span class='code bold'>content</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
11271127
The emoji to print.
11281128

11291129
</div>

‎index.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ function _objectSpread2(target) {
5757
}
5858

5959
class BespokeString {
60-
constructor(str) {
61-
this._string = String(str);
60+
constructor(content) {
61+
this._string = String(content);
6262
}
6363

6464
charSets(set_) {
@@ -130,28 +130,28 @@ class BespokeString {
130130

131131
}
132132

133-
function bespokeString(str) {
134-
return new BespokeString(str);
133+
function bespokeString(content) {
134+
return new BespokeString(content);
135135
}
136136

137-
function pad(str, length, char) {
138-
return new BespokeString(str).pad(length, char).toString();
137+
function pad(content, length, char) {
138+
return new BespokeString(content).pad(length, char).toString();
139139
}
140140

141-
function box(str, options) {
142-
return bespokeString(str).inBox(options).toString();
141+
function box(content, options) {
142+
return bespokeString(content).inBox(options).toString();
143143
}
144144

145-
function toSubscript(str) {
146-
return bespokeString(str).toSub().toString();
145+
function toSubscript(content) {
146+
return bespokeString(content).toSub().toString();
147147
}
148148

149-
function toSuperscript(str) {
150-
return bespokeString(str).toSuper().toString();
149+
function toSuperscript(content) {
150+
return bespokeString(content).toSuper().toString();
151151
}
152152

153-
function emoji(str) {
154-
return bespokeString(str).asEmoji().toString();
153+
function emoji(content) {
154+
return bespokeString(content).asEmoji().toString();
155155
}
156156

157157
exports.BespokeString = BespokeString;

‎index.mjs

+14-14
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ function _objectSpread2(target) {
5151
}
5252

5353
class BespokeString {
54-
constructor(str) {
55-
this._string = String(str);
54+
constructor(content) {
55+
this._string = String(content);
5656
}
5757

5858
charSets(set_) {
@@ -124,28 +124,28 @@ class BespokeString {
124124

125125
}
126126

127-
function bespokeString(str) {
128-
return new BespokeString(str);
127+
function bespokeString(content) {
128+
return new BespokeString(content);
129129
}
130130

131-
function pad(str, length, char) {
132-
return new BespokeString(str).pad(length, char).toString();
131+
function pad(content, length, char) {
132+
return new BespokeString(content).pad(length, char).toString();
133133
}
134134

135-
function box(str, options) {
136-
return bespokeString(str).inBox(options).toString();
135+
function box(content, options) {
136+
return bespokeString(content).inBox(options).toString();
137137
}
138138

139-
function toSubscript(str) {
140-
return bespokeString(str).toSub().toString();
139+
function toSubscript(content) {
140+
return bespokeString(content).toSub().toString();
141141
}
142142

143-
function toSuperscript(str) {
144-
return bespokeString(str).toSuper().toString();
143+
function toSuperscript(content) {
144+
return bespokeString(content).toSuper().toString();
145145
}
146146

147-
function emoji(str) {
148-
return bespokeString(str).asEmoji().toString();
147+
function emoji(content) {
148+
return bespokeString(content).asEmoji().toString();
149149
}
150150

151151
export { BespokeString, bespokeString, box, emoji, pad, toSubscript, toSuperscript };

‎package-lock.json

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

‎package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thebespokepixel/string",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Esoteric string formatting",
55
"main": "index.js",
66
"module": "index.mjs",
@@ -14,20 +14,20 @@
1414
},
1515
"devDependencies": {
1616
"@ava/babel": "^1.0.1",
17-
"@babel/core": "^7.8.4",
18-
"@babel/preset-env": "^7.8.4",
19-
"ava": "^3.3.0",
20-
"documentation-theme-bespoke": "^1.1.3",
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",
2121
"gulp": "^4.0.2",
2222
"gulp-better-rollup": "^4.0.1",
2323
"gulp-rename": "^2.0.0",
2424
"gulp-strip-comments": "^2.5.2",
25-
"nyc": "^15.0.0",
26-
"rollup": "^1.31.1",
27-
"rollup-plugin-babel": "^4.3.3",
25+
"nyc": "^15.1.0",
26+
"rollup": "^2.21.0",
27+
"rollup-plugin-babel": "^4.4.0",
2828
"rollup-plugin-commonjs": "^10.1.0",
2929
"rollup-plugin-node-resolve": "^5.2.0",
30-
"xo": "^0.26.1"
30+
"xo": "^0.32.1"
3131
},
3232
"scripts": {
3333
"test": "xo && nyc ava",

‎readme.md

-64
Original file line numberDiff line numberDiff line change
@@ -1,64 +0,0 @@
1-
# @thebespokepixel/string
2-
3-
> A collection of enhanced formats and utilities for strings.
4-
5-
##### Publishing Status
6-
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%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBhdGggZmlsbD0iI0ZGMzMzMyIgZD0iTTEwLjkwNDI4MjQsMy4wMDkxMDY4MyBDMTEuMjM4NzA1NSwzLjU4MjgzNzEzIDExLjQyODU3MTQsNC4yNDQ4MzM2MyAxMS40Mjg1NzE0LDQuOTUwOTYzMjIgQzExLjQyODU3MTQsNi40MTc4NjM0IDEw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thebespokepixel/string.svg)](https://greenkeeper.io/ "Greenkeeper") [![Travis](https://img.shields.io/travis/com/thebespokepixel/string/develop?logo=travis)](https://travis-ci.com/thebespokepixel/string "Travis")
13-
[![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")
14-
[![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")
15-
16-
##### Documentation/Help
17-
18-
[![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-
20-
21-
## Usage
22-
23-
#### Installation
24-
25-
```shell
26-
npm install --save @thebespokepixel/string
27-
```
28-
29-
#### Example
30-
31-
```js
32-
const bString = require('@thebespokepixel/string')
33-
34-
console.log(bString.subScript('String to print'))
35-
```
36-
37-
#### .pad(string, char, length)
38-
39-
Pads `string`, using `char` to `length` characters. If length is negative, pads the right rather than the left of `string`. If length is less than `string.length`, it will crop `string` to fit.
40-
41-
#### .toSuperscript(string) | .toSubscript(string)
42-
43-
Prints the string using the alternative super/sub characters available in Unicode (Such as in DejaVu Sans Mono or Source Code Pro). Superscript support is much more complete that Subscript. Unavaiable subscript characters will be printed as ``. The character `Q` has to be approximated.
44-
45-
TODO: Use compound Unicode overlay characters to better approximate missing chars.
46-
47-
Unless the environment has `TERM_FONT=full` set (see [Term-NG][termNG]) and you have a Unicode terminal font that supports sub/super-script characters, then it will fall back to printing normal characters.
48-
49-
##### Character set (Github display is incomplete)
50-
51-
| Class | Numerals | Symbols | Lower case | Upper case | |
52-
| ----------- | ------------ | ------------ | ---------------------------- | ---------------------------- | ---------------------------- |
53-
| Basic | `0123456789` | \`+-=:()/ | . \` | `abcdefghijklmnopqrstuvwxyz` | `ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
54-
| Superscript | `⁰¹²³⁴⁵⁶⁷⁸⁹` | `⁺⁻⁼⁼⁽⁾╵╵⋅ ` | `ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵍʳˢᵗᵘᵛʷˣʸᶻ` | `ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴼᴿˢᵀᵁⱽᵂˣʸᶻ` | |
55-
| Subscript | `₀₁₂₃₄₅₆₇₈₉` | `₊₋₌₌₍₎╷╷. ` | `ₐₓₓₓₑₓₓₕᵢⱼₖₗₘₙₒₚₓᵣₛₜᵤᵥₓₓₓₓ` | `ᴀʙcᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ` | |
56-
57-
[termNG]: https://www.npmjs.com/package/term-ng
58-
59-
60-
## Documentation
61-
62-
Full documentation can be found at [https://thebespokepixel.github.io/string/][1]
63-
64-
[1]: https://thebespokepixel.github.io/string/

‎src/index.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import boxen from 'boxen'
88
class BespokeString {
99
/**
1010
* Contruct a BespokeString instance.
11-
* @param {String} str The string content.
11+
* @param {String} content The string content.
1212
*/
13-
constructor(str) {
14-
this._string = String(str)
13+
constructor(content) {
14+
this._string = String(content)
1515
}
1616

1717
charSets(set_) {
@@ -116,59 +116,59 @@ class BespokeString {
116116

117117
/**
118118
* Helper method for creating a BespokeString instance
119-
* @param {String} str - String content.
119+
* @param {String} content - String content.
120120
* @return {BespokeString} A BespokeString instance.
121121
*/
122-
function bespokeString(str) {
123-
return new BespokeString(str)
122+
function bespokeString(content) {
123+
return new BespokeString(content)
124124
}
125125

126126
/**
127127
* Helper method for padding a string.
128-
* @param {String} str The string to pad.
128+
* @param {String} content The string to pad.
129129
* @param {Number} length Target length.
130130
* @param {String} char Character to use for pad.
131131
* @return {String} The padded string.
132132
*/
133-
function pad(str, length, char) {
134-
return new BespokeString(str).pad(length, char).toString()
133+
function pad(content, length, char) {
134+
return new BespokeString(content).pad(length, char).toString()
135135
}
136136

137137
/**
138138
* Helper method for creating a visual box (using boxen)
139-
* @param {String} str Box content.
139+
* @param {String} content Box content.
140140
* @param {Object} options Boxen options.
141141
* @return {String} The contructed box.
142142
*/
143-
function box(str, options) {
144-
return bespokeString(str).inBox(options).toString()
143+
function box(content, options) {
144+
return bespokeString(content).inBox(options).toString()
145145
}
146146

147147
/**
148148
* Helper method from creating a simple Unicode subscript representation.
149-
* @param {String} str The string to transform to subscript.
149+
* @param {String} content The string to transform to subscript.
150150
* @return {String} The subscript string.
151151
*/
152-
function toSubscript(str) {
153-
return bespokeString(str).toSub().toString()
152+
function toSubscript(content) {
153+
return bespokeString(content).toSub().toString()
154154
}
155155

156156
/**
157157
* Helper method from creating a simple Unicode superscript representation.
158-
* @param {String} str The string to transform to superscript.
158+
* @param {String} content The string to transform to superscript.
159159
* @return {String} The superscript string.
160160
*/
161-
function toSuperscript(str) {
162-
return bespokeString(str).toSuper().toString()
161+
function toSuperscript(content) {
162+
return bespokeString(content).toSuper().toString()
163163
}
164164

165165
/**
166166
* Helper method from creating a wide Emoji character.
167-
* @param {String} str The emoji to print.
167+
* @param {String} content The emoji to print.
168168
* @return {String} The Emoji string.
169169
*/
170-
function emoji(str) {
171-
return bespokeString(str).asEmoji().toString()
170+
function emoji(content) {
171+
return bespokeString(content).asEmoji().toString()
172172
}
173173

174174
export {BespokeString, bespokeString, pad, box, toSubscript, toSuperscript, emoji}

0 commit comments

Comments
 (0)
Please sign in to comment.