Skip to content

Commit 0f8fefd

Browse files
committed
Auto-generated commit
1 parent 10cf694 commit 0f8fefd

File tree

4 files changed

+16
-191
lines changed

4 files changed

+16
-191
lines changed

.github/.keepalive

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T02:36:09.823Z

.github/workflows/publish.yml

+10-2
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

+1
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Stephannie Jiménez Gacha <[email protected]>
3737
Yernar Yergaziyev <[email protected]>
3838
orimiles5 <[email protected]>
3939
40+
Robert Gislason <[email protected]>

test/dist/test.js

+4-189
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2021 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,198 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var substringAfter = 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 substringAfter, 'function', 'main export is a function' );
32-
t.end();
33-
});
34-
35-
tape( 'the function throws an error if not provided a string as its first argument', function test( t ) {
36-
var values;
37-
var i;
38-
39-
values = [
40-
5,
41-
NaN,
42-
true,
43-
false,
44-
null,
45-
void 0,
46-
[],
47-
{},
48-
function noop() {}
49-
];
50-
51-
for ( i = 0; i < values.length; i++ ) {
52-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
53-
}
54-
t.end();
55-
56-
function badValue( value ) {
57-
return function badValue() {
58-
substringAfter( value, 'beep' );
59-
};
60-
}
61-
});
62-
63-
tape( 'the function throws an error if not provided a string as its second argument', function test( t ) {
64-
var values;
65-
var i;
66-
67-
values = [
68-
5,
69-
NaN,
70-
true,
71-
false,
72-
null,
73-
void 0,
74-
[],
75-
{},
76-
function noop() {}
77-
];
78-
79-
for ( i = 0; i < values.length; i++ ) {
80-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
81-
}
82-
t.end();
83-
84-
function badValue( value ) {
85-
return function badValue() {
86-
substringAfter( 'beep', value );
87-
};
88-
}
89-
});
90-
91-
tape( 'the function throws an error if provided a non-integer value as its third argument', function test( t ) {
92-
var values;
93-
var i;
94-
95-
values = [
96-
'5',
97-
3.14,
98-
NaN,
99-
true,
100-
false,
101-
null,
102-
void 0,
103-
[],
104-
{},
105-
function noop() {}
106-
];
107-
108-
for ( i = 0; i < values.length; i++ ) {
109-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
110-
}
111-
t.end();
112-
113-
function badValue( value ) {
114-
return function badValue() {
115-
substringAfter( 'beep', 'e', value );
116-
};
117-
}
118-
});
119-
120-
tape( 'the function returns the substring after a provided search string', function test( t ) {
121-
var expected;
122-
var actual;
123-
var str;
124-
125-
str = 'beep boop';
126-
actual = substringAfter( str, ' ' );
127-
expected = 'boop';
128-
t.strictEqual( actual, expected, 'returns expected value' );
129-
130-
str = 'beep boop';
131-
actual = substringAfter( str, 'p' );
132-
expected = ' boop';
133-
t.strictEqual( actual, expected, 'returns expected value' );
134-
135-
str = 'Hello, World!';
136-
actual = substringAfter( str, 'o' );
137-
expected = ', World!';
138-
t.strictEqual( actual, expected, 'returns expected value' );
139-
140-
t.end();
141-
});
142-
143-
tape( 'the function returns the substring after a provided search string (Unicode characters)', function test( t ) {
144-
var expected;
145-
var actual;
146-
var str;
147-
148-
str = 'beep 😀 boop 😀 baz';
149-
actual = substringAfter( str, '😀' );
150-
expected = ' boop 😀 baz';
151-
t.strictEqual( actual, expected, 'returns expected value' );
152-
153-
str = '🤖 Robot army 🤖!';
154-
actual = substringAfter( str, '🤖' );
155-
expected = ' Robot army 🤖!';
156-
157-
str = '🐺 Wolf brothers 🐺';
158-
actual = substringAfter( str, 'o' );
159-
expected = 'lf brothers 🐺';
160-
161-
t.end();
162-
});
163-
164-
tape( 'the function returns the substring after a provided search string (custom start index)', function test( t ) {
165-
var expected;
166-
var actual;
167-
var str;
168-
169-
str = 'beep boop baz';
170-
actual = substringAfter( str, ' ', 6 );
171-
expected = 'baz';
172-
t.strictEqual( actual, expected, 'returns expected value' );
173-
174-
str = 'beep boop baz';
175-
actual = substringAfter( str, 'p', 6 );
176-
expected = ' baz';
177-
178-
str = 'beep boop baz';
179-
actual = substringAfter( str, 'beep', -2 );
180-
expected = ' boop baz';
181-
182-
str = 'beep boop baz';
183-
actual = substringAfter( str, 'beep', 20 );
184-
expected = '';
185-
186-
t.end();
187-
});
188-
189-
tape( 'the function returns the empty string if the search string is not found', function test( t ) {
190-
var expected;
191-
var actual;
192-
var str;
193-
194-
str = 'beep boop';
195-
actual = substringAfter( str, 'z' );
196-
expected = '';
197-
t.strictEqual( actual, expected, 'returns expected value' );
198-
199-
str = 'beep boop';
200-
actual = substringAfter( str, 'baz' );
201-
expected = '';
202-
t.strictEqual( actual, expected, 'returns expected value' );
203-
204-
t.end();
205-
});
206-
207-
tape( 'the function returns the original string if the search string is the empty string', function test( t ) {
208-
var expected;
209-
var actual;
210-
var str;
211-
212-
str = 'beep boop';
213-
actual = substringAfter( str, '' );
214-
expected = 'beep boop';
215-
t.strictEqual( actual, expected, 'returns expected value' );
216-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
21732
t.end();
21833
});

0 commit comments

Comments
 (0)