Skip to content

Commit 45dfa8e

Browse files
committed
feat: add initial plot/vega/base/property2object implementation
--- 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: passed - 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 30c6108 commit 45dfa8e

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
/**
22+
* Convert a property name to an object with fields for accessing corresponding public and private properties.
23+
*
24+
* @module @stdlib/plot/vega/base/property2object
25+
*
26+
* @example
27+
* var property2object = require( '@stdlib/plot/vega/base/property2object' );
28+
*
29+
* var obj = property2object( 'foo' );
30+
* // returns { 'name': 'foo', 'private': '_foo' }
31+
*/
32+
33+
// MODULES //
34+
35+
var main = require( './main.js' );
36+
37+
38+
// EXPORTS //
39+
40+
module.exports = main;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
// MAIN //
22+
23+
/**
24+
* Converts a property name to an object with fields for accessing corresponding public and private properties.
25+
*
26+
* @param {string} property - property name
27+
* @returns {Object} object
28+
*
29+
* @example
30+
* var obj = property2object( 'foo' );
31+
* // returns { 'name': 'foo', 'private': '_foo' }
32+
*/
33+
function property2object( property ) {
34+
return {
35+
'name': property,
36+
'private': '_'+property
37+
};
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = property2object;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@stdlib/plot/vega/base/property2object",
3+
"version": "0.0.0",
4+
"description": "Convert a property name to an object with fields for accessing corresponding public and private properties.",
5+
"license": "Apache-2.0",
6+
"author": {
7+
"name": "The Stdlib Authors",
8+
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
9+
},
10+
"contributors": [
11+
{
12+
"name": "The Stdlib Authors",
13+
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
14+
}
15+
],
16+
"main": "./lib",
17+
"directories": {
18+
"lib": "./lib"
19+
},
20+
"types": "./docs/types",
21+
"scripts": {},
22+
"homepage": "https://github.com/stdlib-js/stdlib",
23+
"repository": {
24+
"type": "git",
25+
"url": "git://github.com/stdlib-js/stdlib.git"
26+
},
27+
"bugs": {
28+
"url": "https://github.com/stdlib-js/stdlib/issues"
29+
},
30+
"dependencies": {},
31+
"devDependencies": {},
32+
"engines": {
33+
"node": ">=0.10.0",
34+
"npm": ">2.7.0"
35+
},
36+
"os": [
37+
"aix",
38+
"darwin",
39+
"freebsd",
40+
"linux",
41+
"macos",
42+
"openbsd",
43+
"sunos",
44+
"win32",
45+
"windows"
46+
],
47+
"keywords": [
48+
"stdlib",
49+
"plot",
50+
"vega",
51+
"property",
52+
"utilities",
53+
"utility",
54+
"utils",
55+
"util"
56+
],
57+
"__stdlib__": {}
58+
}

0 commit comments

Comments
 (0)