Skip to content

Commit 1341441

Browse files
committed
Move string path constants to own namespace
1 parent 3a8f384 commit 1341441

74 files changed

Lines changed: 563 additions & 244 deletions

File tree

Some content is hidden

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

lib/node_modules/@stdlib/_tools/package-json/scripts/update_names

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@
1313

1414
// MODULES //
1515

16-
var debug = require( 'debug' )( 'update-package-names' );
1716
var join = require( 'path' ).join;
1817
var resolve = require( 'path' ).resolve;
18+
var logger = require( 'debug' );
1919
var writeFile = require( '@stdlib/fs/write-file' ).sync;
2020
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
21-
var SEP = require( '@stdlib/constants/string/path-sep' );
21+
var SEP = require( '@stdlib/constants/string/path/sep' );
2222
var findPkgs = require( '@stdlib/_tools/pkgs/find' ).sync;
2323

2424

2525
// VARIABLES //
2626

27+
var debug = logger( 'update-package-names' );
2728
var ROOT = resolve( __dirname, '../../../../../../lib/node_modules' );
2829

2930

@@ -34,7 +35,7 @@ var ROOT = resolve( __dirname, '../../../../../../lib/node_modules' );
3435
*
3536
* ## Notes
3637
*
37-
* * The implementation assumes that a package name can be inferred from the directory structure.
38+
* - The implementation assumes that a package name can be inferred from the directory structure.
3839
*
3940
*
4041
* @private

lib/node_modules/@stdlib/_tools/package-json/scripts/update_tools_names

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@
1313

1414
// MODULES //
1515

16-
var debug = require( 'debug' )( 'update-tools-package-names' );
1716
var join = require( 'path' ).join;
1817
var resolve = require( 'path' ).resolve;
18+
var logger = require( 'debug' );
1919
var writeFile = require( '@stdlib/fs/write-file' ).sync;
2020
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
21-
var SEP = require( '@stdlib/constants/string/path-sep' );
21+
var SEP = require( '@stdlib/constants/string/path/sep' );
2222
var findPkgs = require( '@stdlib/_tools/pkgs/find' ).sync;
2323

2424

2525
// VARIABLES //
2626

27+
var debug = logger( 'update-tools-package-names' );
2728
var ROOT = resolve( __dirname, '../../../../../../tools' );
2829
var PREFIX = '@stdlib/tools/';
2930

@@ -35,7 +36,7 @@ var PREFIX = '@stdlib/tools/';
3536
*
3637
* ## Notes
3738
*
38-
* * The implementation assumes that a package name can be inferred from the directory structure.
39+
* - The implementation assumes that a package name can be inferred from the directory structure.
3940
*
4041
*
4142
* @private

lib/node_modules/@stdlib/_tools/pkgs/namespaces/lib/filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
2424
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
2525
var isObject = require( '@stdlib/assert/is-plain-object' );
26-
var PATH_SEP = require( '@stdlib/constants/string/path-sep' );
26+
var PATH_SEP = require( '@stdlib/constants/string/path/sep' );
2727

2828

2929
// MAIN //

lib/node_modules/@stdlib/_tools/pkgs/tree/lib/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
2424
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
2525
var isObject = require( '@stdlib/assert/is-plain-object' );
26-
var PATH_SEP = require( '@stdlib/constants/string/path-sep' );
26+
var PATH_SEP = require( '@stdlib/constants/string/path/sep' );
2727

2828

2929
// MAIN //

lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations-src-urls/lib/transformer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var join = require( 'path' ).join;
2525
var logger = require( 'debug' );
2626
var visit = require( 'unist-util-visit' );
27-
var PATH_SEP = require( '@stdlib/constants/string/path-sep' );
27+
var PATH_SEP = require( '@stdlib/constants/string/path/sep' );
2828
var rawgit = require( '@stdlib/_tools/utils/rawgit-url' );
2929
var git = require( './git.js' );
3030

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ var ns = constants;
4343

4444
<div class="namespace-toc">
4545

46-
- <span class="signature">[`PATH_DELIMITER_POSIX`][@stdlib/constants/string/path-delimiter-posix]</span><span class="delimiter">: </span><span class="description">POSIX path delimiter.</span>
47-
- <span class="signature">[`PATH_DELIMITER_WIN32`][@stdlib/constants/string/path-delimiter-win32]</span><span class="delimiter">: </span><span class="description">Windows path delimiter.</span>
48-
- <span class="signature">[`PATH_DELIMITER`][@stdlib/constants/string/path-delimiter]</span><span class="delimiter">: </span><span class="description">platform-specific path delimiter.</span>
49-
- <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>
50-
- <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>
51-
- <span class="signature">[`PATH_SEP`][@stdlib/constants/string/path-sep]</span><span class="delimiter">: </span><span class="description">platform-specific path segment separator.</span>
46+
- <span class="signature">[`PATH_DELIMITER_POSIX`][@stdlib/constants/string/path/delimiter-posix]</span><span class="delimiter">: </span><span class="description">POSIX path delimiter.</span>
47+
- <span class="signature">[`PATH_DELIMITER_WIN32`][@stdlib/constants/string/path/delimiter-win32]</span><span class="delimiter">: </span><span class="description">Windows path delimiter.</span>
48+
- <span class="signature">[`PATH_DELIMITER`][@stdlib/constants/string/path/delimiter]</span><span class="delimiter">: </span><span class="description">platform-specific path delimiter.</span>
49+
- <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>
50+
- <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>
51+
- <span class="signature">[`PATH_SEP`][@stdlib/constants/string/path/sep]</span><span class="delimiter">: </span><span class="description">platform-specific path segment separator.</span>
5252
- <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>
5353
- <span class="signature">[`UNICODE_MAX`][@stdlib/constants/string/unicode-max]</span><span class="delimiter">: </span><span class="description">maximum Unicode code point.</span>
5454

@@ -83,17 +83,17 @@ console.log( objectKeys( constants ) );
8383

8484
<!-- <toc-links> -->
8585

86-
[@stdlib/constants/string/path-delimiter-posix]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path-delimiter-posix
86+
[@stdlib/constants/string/path/delimiter-posix]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path/delimiter-posix
8787

88-
[@stdlib/constants/string/path-delimiter-win32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path-delimiter-win32
88+
[@stdlib/constants/string/path/delimiter-win32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path/delimiter-win32
8989

90-
[@stdlib/constants/string/path-delimiter]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path-delimiter
90+
[@stdlib/constants/string/path/delimiter]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path/delimiter
9191

92-
[@stdlib/constants/string/path-sep-posix]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path-sep-posix
92+
[@stdlib/constants/string/path/sep-posix]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path/sep-posix
9393

94-
[@stdlib/constants/string/path-sep-win32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path-sep-win32
94+
[@stdlib/constants/string/path/sep-win32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/string/path/sep-win32
9595

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

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

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

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -21,95 +21,13 @@
2121
/* tslint:disable:max-line-length */
2222
/* tslint:disable:max-file-line-count */
2323

24-
import PATH_DELIMITER = require( '@stdlib/constants/string/path-delimiter' );
25-
import PATH_DELIMITER_POSIX = require( '@stdlib/constants/string/path-delimiter-posix' );
26-
import PATH_DELIMITER_WIN32 = require( '@stdlib/constants/string/path-delimiter-win32' );
27-
import PATH_SEP = require( '@stdlib/constants/string/path-sep' );
28-
import PATH_SEP_POSIX = require( '@stdlib/constants/string/path-sep-posix' );
29-
import PATH_SEP_WIN32 = require( '@stdlib/constants/string/path-sep-win32' );
3024
import UNICODE_MAX = require( '@stdlib/constants/string/unicode-max' );
3125
import UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode-max-bmp' );
3226

3327
/**
3428
* Interface describing the `string` namespace.
3529
*/
3630
interface Namespace {
37-
/**
38-
* Platform-specific path delimiter.
39-
*
40-
* @example
41-
* var IS_WINDOWS = require( `@stdlib/assert/is-windows` );
42-
*
43-
* var PATH;
44-
* var paths;
45-
*
46-
* if ( IS_WINDOWS ) {
47-
* PATH = 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\';
48-
* paths = PATH.split( ns.PATH_DELIMITER );
49-
* // returns ['C:\\Windows\\system32','C:\\Windows','C:\\Program Files\\node\\']
50-
* } else {
51-
* PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin';
52-
* paths = PATH.split( ns.PATH_DELIMITER );
53-
* // returns ['/usr/bin','/bin','/usr/sbin','/sbin','/usr/local/bin']
54-
* }
55-
*/
56-
PATH_DELIMITER: typeof PATH_DELIMITER;
57-
58-
/**
59-
* POSIX path delimiter.
60-
*
61-
* @example
62-
* var PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin';
63-
* var paths = PATH.split( ns.PATH_DELIMITER_POSIX );
64-
* // returns ['/usr/bin','/bin','/usr/sbin','/sbin','/usr/local/bin']
65-
*/
66-
PATH_DELIMITER_POSIX: typeof PATH_DELIMITER_POSIX;
67-
68-
/**
69-
* Windows path delimiter.
70-
*
71-
* @example
72-
* var PATH = 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\';
73-
* var paths = PATH.split( ns.PATH_DELIMITER_WIN32 );
74-
* // returns ['C:\\Windows\\system32','C:\\Windows','C:\\Program Files\\node\\']
75-
*/
76-
PATH_DELIMITER_WIN32: typeof PATH_DELIMITER_WIN32;
77-
78-
/**
79-
* Platform-specific path segment separator.
80-
*
81-
* @example
82-
* var IS_WINDOWS = require( `@stdlib/assert/is-windows` );
83-
*
84-
* var parts;
85-
* if ( IS_WINDOWS ) {
86-
* parts = 'foo\\bar\\baz'.split( ns.PATH_SEP );
87-
* // returns ['foo','bar','baz']
88-
* } else {
89-
* parts = 'foo/bar/baz'.split( ns.PATH_SEP );
90-
* // returns ['foo','bar','baz']
91-
* }
92-
*/
93-
PATH_SEP: typeof PATH_SEP;
94-
95-
/**
96-
* POSIX path segment separator.
97-
*
98-
* @example
99-
* var parts = 'foo/bar/baz'.split( ns.PATH_SEP_POSIX );
100-
* // returns ['foo','bar','baz']
101-
*/
102-
PATH_SEP_POSIX: typeof PATH_SEP_POSIX;
103-
104-
/**
105-
* Windows path segment separator.
106-
*
107-
* @example
108-
* var parts = 'foo\\bar\\baz'.split( ns.PATH_SEP_WIN32 );
109-
* // returns ['foo','bar','baz']
110-
*/
111-
PATH_SEP_WIN32: typeof PATH_SEP_WIN32;
112-
11331
/**
11432
* Maximum Unicode code point.
11533
*

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

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -36,60 +36,6 @@ var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
3636
*/
3737
var ns = {};
3838

39-
/**
40-
* @name PATH_DELIMITER
41-
* @memberof ns
42-
* @readonly
43-
* @type {string}
44-
* @see {@link module:@stdlib/constants/string/path-delimiter}
45-
*/
46-
setReadOnly( ns, 'PATH_DELIMITER', require( '@stdlib/constants/string/path-delimiter' ) );
47-
48-
/**
49-
* @name PATH_DELIMITER_POSIX
50-
* @memberof ns
51-
* @readonly
52-
* @type {string}
53-
* @see {@link module:@stdlib/constants/string/path-delimiter-posix}
54-
*/
55-
setReadOnly( ns, 'PATH_DELIMITER_POSIX', require( '@stdlib/constants/string/path-delimiter-posix' ) );
56-
57-
/**
58-
* @name PATH_DELIMITER_WIN32
59-
* @memberof ns
60-
* @readonly
61-
* @type {string}
62-
* @see {@link module:@stdlib/constants/string/path-delimiter-win32}
63-
*/
64-
setReadOnly( ns, 'PATH_DELIMITER_WIN32', require( '@stdlib/constants/string/path-delimiter-win32' ) );
65-
66-
/**
67-
* @name PATH_SEP
68-
* @memberof ns
69-
* @readonly
70-
* @type {string}
71-
* @see {@link module:@stdlib/constants/string/path-sep}
72-
*/
73-
setReadOnly( ns, 'PATH_SEP', require( '@stdlib/constants/string/path-sep' ) );
74-
75-
/**
76-
* @name PATH_SEP_POSIX
77-
* @memberof ns
78-
* @readonly
79-
* @type {string}
80-
* @see {@link module:@stdlib/constants/string/path-sep-posix}
81-
*/
82-
setReadOnly( ns, 'PATH_SEP_POSIX', require( '@stdlib/constants/string/path-sep-posix' ) );
83-
84-
/**
85-
* @name PATH_SEP_WIN32
86-
* @memberof ns
87-
* @readonly
88-
* @type {string}
89-
* @see {@link module:@stdlib/constants/string/path-sep-win32}
90-
*/
91-
setReadOnly( ns, 'PATH_SEP_WIN32', require( '@stdlib/constants/string/path-sep-win32' ) );
92-
9339
/**
9440
* @name UNICODE_MAX
9541
* @memberof ns
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2021 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 Path Constants
22+
23+
> Standard library string path constants.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var constants = require( '@stdlib/constants/string/path' );
31+
```
32+
33+
#### constants
34+
35+
Standard library string path 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/path' );
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 -->

lib/node_modules/@stdlib/constants/string/path-delimiter-posix/README.md renamed to lib/node_modules/@stdlib/constants/string/path/delimiter-posix/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ limitations under the License.
2727
## Usage
2828

2929
```javascript
30-
var PATH_DELIMITER_POSIX = require( '@stdlib/constants/string/path-delimiter-posix' );
30+
var PATH_DELIMITER_POSIX = require( '@stdlib/constants/string/path/delimiter-posix' );
3131
```
3232

3333
#### PATH_DELIMITER_POSIX
@@ -50,7 +50,7 @@ var delimiter = PATH_DELIMITER_POSIX;
5050
<!-- eslint no-undef: "error" -->
5151

5252
```javascript
53-
var PATH_DELIMITER_POSIX = require( '@stdlib/constants/string/path-delimiter-posix' );
53+
var PATH_DELIMITER_POSIX = require( '@stdlib/constants/string/path/delimiter-posix' );
5454

5555
var PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin';
5656
var paths = PATH.split( PATH_DELIMITER_POSIX );

0 commit comments

Comments
 (0)