Skip to content

Commit 27af29d

Browse files
committed
Auto-generated commit
1 parent e725b42 commit 27af29d

8 files changed

Lines changed: 82 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,37 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-12-19)
7+
## Unreleased (2025-12-20)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`3286c01`](https://github.com/stdlib-js/stdlib/commit/3286c016f295924c2e2993cdb8c689ceaf03c6d8) - add constructor name property
14+
15+
</section>
16+
17+
<!-- /.features -->
18+
19+
<section class="bug-fixes">
20+
21+
### Bug Fixes
22+
23+
- [`66c3419`](https://github.com/stdlib-js/stdlib/commit/66c34197acf3eb6c43480fc93bc92d1ddd31b846) - add missing name to complex constructor TypeScript declarations
24+
25+
</section>
26+
27+
<!-- /.bug-fixes -->
828

929
<section class="commits">
1030

1131
### Commits
1232

1333
<details>
1434

35+
- [`66c3419`](https://github.com/stdlib-js/stdlib/commit/66c34197acf3eb6c43480fc93bc92d1ddd31b846) - **fix:** add missing name to complex constructor TypeScript declarations _(by Philipp Burckhardt)_
36+
- [`5a193fb`](https://github.com/stdlib-js/stdlib/commit/5a193fb3a316a7ea4969c3379dfa9f4ab2b462b1) - **docs:** document property _(by Athan Reines)_
37+
- [`3286c01`](https://github.com/stdlib-js/stdlib/commit/3286c016f295924c2e2993cdb8c689ceaf03c6d8) - **feat:** add constructor name property _(by Athan Reines)_
1538
- [`29270fb`](https://github.com/stdlib-js/stdlib/commit/29270fbbe57e00d44163dd23f87eaf1db81b563a) - **refactor:** use utility to set properties _(by Athan Reines)_
1639
- [`6eee151`](https://github.com/stdlib-js/stdlib/commit/6eee15199727d04e3757e66f38384e97b8a333da) - **style:** fix indentation in JSON files _(by Philipp Burckhardt)_
1740

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ var z = new Complex128( 5.0, 3.0 );
8686

8787
## Properties
8888

89+
#### Complex128.name
90+
91+
Static property returning the constructor name.
92+
93+
```javascript
94+
var str = Complex128.name;
95+
// returns 'Complex128'
96+
```
97+
8998
#### Complex128.BYTES_PER_ELEMENT
9099

91100
Size (in bytes) of each component.
@@ -668,8 +677,8 @@ Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
668677
669678
-->
670679

671-
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
672-
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
680+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
681+
[chat-url]: https://stdlib.zulipchat.com
673682

674683
[stdlib]: https://github.com/stdlib-js/stdlib
675684

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/repl.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
Read-only property returning the imaginary component.
2626

2727

28+
{{alias}}.name
29+
Constructor name.
30+
31+
Examples
32+
--------
33+
> var str = {{alias}}.name
34+
'Complex128'
35+
36+
2837
{{alias}}.BYTES_PER_ELEMENT
2938
Size (in bytes) of each component.
3039

docs/types/index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ declare class Complex128 {
3535
*/
3636
constructor( real: number, imag: number );
3737

38+
/**
39+
* Constructor name.
40+
*
41+
* @example
42+
* var str = Complex128.name;
43+
* // returns 'Complex128'
44+
*/
45+
static readonly name: 'Complex128';
46+
3847
/**
3948
* Read-only property returning the real component.
4049
*

lib/main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ function Complex128( real, imag ) {
6060
return this;
6161
}
6262

63+
/**
64+
* Constructor name.
65+
*
66+
* @name name
67+
* @memberof Complex128
68+
* @readonly
69+
* @type {string}
70+
* @default 'Complex128'
71+
*
72+
* @example
73+
* var name = Complex128.name;
74+
* // returns 'Complex128'
75+
*/
76+
setReadOnly( Complex128, 'name', 'Complex128' );
77+
6378
/**
6479
* Size (in bytes) of each component.
6580
*

test/test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ tape( 'the constructor requires the `new` keyword', function test( t ) {
101101
}
102102
});
103103

104+
tape( 'the constructor has a read-only `name` property', function test( t ) {
105+
t.strictEqual( hasOwnProp( Complex128, 'name' ), true, 'has property' );
106+
t.strictEqual( Complex128.name, 'Complex128', 'returns expected value' );
107+
t.throws( foo, Error, 'throws an error' );
108+
t.end();
109+
110+
function foo() {
111+
Complex128.name = 'Foo';
112+
}
113+
});
114+
104115
tape( 'the constructor has a read-only `BYTES_PER_ELEMENT` property', function test( t ) {
105116
t.strictEqual( hasOwnProp( Complex128, 'BYTES_PER_ELEMENT' ), true, 'has property' );
106117
t.strictEqual( Complex128.BYTES_PER_ELEMENT, 8, 'returns expected value' );

0 commit comments

Comments
 (0)