Skip to content

Commit cf1fca5

Browse files
committed
Auto-generated commit
1 parent 4b7c92b commit cf1fca5

File tree

4 files changed

+16
-154
lines changed

4 files changed

+16
-154
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T02:36:40.657Z

.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: 4 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2020 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,161 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var codePointAt = 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 codePointAt, 'function', 'main export is a function' );
32-
t.end();
33-
});
34-
35-
tape( 'the function throws an error if the first argument is not a string', function test( t ) {
36-
var values;
37-
var i;
38-
39-
values = [
40-
-5,
41-
3.14,
42-
-1.0,
43-
NaN,
44-
true,
45-
false,
46-
null,
47-
void 0,
48-
[ 'beep', 'boop' ],
49-
[ 1, 2, 3 ],
50-
{},
51-
function noop() {}
52-
];
53-
54-
for ( i = 0; i < values.length; i++ ) {
55-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
56-
}
57-
t.end();
58-
59-
function badValue( value ) {
60-
return function badValue() {
61-
codePointAt( value, 0 );
62-
};
63-
}
64-
});
65-
66-
tape( 'the function throws an error if the second argument is not an integer', function test( t ) {
67-
var values;
68-
var i;
69-
70-
values = [
71-
'bar',
72-
3.14,
73-
-3.14,
74-
NaN,
75-
true,
76-
false,
77-
null,
78-
void 0,
79-
[ 'beep', 'boop' ],
80-
[ 1, 2, 3 ],
81-
{},
82-
function noop() {}
83-
];
84-
for ( i = 0; i < values.length; i++ ) {
85-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
86-
}
87-
t.end();
88-
89-
function badValue( value ) {
90-
return function badValue() {
91-
codePointAt( 'foo', value );
92-
};
93-
}
94-
});
95-
96-
tape( 'the function throws an error if the third argument is not a boolean', function test( t ) {
97-
var values;
98-
var i;
99-
100-
values = [
101-
'bar',
102-
-5,
103-
3.14,
104-
-1.0,
105-
NaN,
106-
null,
107-
void 0,
108-
[ 'beep', 'boop' ],
109-
[ 1, 2, 3 ],
110-
{},
111-
function noop() {}
112-
];
113-
for ( i = 0; i < values.length; i++ ) {
114-
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
115-
}
116-
t.end();
117-
118-
function badValue( value ) {
119-
return function badValue() {
120-
codePointAt( 'foo', 0, value );
121-
};
122-
}
123-
});
124-
125-
tape( 'the function throws an error if a provided position is not a valid index in the provided string', function test( t ) {
126-
var values;
127-
var i;
128-
129-
values = [
130-
[ 'bar', 3 ],
131-
[ 'bar', -4 ],
132-
[ 'string', 7 ],
133-
[ 'string', -8 ],
134-
[ '', 0 ]
135-
];
136-
for ( i = 0; i < values.length; i++ ) {
137-
t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
138-
}
139-
t.end();
140-
141-
function badValue( value ) {
142-
return function badValue() {
143-
codePointAt( value[ 0 ], value[ 1 ] );
144-
};
145-
}
146-
});
147-
148-
tape( 'the arity of the function is 3', function test( t ) {
149-
t.strictEqual( codePointAt.length, 3, 'has length 3' );
150-
t.end();
151-
});
152-
153-
tape( 'the function returns the code point at a specified string position', function test( t ) {
154-
var out;
155-
156-
out = codePointAt( 'last man standing', 4 );
157-
t.strictEqual( out, 0x20, 'returns expected value' );
158-
159-
out = codePointAt( 'last man standing', -13 );
160-
t.strictEqual( out, 0x20, 'returns expected value' );
161-
162-
out = codePointAt( 'presidential election', 8, true );
163-
t.strictEqual( out, 0x74, 'returns expected value' );
164-
165-
out = codePointAt( 'presidential election', -13, true );
166-
t.strictEqual( out, 0x74, 'returns expected value' );
167-
168-
out = codePointAt( 'अनुच्छेद', 2 );
169-
t.strictEqual( out, 0x941, 'returns expected value' );
170-
171-
out = codePointAt( 'अनुच्छेद', -6 );
172-
t.strictEqual( out, 0x941, 'returns expected value' );
173-
174-
out = codePointAt( '🌷', 0, true );
175-
t.strictEqual( out, 0x1F337, 'returns expected value' );
176-
177-
out = codePointAt( '🌷', -2, true );
178-
t.strictEqual( out, 0x1F337, 'returns expected value' );
179-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
18032
t.end();
18133
});

0 commit comments

Comments
 (0)