Skip to content

Commit ab159eb

Browse files
committed
Auto-generated commit
1 parent a586a90 commit ab159eb

File tree

4 files changed

+15
-80
lines changed

4 files changed

+15
-80
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:37.319Z

.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 & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -21,88 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var removeLast = 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 removeLast, '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( removeLast( '', 1 ), '', 'returns expected value' );
37-
t.strictEqual( removeLast( '', 2 ), '', 'returns expected value' );
38-
t.strictEqual( removeLast( '', 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( removeLast( 'hello world', 0 ), 'hello world', 'returns expected value' );
44-
t.end();
45-
});
46-
47-
tape( 'the function removes the last Unicode code point of a provided string (ascii)', function test( t ) {
48-
var out;
49-
50-
out = removeLast( 'hello world', 1 );
51-
t.strictEqual( out, 'hello worl', 'returns expected value' );
52-
53-
out = removeLast( '!!!', 1 );
54-
t.strictEqual( out, '!!', 'returns expected value' );
55-
56-
out = removeLast( 'Hello World', 1 );
57-
t.strictEqual( out, 'Hello Worl', 'returns expected value' );
58-
59-
t.end();
60-
});
61-
62-
tape( 'the function removes the last Unicode code point of a provided string (Unicode)', function test( t ) {
63-
var out;
64-
65-
out = removeLast( 'अनुच्छेद', 1 );
66-
t.strictEqual( out, 'अनुच्छे', 'returns expected value' );
67-
68-
out = removeLast( '六书/六書', 1 );
69-
t.strictEqual( out, '六书/六', 'returns expected value' );
70-
71-
out = removeLast( '𐒻𐓟', 1 );
72-
t.strictEqual( out, '𐒻', 'returns expected value' );
73-
74-
out = removeLast( '𐒻𐓟', 1 );
75-
t.strictEqual( out, '𐒻', 'returns expected value' );
76-
77-
out = removeLast( '\uDC00', 1 );
78-
t.strictEqual( out, '', 'returns expected value' );
79-
80-
t.end();
81-
});
82-
83-
tape( 'the function supports removing the last `n` Unicode code points of a provided string', function test( t ) {
84-
var out;
85-
86-
out = removeLast( 'hello world', 1 );
87-
t.strictEqual( out, 'hello worl', 'returns expected value' );
88-
89-
out = removeLast( 'hello world', 7 );
90-
t.strictEqual( out, 'hell', 'returns expected value' );
91-
92-
out = removeLast( '!!!', 1 );
93-
t.strictEqual( out, '!!', 'returns expected value' );
94-
95-
out = removeLast( '!!!', 2 );
96-
t.strictEqual( out, '!', 'returns expected value' );
97-
98-
out = removeLast( 'अनुच्छेद', 1 );
99-
t.strictEqual( out, 'अनुच्छे', 'returns expected value' );
100-
101-
out = removeLast( '六书/六書', 3 );
102-
t.strictEqual( out, '六书', 'returns expected value' );
103-
104-
out = removeLast( '𐒻𐓟𐓟', 2 );
105-
t.strictEqual( out, '𐒻', 'returns expected value' );
106-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
10732
t.end();
10833
});

0 commit comments

Comments
 (0)