Skip to content

Commit d36aa91

Browse files
committed
Auto-generated commit
1 parent fcabf22 commit d36aa91

File tree

4 files changed

+16
-148
lines changed

4 files changed

+16
-148
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T01:03:32.860Z

.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 & 146 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,155 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var defineProperty = require( '@stdlib/utils-define-property' );
25-
var isDataPropertyIn = require( './../../dist' );
24+
var main = require( './../../dist' );
2625

2726

2827
// TESTS //
2928

30-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3130
t.ok( true, __filename );
32-
t.strictEqual( typeof isDataPropertyIn, 'function', 'export is a function' );
33-
t.end();
34-
});
35-
36-
tape( 'the function returns `true` if an object property has a data descriptor', function test( t ) {
37-
var bool;
38-
var obj;
39-
40-
function Foo() {
41-
this.bar = 'beep';
42-
return this;
43-
}
44-
45-
obj = {
46-
'a': 'b'
47-
};
48-
bool = isDataPropertyIn( obj, 'a' );
49-
t.equal( bool, true, 'returns true' );
50-
51-
bool = isDataPropertyIn( [ 1, 2, 3 ], '1' );
52-
t.equal( bool, true, 'returns true' );
53-
54-
bool = isDataPropertyIn( [ 1, 2, 3 ], 1 );
55-
t.equal( bool, true, 'returns true' );
56-
57-
bool = isDataPropertyIn( new Foo(), 'bar' );
58-
t.equal( bool, true, 'returns true' );
59-
60-
bool = isDataPropertyIn( [ 'a' ], 'length' );
61-
t.equal( bool, true, 'returns true' );
62-
63-
obj = {};
64-
defineProperty( obj, 'a', {
65-
'configurable': false,
66-
'enumerable': false,
67-
'writable': true,
68-
'value': 'b'
69-
});
70-
71-
bool = isDataPropertyIn( obj, 'a' );
72-
t.equal( bool, true, 'returns true' );
73-
74-
t.end();
75-
});
76-
77-
tape( 'the function returns `false` if provided `null` or `undefined` for the first argument', function test( t ) {
78-
var bool;
79-
80-
bool = isDataPropertyIn( null, 'beep' );
81-
t.equal( bool, false, 'returns false when provided null' );
82-
83-
bool = isDataPropertyIn( void 0, 'beep' );
84-
t.equal( bool, false, 'returns false when provided undefined' );
85-
86-
t.end();
87-
});
88-
89-
tape( 'the function returns `false` if provided a property argument which does not correspond to a property having a data descriptor', function test( t ) {
90-
var bool;
91-
var obj;
92-
93-
obj = {
94-
'a': 'b'
95-
};
96-
97-
bool = isDataPropertyIn( obj, 'c' );
98-
t.equal( bool, false, 'returns false' );
99-
100-
obj = {};
101-
defineProperty( obj, 'a', {
102-
'configurable': false,
103-
'enumerable': false,
104-
'get': getter,
105-
'set': setter
106-
});
107-
108-
bool = isDataPropertyIn( obj, 'a' );
109-
t.equal( bool, false, 'returns false' );
110-
111-
t.end();
112-
113-
function getter() {
114-
// No-op...
115-
}
116-
117-
function setter() {
118-
// No-op...
119-
}
120-
});
121-
122-
tape( 'the function returns `true` if provided an inherited property having a data descriptor', function test( t ) {
123-
var bool;
124-
125-
bool = isDataPropertyIn( {}, 'hasOwnProperty' );
126-
t.equal( bool, true, 'returns true' );
127-
128-
bool = isDataPropertyIn( {}, 'toString' );
129-
t.equal( bool, true, 'returns true' );
130-
131-
bool = isDataPropertyIn( {}, 'constructor' );
132-
t.equal( bool, true, 'returns true' );
133-
134-
t.end();
135-
});
136-
137-
tape( 'the function returns `false` if provided an inherited property not having a data descriptor', function test( t ) {
138-
var bool;
139-
var obj;
140-
141-
function Foo() {
142-
return this;
143-
}
144-
145-
defineProperty( Foo.prototype, 'bar', {
146-
'configurable': true,
147-
'enumerable': true,
148-
'get': getter,
149-
'set': setter
150-
});
151-
152-
obj = new Foo();
153-
154-
bool = isDataPropertyIn( obj, 'bar' );
155-
t.equal( bool, false, 'returns false' );
156-
157-
t.end();
158-
159-
function getter() {
160-
// No-op...
161-
}
162-
163-
function setter() {
164-
// No-op...
165-
}
166-
});
167-
168-
tape( 'values are coerced to objects', function test( t ) {
169-
var bool;
170-
171-
bool = isDataPropertyIn( 'beep', 'length' );
172-
t.equal( bool, true, 'returns true' );
173-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
17432
t.end();
17533
});

0 commit comments

Comments
 (0)