Skip to content

Commit f44339e

Browse files
committed
Auto-generated commit
1 parent a4c1686 commit f44339e

File tree

4 files changed

+15
-77
lines changed

4 files changed

+15
-77
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T00:29:46.208Z

.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>

test/dist/test.js

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -21,85 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var removeFirst = 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 removeFirst, 'function', 'main export is a function' );
32-
t.end();
33-
});
34-
35-
tape( 'the function returns an empty string if provided an empty string', function test( t ) {
36-
t.strictEqual( removeFirst( '', 1 ), '', 'returns expected value' );
37-
t.strictEqual( removeFirst( '', 2 ), '', 'returns expected value' );
38-
t.strictEqual( removeFirst( '', 3 ), '', 'returns expected value' );
39-
t.end();
40-
});
41-
42-
tape( 'the function returns the input string if provided zero as the second argument', function test( t ) {
43-
t.strictEqual( removeFirst( 'hello world', 0 ), 'hello world', 'returns expected value' );
44-
t.end();
45-
});
46-
47-
tape( 'the function removes the first Unicode code point of a provided string (ascii)', function test( t ) {
48-
var out;
49-
50-
out = removeFirst( 'hello world', 1 );
51-
t.strictEqual( out, 'ello world', 'returns expected value' );
52-
53-
out = removeFirst( '!!!', 1 );
54-
t.strictEqual( out, '!!', 'returns expected value' );
55-
56-
out = removeFirst( 'Hello World', 1 );
57-
t.strictEqual( out, 'ello World', 'returns expected value' );
58-
59-
t.end();
60-
});
61-
62-
tape( 'the function removes the first Unicode code point of a provided string (Unicode)', function test( t ) {
63-
var out;
64-
65-
out = removeFirst( 'अनुच्छेद', 1 );
66-
t.strictEqual( out, 'नुच्छेद', 'returns expected value' );
67-
68-
out = removeFirst( '六书/六書', 1 );
69-
t.strictEqual( out, '书/六書', 'returns expected value' );
70-
71-
out = removeFirst( '𐒻𐓟', 1 );
72-
t.strictEqual( out, '𐓟', 'returns expected value' );
73-
74-
out = removeFirst( '\uD800', 1 );
75-
t.strictEqual( out, '', 'returns expected value' );
76-
77-
t.end();
78-
});
79-
80-
tape( 'the function supports removing the first `n` Unicode code points of a provided string', function test( t ) {
81-
var out;
82-
83-
out = removeFirst( 'hello world', 1 );
84-
t.strictEqual( out, 'ello world', 'returns expected value' );
85-
86-
out = removeFirst( 'hello world', 7 );
87-
t.strictEqual( out, 'orld', 'returns expected value' );
88-
89-
out = removeFirst( '!!!', 1 );
90-
t.strictEqual( out, '!!', 'returns expected value' );
91-
92-
out = removeFirst( '!!!', 2 );
93-
t.strictEqual( out, '!', 'returns expected value' );
94-
95-
out = removeFirst( 'अनुच्छेद', 1 );
96-
t.strictEqual( out, 'नुच्छेद', 'returns expected value' );
97-
98-
out = removeFirst( '六书/六書', 3 );
99-
t.strictEqual( out, '六書', 'returns expected value' );
100-
101-
out = removeFirst( '𐓟𐒻𐓟', 2 );
102-
t.strictEqual( out, '𐓟', 'returns expected value' );
103-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
10432
t.end();
10533
});

0 commit comments

Comments
 (0)