@ohos-ports/stdlib-symbol 0.0.0-stage → 0.4.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/NOTICE +1 -0
- package/README.md +205 -2
- package/SECURITY.md +5 -0
- package/async-iterator/README.md +129 -0
- package/async-iterator/docs/repl.txt +16 -0
- package/async-iterator/docs/types/index.d.ts +31 -0
- package/async-iterator/docs/types/test.ts +29 -0
- package/async-iterator/lib/index.js +43 -0
- package/async-iterator/lib/main.js +48 -0
- package/async-iterator/package.json +61 -0
- package/ctor/README.md +143 -0
- package/ctor/docs/repl.txt +27 -0
- package/ctor/docs/types/index.d.ts +34 -0
- package/ctor/docs/types/test.ts +34 -0
- package/ctor/lib/index.js +40 -0
- package/ctor/lib/main.js +28 -0
- package/ctor/package.json +60 -0
- package/docs/types/index.d.ts +116 -0
- package/has-instance/README.md +143 -0
- package/has-instance/docs/repl.txt +18 -0
- package/has-instance/docs/types/index.d.ts +31 -0
- package/has-instance/docs/types/test.ts +29 -0
- package/has-instance/lib/index.js +49 -0
- package/has-instance/lib/main.js +54 -0
- package/has-instance/package.json +57 -0
- package/is-concat-spreadable/README.md +122 -0
- package/is-concat-spreadable/docs/repl.txt +18 -0
- package/is-concat-spreadable/docs/types/index.d.ts +31 -0
- package/is-concat-spreadable/docs/types/test.ts +29 -0
- package/is-concat-spreadable/lib/index.js +46 -0
- package/is-concat-spreadable/lib/main.js +50 -0
- package/is-concat-spreadable/package.json +58 -0
- package/iterator/README.md +164 -0
- package/iterator/docs/repl.txt +16 -0
- package/iterator/docs/types/index.d.ts +31 -0
- package/iterator/docs/types/test.ts +29 -0
- package/iterator/lib/index.js +75 -0
- package/iterator/lib/main.js +79 -0
- package/iterator/package.json +58 -0
- package/lib/index.js +105 -0
- package/package.json +58 -4
- package/replace/README.md +130 -0
- package/replace/docs/repl.txt +18 -0
- package/replace/docs/types/index.d.ts +31 -0
- package/replace/docs/types/test.ts +29 -0
- package/replace/lib/index.js +44 -0
- package/replace/lib/main.js +48 -0
- package/replace/package.json +58 -0
- package/to-primitive/README.md +158 -0
- package/to-primitive/docs/repl.txt +16 -0
- package/to-primitive/docs/types/index.d.ts +30 -0
- package/to-primitive/docs/types/test.ts +29 -0
- package/to-primitive/lib/index.js +57 -0
- package/to-primitive/lib/main.js +63 -0
- package/to-primitive/package.json +61 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stdlib/symbol/is-concat-spreadable",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Concat spreadable symbol.",
|
|
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
|
+
"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
|
+
"symbol",
|
|
53
|
+
"sym",
|
|
54
|
+
"concat",
|
|
55
|
+
"array",
|
|
56
|
+
"concatenation"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
@license Apache-2.0
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2018 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
|
+
# IteratorSymbol
|
|
22
|
+
|
|
23
|
+
> Iterator [symbol][mdn-symbol] which specifies the default iterator for an object.
|
|
24
|
+
|
|
25
|
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
|
|
26
|
+
|
|
27
|
+
<section class="intro">
|
|
28
|
+
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<!-- /.intro -->
|
|
32
|
+
|
|
33
|
+
<!-- Package usage documentation. -->
|
|
34
|
+
|
|
35
|
+
<section class="usage">
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
var IteratorSymbol = require( '@stdlib/symbol/iterator' );
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### IteratorSymbol
|
|
44
|
+
|
|
45
|
+
Iterator [`symbol`][mdn-symbol] which specifies the default iterator for an object.
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
var s = typeof IteratorSymbol;
|
|
49
|
+
// e.g., returns 'symbol'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
</section>
|
|
53
|
+
|
|
54
|
+
<!-- /.usage -->
|
|
55
|
+
|
|
56
|
+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
57
|
+
|
|
58
|
+
<section class="notes">
|
|
59
|
+
|
|
60
|
+
## Notes
|
|
61
|
+
|
|
62
|
+
- The [symbol][mdn-symbol] is only supported in environments which support [symbols][mdn-symbol]. In non-supporting environments, the value is `null`.
|
|
63
|
+
|
|
64
|
+
</section>
|
|
65
|
+
|
|
66
|
+
<!-- /.notes -->
|
|
67
|
+
|
|
68
|
+
<!-- Package usage examples. -->
|
|
69
|
+
|
|
70
|
+
<section class="examples">
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
<!-- eslint no-undef: "error" -->
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
var IteratorSymbol = require( '@stdlib/symbol/iterator' );
|
|
78
|
+
|
|
79
|
+
function done( value ) {
|
|
80
|
+
if ( arguments.length === 0 ) {
|
|
81
|
+
return {
|
|
82
|
+
'done': true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
'value': value,
|
|
87
|
+
'done': true
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function iterator() {
|
|
92
|
+
var iter;
|
|
93
|
+
var i;
|
|
94
|
+
|
|
95
|
+
i = -1;
|
|
96
|
+
|
|
97
|
+
iter = {};
|
|
98
|
+
iter.next = next;
|
|
99
|
+
iter.return = done;
|
|
100
|
+
|
|
101
|
+
if ( IteratorSymbol ) {
|
|
102
|
+
// Allow the iterator to work with `for...of`:
|
|
103
|
+
iter[ IteratorSymbol ] = iterator;
|
|
104
|
+
}
|
|
105
|
+
return iter;
|
|
106
|
+
|
|
107
|
+
function next() {
|
|
108
|
+
i += 1;
|
|
109
|
+
return {
|
|
110
|
+
'value': i,
|
|
111
|
+
'done': false
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
var obj = iterator();
|
|
117
|
+
var v;
|
|
118
|
+
while ( v === void 0 || ( v.value < 10 && v.done === false ) ) {
|
|
119
|
+
v = obj.next();
|
|
120
|
+
console.log( v.value );
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
</section>
|
|
125
|
+
|
|
126
|
+
<!-- /.examples -->
|
|
127
|
+
|
|
128
|
+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
129
|
+
|
|
130
|
+
<section class="references">
|
|
131
|
+
|
|
132
|
+
</section>
|
|
133
|
+
|
|
134
|
+
<!-- /.references -->
|
|
135
|
+
|
|
136
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
137
|
+
|
|
138
|
+
<section class="related">
|
|
139
|
+
|
|
140
|
+
* * *
|
|
141
|
+
|
|
142
|
+
## See Also
|
|
143
|
+
|
|
144
|
+
- <span class="package-name">[`@stdlib/symbol/ctor`][@stdlib/symbol/ctor]</span><span class="delimiter">: </span><span class="description">symbols.</span>
|
|
145
|
+
|
|
146
|
+
</section>
|
|
147
|
+
|
|
148
|
+
<!-- /.related -->
|
|
149
|
+
|
|
150
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
151
|
+
|
|
152
|
+
<section class="links">
|
|
153
|
+
|
|
154
|
+
[mdn-symbol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
|
|
155
|
+
|
|
156
|
+
<!-- <related-links> -->
|
|
157
|
+
|
|
158
|
+
[@stdlib/symbol/ctor]: https://github.com/stdlib-js/symbol/tree/main/ctor
|
|
159
|
+
|
|
160
|
+
<!-- </related-links> -->
|
|
161
|
+
|
|
162
|
+
</section>
|
|
163
|
+
|
|
164
|
+
<!-- /.links -->
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
{{alias}}
|
|
3
|
+
Iterator symbol.
|
|
4
|
+
|
|
5
|
+
This symbol specifies the default iterator for an object.
|
|
6
|
+
|
|
7
|
+
The symbol is only supported in ES6/ES2015+ environments. For non-supporting
|
|
8
|
+
environments, the value is `null`.
|
|
9
|
+
|
|
10
|
+
Examples
|
|
11
|
+
--------
|
|
12
|
+
> var s = {{alias}}
|
|
13
|
+
|
|
14
|
+
See Also
|
|
15
|
+
--------
|
|
16
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2021 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
|
+
// EXPORTS //
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Iterator symbol.
|
|
25
|
+
*
|
|
26
|
+
* ## Notes
|
|
27
|
+
*
|
|
28
|
+
* - This symbol specifies the default iterator for an object.
|
|
29
|
+
* - The symbol is only supported in ES6/ES2015+ environments. For non-supporting environments, the value is `null`.
|
|
30
|
+
*/
|
|
31
|
+
export = Symbol.iterator;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2021 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 IteratorSymbol = require( './index' );
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
// TESTS //
|
|
25
|
+
|
|
26
|
+
// The exported value is the iterator symbol...
|
|
27
|
+
{
|
|
28
|
+
IteratorSymbol;
|
|
29
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 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
|
+
* Iterator symbol.
|
|
23
|
+
*
|
|
24
|
+
* @module @stdlib/symbol/iterator
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* var IteratorSymbol = require( '@ohos-ports/stdlib-symbol/iterator' );
|
|
28
|
+
*
|
|
29
|
+
* function iterator() {
|
|
30
|
+
* var it;
|
|
31
|
+
* var i;
|
|
32
|
+
*
|
|
33
|
+
* i = -1;
|
|
34
|
+
*
|
|
35
|
+
* it = {};
|
|
36
|
+
* it.next = next;
|
|
37
|
+
* it.return = done;
|
|
38
|
+
*
|
|
39
|
+
* if ( IteratorSymbol ) {
|
|
40
|
+
* it[ IteratorSymbol ] = iterator;
|
|
41
|
+
* }
|
|
42
|
+
* return it;
|
|
43
|
+
*
|
|
44
|
+
* function next() {
|
|
45
|
+
* i += 1;
|
|
46
|
+
* return {
|
|
47
|
+
* 'value': i,
|
|
48
|
+
* 'done': false
|
|
49
|
+
* };
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* function done( value ) {
|
|
53
|
+
* if ( arguments.length === 0 ) {
|
|
54
|
+
* return {
|
|
55
|
+
* 'done': true
|
|
56
|
+
* };
|
|
57
|
+
* }
|
|
58
|
+
* return {
|
|
59
|
+
* 'value': value,
|
|
60
|
+
* 'done': true
|
|
61
|
+
* };
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* var obj = iterator();
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
// MAIN //
|
|
69
|
+
|
|
70
|
+
var main = require( './main.js' );
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// EXPORTS //
|
|
74
|
+
|
|
75
|
+
module.exports = main;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 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 hasIteratorSymbolSupport = require( '@ohos-ports/stdlib-assert/has-iterator-symbol-support' );
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// MAIN //
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Iterator symbol.
|
|
30
|
+
*
|
|
31
|
+
* @name IteratorSymbol
|
|
32
|
+
* @constant
|
|
33
|
+
* @type {(symbol|null)}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* function iterator() {
|
|
37
|
+
* var it;
|
|
38
|
+
* var i;
|
|
39
|
+
*
|
|
40
|
+
* i = -1;
|
|
41
|
+
*
|
|
42
|
+
* it = {};
|
|
43
|
+
* it.next = next;
|
|
44
|
+
* it.return = done;
|
|
45
|
+
*
|
|
46
|
+
* if ( IteratorSymbol ) {
|
|
47
|
+
* it[ IteratorSymbol ] = iterator;
|
|
48
|
+
* }
|
|
49
|
+
* return it;
|
|
50
|
+
*
|
|
51
|
+
* function next() {
|
|
52
|
+
* i += 1;
|
|
53
|
+
* return {
|
|
54
|
+
* 'value': i,
|
|
55
|
+
* 'done': false
|
|
56
|
+
* };
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* function done( value ) {
|
|
60
|
+
* if ( arguments.length === 0 ) {
|
|
61
|
+
* return {
|
|
62
|
+
* 'done': true
|
|
63
|
+
* };
|
|
64
|
+
* }
|
|
65
|
+
* return {
|
|
66
|
+
* 'value': value,
|
|
67
|
+
* 'done': true
|
|
68
|
+
* };
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
*
|
|
72
|
+
* var obj = iterator();
|
|
73
|
+
*/
|
|
74
|
+
var IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
// EXPORTS //
|
|
78
|
+
|
|
79
|
+
module.exports = IteratorSymbol;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stdlib/symbol/iterator",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Symbol iterator.",
|
|
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
|
+
"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
|
+
"symbol",
|
|
53
|
+
"sym",
|
|
54
|
+
"iterator",
|
|
55
|
+
"iteration",
|
|
56
|
+
"for-of"
|
|
57
|
+
]
|
|
58
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2021 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
|
+
// MODULES //
|
|
26
|
+
|
|
27
|
+
var setReadOnly = require( '@ohos-ports/stdlib-utils/define-read-only-property' );
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// MAIN //
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Top-level namespace.
|
|
34
|
+
*
|
|
35
|
+
* @namespace ns
|
|
36
|
+
*/
|
|
37
|
+
var ns = {};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @name AsyncIteratorSymbol
|
|
41
|
+
* @memberof ns
|
|
42
|
+
* @readonly
|
|
43
|
+
* @type {(symbol|null)}
|
|
44
|
+
* @see {@link module:@stdlib/symbol/async-iterator}
|
|
45
|
+
*/
|
|
46
|
+
setReadOnly( ns, 'AsyncIteratorSymbol', require( './../async-iterator' ) );
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @name Symbol
|
|
50
|
+
* @memberof ns
|
|
51
|
+
* @readonly
|
|
52
|
+
* @type {Function}
|
|
53
|
+
* @see {@link module:@stdlib/symbol/ctor}
|
|
54
|
+
*/
|
|
55
|
+
setReadOnly( ns, 'Symbol', require( './../ctor' ) );
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @name HasInstanceSymbol
|
|
59
|
+
* @memberof ns
|
|
60
|
+
* @readonly
|
|
61
|
+
* @type {(symbol|null)}
|
|
62
|
+
* @see {@link module:@stdlib/symbol/has-instance}
|
|
63
|
+
*/
|
|
64
|
+
setReadOnly( ns, 'HasInstanceSymbol', require( './../has-instance' ) );
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @name IsConcatSpreadableSymbol
|
|
68
|
+
* @memberof ns
|
|
69
|
+
* @readonly
|
|
70
|
+
* @type {(symbol|null)}
|
|
71
|
+
* @see {@link module:@stdlib/symbol/is-concat-spreadable}
|
|
72
|
+
*/
|
|
73
|
+
setReadOnly( ns, 'IsConcatSpreadableSymbol', require( './../is-concat-spreadable' ) );
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @name IteratorSymbol
|
|
77
|
+
* @memberof ns
|
|
78
|
+
* @readonly
|
|
79
|
+
* @type {(symbol|null)}
|
|
80
|
+
* @see {@link module:@stdlib/symbol/iterator}
|
|
81
|
+
*/
|
|
82
|
+
setReadOnly( ns, 'IteratorSymbol', require( './../iterator' ) );
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @name ReplaceSymbol
|
|
86
|
+
* @memberof ns
|
|
87
|
+
* @readonly
|
|
88
|
+
* @type {(symbol|null)}
|
|
89
|
+
* @see {@link module:@stdlib/symbol/replace}
|
|
90
|
+
*/
|
|
91
|
+
setReadOnly( ns, 'ReplaceSymbol', require( './../replace' ) );
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @name ToPrimitiveSymbol
|
|
95
|
+
* @memberof ns
|
|
96
|
+
* @readonly
|
|
97
|
+
* @type {(symbol|null)}
|
|
98
|
+
* @see {@link module:@stdlib/symbol/to-primitive}
|
|
99
|
+
*/
|
|
100
|
+
setReadOnly( ns, 'ToPrimitiveSymbol', require( './../to-primitive' ) );
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
// EXPORTS //
|
|
104
|
+
|
|
105
|
+
module.exports = ns;
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohos-ports/stdlib-symbol",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.4.1-beta.1",
|
|
4
|
+
"description": "Symbol.",
|
|
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
|
+
"doc": "./docs",
|
|
19
|
+
"lib": "./lib"
|
|
20
|
+
},
|
|
21
|
+
"types": "./docs/types",
|
|
22
|
+
"scripts": {},
|
|
23
|
+
"homepage": "https://stdlib.io",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git://github.com/stdlib-js/symbol.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@ohos-ports/stdlib-assert": "^0.4.1-beta.2",
|
|
33
|
+
"@ohos-ports/stdlib-utils": "^0.4.1-beta.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=0.10.0",
|
|
38
|
+
"npm": ">2.7.0"
|
|
39
|
+
},
|
|
40
|
+
"os": [
|
|
41
|
+
"aix",
|
|
42
|
+
"darwin",
|
|
43
|
+
"freebsd",
|
|
44
|
+
"linux",
|
|
45
|
+
"macos",
|
|
46
|
+
"openbsd",
|
|
47
|
+
"sunos",
|
|
48
|
+
"win32",
|
|
49
|
+
"windows",
|
|
50
|
+
"openharmony"
|
|
51
|
+
],
|
|
52
|
+
"keywords": [
|
|
53
|
+
"stdlib",
|
|
54
|
+
"symbol"
|
|
55
|
+
],
|
|
56
|
+
"funding": {
|
|
57
|
+
"type": "opencollective",
|
|
58
|
+
"url": "https://opencollective.com/stdlib"
|
|
59
|
+
}
|
|
60
|
+
}
|