Skip to content

Commit 884492a

Browse files
committed
Move unicode constants to own namespace
1 parent 1341441 commit 884492a

File tree

42 files changed

+410
-61
lines changed

Some content is hidden

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

42 files changed

+410
-61
lines changed

lib/node_modules/@stdlib/assert/has-utf16-surrogate-pair-at/benchmark/benchmark.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var randu = require( '@stdlib/random/base/randu' );
2525
var floor = require( '@stdlib/math/base/special/floor' );
2626
var fromCodePoint = require( '@stdlib/string/from-code-point' );
2727
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
28-
var UNICODE_MAX = require( '@stdlib/constants/string/unicode-max' );
28+
var UNICODE_MAX = require( '@stdlib/constants/string/unicode/max' );
2929
var pkg = require( './../package.json' ).name;
3030
var hasUTF16SurrogatePairAt = require( './../lib' );
3131

lib/node_modules/@stdlib/constants/string/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ var ns = constants;
4949
- <span class="signature">[`PATH_SEP_POSIX`][@stdlib/constants/string/path/sep-posix]</span><span class="delimiter">: </span><span class="description">POSIX path segment separator.</span>
5050
- <span class="signature">[`PATH_SEP_WIN32`][@stdlib/constants/string/path/sep-win32]</span><span class="delimiter">: </span><span class="description">Windows path segment separator.</span>
5151
- <span class="signature">[`PATH_SEP`][@stdlib/constants/string/path/sep]</span><span class="delimiter">: </span><span class="description">platform-specific path segment separator.</span>
52-
- <span class="signature">[`UNICODE_MAX_BMP`][@stdlib/constants/string/unicode-max-bmp]</span><span class="delimiter">: </span><span class="description">maximum Unicode code point in the Basic Multilingual Plane (BMP).</span>
53-
- <span class="signature">[`UNICODE_MAX`][@stdlib/constants/string/unicode-max]</span><span class="delimiter">: </span><span class="description">maximum Unicode code point.</span>
52+
- <span class="signature">[`UNICODE_MAX_BMP`][@stdlib/constants/string/unicode/max-bmp]</span><span class="delimiter">: </span><span class="description">maximum Unicode code point in the Basic Multilingual Plane (BMP).</span>
53+
- <span class="signature">[`UNICODE_MAX`][@stdlib/constants/string/unicode/max]</span><span class="delimiter">: </span><span class="description">maximum Unicode code point.</span>
5454

5555
</div>
5656

@@ -95,9 +95,9 @@ console.log( objectKeys( constants ) );
9595

9696
[@stdlib/constants/string/path/sep]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path/sep
9797

98-
[@stdlib/constants/string/unicode-max-bmp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/unicode-max-bmp
98+
[@stdlib/constants/string/unicode/max-bmp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/unicode/max-bmp
9999

100-
[@stdlib/constants/string/unicode-max]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/unicode-max
100+
[@stdlib/constants/string/unicode/max]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/unicode/max
101101

102102
<!-- </toc-links> -->
103103

lib/node_modules/@stdlib/constants/string/docs/types/index.d.ts

+6-14
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,22 @@
2121
/* tslint:disable:max-line-length */
2222
/* tslint:disable:max-file-line-count */
2323

24-
import UNICODE_MAX = require( '@stdlib/constants/string/unicode-max' );
25-
import UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode-max-bmp' );
24+
import path = require( '@stdlib/constants/string/path' );
25+
import unicode = require( '@stdlib/constants/string/unicode' );
2626

2727
/**
2828
* Interface describing the `string` namespace.
2929
*/
3030
interface Namespace {
3131
/**
32-
* Maximum Unicode code point.
33-
*
34-
* @example
35-
* var bool = ( ns.UNICODE_MAX === 1114111 );
36-
* // returns true
32+
* Standard string path constants.
3733
*/
38-
UNICODE_MAX: typeof UNICODE_MAX;
34+
path: typeof path;
3935

4036
/**
41-
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
42-
*
43-
* @example
44-
* var bool = ( ns.UNICODE_MAX_BMP === 65535 );
45-
* // returns true
37+
* Standard string unicode constants.
4638
*/
47-
UNICODE_MAX_BMP: typeof UNICODE_MAX_BMP;
39+
unicode: typeof unicode;
4840
}
4941

5042
/**

lib/node_modules/@stdlib/constants/string/lib/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
3737
var ns = {};
3838

3939
/**
40-
* @name UNICODE_MAX
40+
* @name path
4141
* @memberof ns
4242
* @readonly
43-
* @type {number}
44-
* @see {@link module:@stdlib/constants/string/unicode-max}
43+
* @type {Namespace}
44+
* @see {@link module:@stdlib/constants/string/path}
4545
*/
46-
setReadOnly( ns, 'UNICODE_MAX', require( '@stdlib/constants/string/unicode-max' ) );
46+
setReadOnly( ns, 'path', require( '@stdlib/constants/string/path' ) );
4747

4848
/**
49-
* @name UNICODE_MAX_BMP
49+
* @name unicode
5050
* @memberof ns
5151
* @readonly
52-
* @type {number}
53-
* @see {@link module:@stdlib/constants/string/unicode-max-bmp}
52+
* @type {Namespace}
53+
* @see {@link module:@stdlib/constants/string/unicode}
5454
*/
55-
setReadOnly( ns, 'UNICODE_MAX_BMP', require( '@stdlib/constants/string/unicode-max-bmp' ) );
55+
setReadOnly( ns, 'unicode', require( '@stdlib/constants/string/unicode' ) );
5656

5757

5858
// EXPORTS //
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
# String Unicode Constants
22+
23+
> Standard library string unicode constants.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var constants = require( '@stdlib/constants/string/unicode' );
31+
```
32+
33+
#### constants
34+
35+
Standard library string unicode constants.
36+
37+
```javascript
38+
var ns = constants;
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 constants = require( '@stdlib/constants/string/unicode' );
65+
66+
console.log( objectKeys( constants ) );
67+
```
68+
69+
</section>
70+
71+
<!-- /.examples -->
72+
73+
<section class="links">
74+
75+
<!-- <toc-links> -->
76+
77+
<!-- </toc-links> -->
78+
79+
</section>
80+
81+
<!-- /.links -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: 2.0
20+
21+
/* tslint:disable:max-line-length */
22+
/* tslint:disable:max-file-line-count */
23+
24+
import UNICODE_MAX = require( '@stdlib/constants/string/unicode/max' );
25+
import UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode/max-bmp' );
26+
27+
/**
28+
* Interface describing the `unicode` namespace.
29+
*/
30+
interface Namespace {
31+
/**
32+
* Maximum Unicode code point.
33+
*
34+
* @example
35+
* var bool = ( ns.UNICODE_MAX === 1114111 );
36+
* // returns true
37+
*/
38+
UNICODE_MAX: typeof UNICODE_MAX;
39+
40+
/**
41+
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
42+
*
43+
* @example
44+
* var bool = ( ns.UNICODE_MAX_BMP === 65535 );
45+
* // returns true
46+
*/
47+
UNICODE_MAX_BMP: typeof UNICODE_MAX_BMP;
48+
}
49+
50+
/**
51+
* Standard string unicode constants.
52+
*/
53+
declare var ns: Namespace;
54+
55+
56+
// EXPORTS //
57+
58+
export = ns;
Original file line numberDiff line numberDiff line change
@@ -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+
/* tslint:disable:no-unused-expression */
20+
21+
import unicode = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The exported value is the expected interface...
27+
{
28+
unicode; // $ExpectType Namespace
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
var objectKeys = require( '@stdlib/utils/keys' );
22+
var ns = require( './../lib' );
23+
24+
console.log( objectKeys( ns ) );
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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( '@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 UNICODE_MAX
41+
* @memberof ns
42+
* @readonly
43+
* @type {number}
44+
* @see {@link module:@stdlib/constants/string/unicode/max}
45+
*/
46+
setReadOnly( ns, 'UNICODE_MAX', require( '@stdlib/constants/string/unicode/max' ) );
47+
48+
/**
49+
* @name UNICODE_MAX_BMP
50+
* @memberof ns
51+
* @readonly
52+
* @type {number}
53+
* @see {@link module:@stdlib/constants/string/unicode/max-bmp}
54+
*/
55+
setReadOnly( ns, 'UNICODE_MAX_BMP', require( '@stdlib/constants/string/unicode/max-bmp' ) );
56+
57+
58+
// EXPORTS //
59+
60+
module.exports = ns;

lib/node_modules/@stdlib/constants/string/unicode-max-bmp/README.md renamed to lib/node_modules/@stdlib/constants/string/unicode/max-bmp/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ limitations under the License.
2727
## Usage
2828

2929
```javascript
30-
var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode-max-bmp' );
30+
var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode/max-bmp' );
3131
```
3232

3333
#### UNICODE_MAX_BMP
@@ -53,7 +53,7 @@ var bool = ( UNICODE_MAX_BMP === 65535 );
5353
var randu = require( '@stdlib/random/base/randu' );
5454
var floor = require( '@stdlib/math/base/special/floor' );
5555
var fromCodePoint = require( '@stdlib/string/from-code-point' );
56-
var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode-max-bmp' );
56+
var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode/max-bmp' );
5757

5858
var x;
5959
var i;

lib/node_modules/@stdlib/constants/string/unicode-max-bmp/lib/index.js renamed to lib/node_modules/@stdlib/constants/string/unicode/max-bmp/lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
/**
2222
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
2323
*
24-
* @module @stdlib/constants/string/unicode-max-bmp
24+
* @module @stdlib/constants/string/unicode/max-bmp
2525
* @type {integer32}
2626
*
2727
* @example
28-
* var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode-max-bmp' );
28+
* var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode/max-bmp' );
2929
* // returns 65535
3030
*/
3131

lib/node_modules/@stdlib/constants/string/unicode-max-bmp/package.json renamed to lib/node_modules/@stdlib/constants/string/unicode/max-bmp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@stdlib/constants/string/unicode-max-bmp",
2+
"name": "@stdlib/constants/string/unicode/max-bmp",
33
"version": "0.0.0",
44
"description": "Maximum Unicode code point in the Basic Multilingual Plane (BMP).",
55
"license": "Apache-2.0",

0 commit comments

Comments
 (0)