Skip to content

Commit b362b7b

Browse files
committed
feat: add dstructs namespace
--- 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: passed - 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: passed - task: lint_javascript_tests status: passed - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 5875a2c commit b362b7b

File tree

7 files changed

+396
-0
lines changed

7 files changed

+396
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# dstructs
22+
23+
> Data structures.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var ns = require( '@stdlib/dstructs' );
31+
```
32+
33+
#### ns
34+
35+
Data structures.
36+
37+
```javascript
38+
var o = ns;
39+
// returns {...}
40+
```
41+
42+
<!-- <toc pattern="*"> -->
43+
44+
<div class="namespace-toc">
45+
46+
</div>
47+
48+
<!-- </toc> -->
49+
50+
</section>
51+
52+
<!-- /.usage -->
53+
54+
<section class="examples">
55+
56+
## Examples
57+
58+
<!-- TODO: better examples -->
59+
60+
<!-- eslint no-undef: "error" -->
61+
62+
```javascript
63+
var objectKeys = require( '@stdlib/utils/keys' );
64+
var ns = require( '@stdlib/dstructs' );
65+
66+
console.log( objectKeys( ns ) );
67+
```
68+
69+
</section>
70+
71+
<!-- /.examples -->
72+
73+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
74+
75+
<section class="related">
76+
77+
</section>
78+
79+
<!-- /.related -->
80+
81+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
82+
83+
<section class="links">
84+
85+
<!-- <toc-links> -->
86+
87+
<!-- </toc-links> -->
88+
89+
</section>
90+
91+
<!-- /.links -->
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+
// TypeScript Version: 4.1
20+
21+
/* eslint-disable max-lines */
22+
23+
import CircularBuffer = require( '@stdlib/dstructs/circular-buffer' );
24+
25+
/**
26+
* Interface describing the namespace.
27+
*/
28+
interface Namespace {
29+
/**
30+
* TODO
31+
*/
32+
CircularBuffer: typeof CircularBuffer;
33+
}
34+
35+
/**
36+
* Data structures.
37+
*/
38+
declare var ns: Namespace;
39+
40+
41+
// EXPORTS //
42+
43+
export = ns;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
/* eslint-disable @typescript-eslint/no-unused-expressions */
20+
21+
import ns = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The exported value is the expected interface...
27+
{
28+
ns; // $ExpectType Namespace
29+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
var objectKeys = require( '@stdlib/utils/keys' );
22+
var ns = require( './../lib' );
23+
24+
console.log( objectKeys( ns ) );
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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+
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
23+
*/
24+
25+
/*
26+
* The following modules are intentionally not exported: tools
27+
*/
28+
29+
// MODULES //
30+
31+
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
32+
33+
34+
// MAIN //
35+
36+
/**
37+
* Top-level namespace.
38+
*
39+
* @namespace ns
40+
*/
41+
var ns = {};
42+
43+
/**
44+
* @name CircularBuffer
45+
* @memberof ns
46+
* @readonly
47+
* @type {Function}
48+
* @see {@link module:@stdlib/dstructs/circular-buffer}
49+
*/
50+
setReadOnly( ns, 'CircularBuffer', require( '@stdlib/dstructs/circular-buffer' ) );
51+
52+
/**
53+
* @name CompactAdjacencyMatrix
54+
* @memberof ns
55+
* @readonly
56+
* @type {Function}
57+
* @see {@link module:@stdlib/dstructs/compact-adjacency-matrix}
58+
*/
59+
setReadOnly( ns, 'CompactAdjacencyMatrix', require( '@stdlib/dstructs/compact-adjacency-matrix' ) );
60+
61+
/**
62+
* @name DoublyLinkedList
63+
* @memberof ns
64+
* @readonly
65+
* @type {Function}
66+
* @see {@link module:@stdlib/dstructs/doubly-linked-list}
67+
*/
68+
setReadOnly( ns, 'DoublyLinkedList', require( '@stdlib/dstructs/doubly-linked-list' ) );
69+
70+
/**
71+
* @name FIFO
72+
* @memberof ns
73+
* @readonly
74+
* @type {Function}
75+
* @see {@link module:@stdlib/dstructs/fifo}
76+
*/
77+
setReadOnly( ns, 'FIFO', require( '@stdlib/dstructs/fifo' ) );
78+
79+
/**
80+
* @name LinkedList
81+
* @memberof ns
82+
* @readonly
83+
* @type {Function}
84+
* @see {@link module:@stdlib/dstructs/linked-list}
85+
*/
86+
setReadOnly( ns, 'LinkedList', require( '@stdlib/dstructs/linked-list' ) );
87+
88+
/**
89+
* @name namedtypedtuple
90+
* @memberof ns
91+
* @readonly
92+
* @type {Function}
93+
* @see {@link module:@stdlib/dstructs/named-typed-tuple}
94+
*/
95+
setReadOnly( ns, 'namedtypedtuple', require( '@stdlib/dstructs/named-typed-tuple' ) );
96+
97+
/**
98+
* @name Stack
99+
* @memberof ns
100+
* @readonly
101+
* @type {Function}
102+
* @see {@link module:@stdlib/dstructs/stack}
103+
*/
104+
setReadOnly( ns, 'Stack', require( '@stdlib/dstructs/stack' ) );
105+
106+
107+
// EXPORTS //
108+
109+
module.exports = ns;
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "@stdlib/dstructs",
3+
"version": "0.0.0",
4+
"description": "Data structures.",
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/index.js",
17+
"directories": {
18+
"doc": "./docs",
19+
"example": "./examples",
20+
"lib": "./lib",
21+
"test": "./test"
22+
},
23+
"types": "./docs/types",
24+
"scripts": {},
25+
"homepage": "https://github.com/stdlib-js/stdlib",
26+
"repository": {
27+
"type": "git",
28+
"url": "git://github.com/stdlib-js/stdlib.git"
29+
},
30+
"bugs": {
31+
"url": "https://github.com/stdlib-js/stdlib/issues"
32+
},
33+
"dependencies": {},
34+
"devDependencies": {},
35+
"engines": {
36+
"node": ">=0.10.0",
37+
"npm": ">2.7.0"
38+
},
39+
"os": [
40+
"aix",
41+
"darwin",
42+
"freebsd",
43+
"linux",
44+
"macos",
45+
"openbsd",
46+
"sunos",
47+
"win32",
48+
"windows"
49+
],
50+
"keywords": [
51+
"stdlib",
52+
"data",
53+
"structures",
54+
"containers",
55+
"structs",
56+
"data structures",
57+
"namespace",
58+
"ns"
59+
]
60+
}

0 commit comments

Comments
 (0)