Skip to content

Commit 1d341c0

Browse files
committed
refactor: use properties object and use utilities
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 206f511 commit 1d341c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1360
-290
lines changed

lib/node_modules/@stdlib/plot/vega/title/lib/align/get.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var prop = require( './properties.js' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -29,7 +34,7 @@
2934
* @returns {(string|void)} alignment
3035
*/
3136
function get() {
32-
return this._align;
37+
return this[ prop.private ];
3338
}
3439

3540

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var property2object = require( '@stdlib/plot/vega/base/property2object' );
24+
25+
26+
// MAIN //
27+
28+
var obj = property2object( 'align' );
29+
30+
31+
// EXPORTS //
32+
33+
module.exports = obj;

lib/node_modules/@stdlib/plot/vega/title/lib/align/set.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ var logger = require( 'debug' );
2626
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
2727
var isUndefined = require( '@stdlib/assert/is-undefined' );
2828
var format = require( '@stdlib/string/format' );
29+
var changeEvent = require( './../change_event.js' );
30+
var prop = require( './properties.js' );
2931

3032

3133
// VARIABLES //
3234

33-
var debug = logger( 'vega:title:set:align' );
35+
var debug = logger( 'vega:title:set:'+prop.name );
3436

3537

3638
// MAIN //
@@ -49,12 +51,12 @@ var debug = logger( 'vega:title:set:align' );
4951
*/
5052
function set( value ) {
5153
if ( !isString( value ) && !isUndefined( value ) ) {
52-
throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'align', value ) );
54+
throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', prop.name, value ) );
5355
}
54-
if ( value !== this._align ) {
55-
debug( 'Current value: %s. New value: %s.', this._align, value );
56-
this._align = value;
57-
this.emit( 'change' );
56+
if ( value !== this[ prop.private ] ) {
57+
debug( 'Current value: %s. New value: %s.', this[ prop.private ], value );
58+
this[ prop.private ] = value;
59+
this.emit( 'change', changeEvent( prop.name ) );
5860
}
5961
}
6062

lib/node_modules/@stdlib/plot/vega/title/lib/anchor/get.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var prop = require( './properties.js' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -29,7 +34,7 @@
2934
* @returns {string} anchor position
3035
*/
3136
function get() {
32-
return this._anchor;
37+
return this[ prop.private ];
3338
}
3439

3540

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var property2object = require( '@stdlib/plot/vega/base/property2object' );
24+
25+
26+
// MAIN //
27+
28+
var obj = property2object( 'anchor' );
29+
30+
31+
// EXPORTS //
32+
33+
module.exports = obj;

lib/node_modules/@stdlib/plot/vega/title/lib/anchor/set.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ var isAnchorPosition = require( '@stdlib/plot/vega/base/assert/is-anchor-positio
2727
var join = require( '@stdlib/array/base/join' );
2828
var anchorPositions = require( '@stdlib/plot/vega/base/anchor-positions' );
2929
var format = require( '@stdlib/string/format' );
30+
var changeEvent = require( './../change_event.js' );
31+
var prop = require( './properties.js' );
3032

3133

3234
// VARIABLES //
3335

34-
var debug = logger( 'vega:title:set:anchor' );
36+
var debug = logger( 'vega:title:set:'+prop.name );
3537

3638

3739
// MAIN //
@@ -46,12 +48,12 @@ var debug = logger( 'vega:title:set:anchor' );
4648
*/
4749
function set( value ) {
4850
if ( !isAnchorPosition( value ) ) {
49-
throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'anchor', join( anchorPositions(), '", "' ), value ) );
51+
throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', prop.name, join( anchorPositions(), '", "' ), value ) );
5052
}
51-
if ( value !== this._anchor ) {
52-
debug( 'Current value: %s. New value: %s.', this._anchor, value );
53-
this._anchor = value;
54-
this.emit( 'change' );
53+
if ( value !== this[ prop.private ] ) {
54+
debug( 'Current value: %s. New value: %s.', this[ prop.private ], value );
55+
this[ prop.private ] = value;
56+
this.emit( 'change', changeEvent( prop.name ) );
5557
}
5658
}
5759

lib/node_modules/@stdlib/plot/vega/title/lib/angle/get.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var prop = require( './properties.js' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -29,7 +34,7 @@
2934
* @returns {(number|void)} angle
3035
*/
3136
function get() {
32-
return this._angle;
37+
return this[ prop.private ];
3338
}
3439

3540

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var property2object = require( '@stdlib/plot/vega/base/property2object' );
24+
25+
26+
// MAIN //
27+
28+
var obj = property2object( 'angle' );
29+
30+
31+
// EXPORTS //
32+
33+
module.exports = obj;

lib/node_modules/@stdlib/plot/vega/title/lib/angle/set.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ var logger = require( 'debug' );
2626
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
2727
var isUndefined = require( '@stdlib/assert/is-undefined' );
2828
var format = require( '@stdlib/string/format' );
29+
var changeEvent = require( './../change_event.js' );
30+
var prop = require( './properties.js' );
2931

3032

3133
// VARIABLES //
3234

33-
var debug = logger( 'vega:title:set:angle' );
35+
var debug = logger( 'vega:title:set:'+prop.name );
3436

3537

3638
// MAIN //
@@ -49,12 +51,12 @@ var debug = logger( 'vega:title:set:angle' );
4951
*/
5052
function set( value ) {
5153
if ( !isNumber( value ) && !isUndefined( value ) ) {
52-
throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', 'angle', value ) );
54+
throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) );
5355
}
54-
if ( value !== this._angle ) {
55-
debug( 'Current value: %s. New value: %s.', this._angle, value );
56-
this._angle = value;
57-
this.emit( 'change' );
56+
if ( value !== this[ prop.private ] ) {
57+
debug( 'Current value: %s. New value: %s.', this[ prop.private ], value );
58+
this[ prop.private ] = value;
59+
this.emit( 'change', changeEvent( prop.name ) );
5860
}
5961
}
6062

lib/node_modules/@stdlib/plot/vega/title/lib/aria/get.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var prop = require( './properties.js' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -29,7 +34,7 @@
2934
* @returns {boolean} boolean flag
3035
*/
3136
function get() {
32-
return this._aria;
37+
return this[ prop.private ];
3338
}
3439

3540

0 commit comments

Comments
 (0)