8000 Auto-generated commit · stdlib-js/string-right-pad@6a97af3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a97af3

Browse files
committed
Auto-generated commit
1 parent bbef70f commit 6a97af3

File tree

6 files changed

+19
-129
lines changed

6 files changed

+19
-129
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T03:31:41.898Z

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ jobs:
182182
fi
183183
# Trim leading and trailing whitespace:
184184
dep=$(echo "$dep" | xargs)
185-
version="^$(npm view $dep version)"
185+
version="$(npm view $dep version)"
186+
if [[ -z "$version" ]]; then
187+
continue
188+
fi
189+
version="^$version"
186190
jq -r --arg dep "$dep" --arg version "$version" '.dependencies[$dep] = $version' package.json > package.json.tmp
187191
mv package.json.tmp package.json
188192
done
@@ -192,7 +196,11 @@ jobs:
192196
fi
193197
# Trim leading and trailing whitespace:
194198
dep=$(echo "$dep" | xargs)
195-
version="^$(npm view $dep version)"
199+
version="$(npm view $dep version)"
200+
if [[ -z "$version" ]]; then
201+
continue
202+
fi
203+
version="^$version"
196204
jq -r --arg dep "$dep" --arg version "$version" '.devDependencies[$dep] = $version' package.json > package.json.tmp
197205
mv package.json.tmp package.json
198206
done

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Stephannie Jiménez Gacha <steff456@hotmail.com>
3737
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
3838
orimiles5 <97595296+orimiles5@users.noreply.github.com>
3939
rei2hu <reimu@reimu.ws>
40+
Robert Gislason <gztown2216@yahoo.com>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
276276
[npm-image]: http://img.shields.io/npm/v/@stdlib/string-right-pad.svg
277277
[npm-url]: https://npmjs.org/package/@stdlib/string-right-pad
278278

279-
[test-image]: https://github.com/stdlib-js/string-right-pad/actions/workflows/test.yml/badge.svg?branch=v0.1.1
280-
[test-url]: https://github.com/stdlib-js/string-right-pad/actions/workflows/test.yml?query=branch:v0.1.1
279+
[test-image]: https://github.com/stdlib-js/string-right-pad/actions/workflows/test.yml/badge.svg?branch=main
280+
[test-url]: https://github.com/stdlib-js/string-right-pad/actions/workflows/test.yml?query=branch:main
281281

282282
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-right-pad/main.svg
283283
[coverage-url]: https://codecov.io/github/stdlib-js/string-right-pad?branch=main

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/dist/test.js

Lines changed: 4 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2023 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,133 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var rpad = require( './../../dist' );
24+
var main = require( './../../dist' );
2525

2626

2727
// TESTS //
2828

29-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3030
t.ok( true, __filename );
31-
t.strictEqual( typeof rpad, 'function', 'main export is a function' );
32-
t.end();
33-
});
34-
35-
tape( 'if the first argument is not a string primitive, the function will throw an error', function test( t ) {
36-
var values;
37-
var i;
38-
39-
values = [
40-
5,
41-
true,
42-
NaN,
43-
null,
44-
void 0,
45-
[],
46-
{},
47-
function noop() {}
48-
];
49-
50-
for ( i = 0; i < values.length; i++ ) {
51-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided ' + values[ i ] );
52-
}
53-
t.end();
54-
function badValue( value ) {
55-
return function badValue() {
56-
rpad( value, 10 );
57-
};
58-
}
59-
});
60-
61-
tape( 'if the second argument is not a nonnegative integer, the function will throw an error', function test( t ) {
62-
var values;
63-
var i;
64-
65-
values = [
66-
'5',
67-
3.14,
68-
-5,
69-
true,
70-
NaN,
71-
null,
72-
void 0,
73-
[],
74-
{},
75-
function noop() {}
76-
];
77-
78-
for ( i = 0; i < values.length; i++ ) {
79-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided ' + values[ i ] );
80-
}
81-
t.end();
82-
function badValue( value ) {
83-
return function badValue() {
84-
rpad( 'beep', value );
85-
};
86-
}
87-
});
88-
89-
tape( 'if the third argument is not a string primitive, the function will throw an error', function test( t ) {
90-
var values;
91-
var i;
92-
93-
values = [
94-
5,
95-
true,
96-
NaN,
97-
null,
98-
void 0,
99-
[],
100-
{},
101-
function noop() {}
102-
];
103-
104-
for ( i = 0; i < values.length; i++ ) {
105-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided ' + values[ i ] );
106-
}
107-
t.end();
108-
function badValue( value ) {
109-
return function badValue() {
110-
rpad( 'beep', 10, value );
111-
};
112-
}
113-
});
114-
115-
tape( 'if the output string will exceed the maximum allowed string length, the function will throw an error', function test( t ) {
116-
t.throws( foo, RangeError, 'throws RangeError' );
117-
t.end();
118-
function foo() {
119-
rpad( 'beep', 1e300 );
120-
}
121-
});
122-
123-
tape( 'if provided an empty pad string, the function throws an error', function test( t ) {
124-
t.throws( foo, RangeError, 'throws RangeError' );
125-
t.end();
126-
function foo() {
127-
rpad( 'beep', 10, '' );
128-
}
129-
});
130-
131-
tape( 'by default, the function right pads a string with spaces', function test( t ) {
132-
var str = rpad( 'a', 5 );
133-
t.equal( str, 'a ', 'right padded with spaces' );
134-
t.end();
135-
});
136-
137-
tape( 'the function supports right padding a string with a custom pad string', function test( t ) {
138-
var str = rpad( 'beep', 10, 'p' );
139-
t.equal( str, 'beeppppppp', 'right padded to desired length' );
140-
t.end();
141-
});
142-
143-
tape( 'the function right pads a string such that an output string may exceed the specified length (minimum bound)', function test( t ) {
144-
var str = rpad( 'a', 5, 'beepboop' );
145-
t.equal( str, 'abeepboop', 'right padded and length exceeds minimum length' );
146-
t.end();
147-
});
148-
149-
tape( 'if the specified string length is less than or equal to the input string length, the function returns the input string', function test( t ) {
150-
t.equal( rpad( 'beep', 2, 'boop' ), 'beep', 'returns input string (<)' );
151-
t.equal( rpad( 'beep', 4, 'boop' ), 'beep', 'returns input string (=)' );
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
15232
t.end();
15333
});

0 commit comments

Comments
 (0)
0