Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
# Pin action to full length commit SHA
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 20 # 'lts/*'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not desired.

node-version: 16 # Using Node.js 16 to match project's test matrix
timeout-minutes: 5

# Cache dependencies:
Expand Down
75 changes: 75 additions & 0 deletions lib/node_modules/@stdlib/symbol/split/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!-
@license Apache-2.0

Copyright (c) 2025 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Symbol.split

> The well-known symbol `Symbol.split`.
<section class="usage">

## Usage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file does not currently match project conventions.


```javascript
var hasSplitSupport = require( '@stdlib/assert/has-symbol-support' )();
var split = require( '@stdlib/symbol/split' );

var bool = ( typeof split === 'symbol' );
// returns <boolean>
```

</section>

<!-- /.usage -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var hasSplitSupport = require( '@stdlib/assert/has-symbol-support' )();
var split = require( '@stdlib/symbol/split' );

if ( hasSplitSupport ) {
console.log( split === Symbol.split );
// => true
} else {
console.log( '@stdlib/symbol/split' );
}
```

</section>

<!-- /.examples -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

</section>

<!-- /.links -->
37 changes: 37 additions & 0 deletions lib/node_modules/@stdlib/symbol/split/lib/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MAIN //

/**

Check failure on line 23 in lib/node_modules/@stdlib/symbol/split/lib/browser.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

"@default" tag should not follow "@see"

Check failure on line 23 in lib/node_modules/@stdlib/symbol/split/lib/browser.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

"@name" tag should not follow "@constant"
* The well-known symbol `@@split`.
*
* @constant
* @name SPLIT
* @type {symbol}
* @see [MDN]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split}
* @default Symbol.split
*/
var SPLIT = ( typeof Symbol === 'function' && typeof Symbol.split === 'symbol' ) ? Symbol.split : '@@split'; // eslint-disable-line no-undef

Check failure on line 32 in lib/node_modules/@stdlib/symbol/split/lib/browser.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Symbol is used without loading it beforehand via require()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see other packages exposing symbols. This is not how we implement them.



// EXPORTS //

module.exports = SPLIT;
37 changes: 37 additions & 0 deletions lib/node_modules/@stdlib/symbol/split/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MAIN //

/**
* The well-known symbol `@@split`.
*
* @constant
* @name SPLIT
* @type {symbol}
* @see [MDN]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split}
* @default Symbol.split
*/
var SPLIT = ( typeof Symbol === 'function' && typeof Symbol.split === 'symbol' ) ? Symbol.split : '@@split'; // eslint-disable-line no-undef
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.



// EXPORTS //

module.exports = SPLIT;
79 changes: 79 additions & 0 deletions lib/node_modules/@stdlib/symbol/split/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "@stdlib/symbol/split",
"version": "0.0.0",
"description": "The well-known symbol `Symbol.split`. ",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
},
"contributors": [
{
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
}
],
"main": "./lib",
"directories": {
"doc": "./docs",
"example": "./examples",
"lib": "./lib",
"test": "./test"
},
"scripts": {
"test": "make test",
"test-cov": "make test-cov",
"examples": "make examples"
Comment on lines +24 to +26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be here. It is not clear why you added these.

},
"homepage": "https://github.com/stdlib-js/stdlib",
"repository": {
"type": "git",
"url": "git://github.com/stdlib-js/stdlib.git"
},
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {},
"devDependencies": {
"@stdlib/assert/has-symbol-support": "^0.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed.

},
"engines": {
"node": ">=0.10.0",
"npm": ">2.7.0"
},
"os": [
"aix",
"darwin",
"freebsd",
"linux",
"macos",
"openbsd",
"posix",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"posix",

Why was this added? This isn't an OS.

"sunos",
"win32",
"windows"
],
"keywords": [
"stdlib",
"stdtypes",
"types",
"utils",
"util",
"utilities",
"utility",
"es6",
"es2015",
"ecmascript",
"symbol",
"symbols",
"split",
"regexp",
"regex",
"regexp.split",
"string.split"
],
"__stdlib__": {},
"browser": {
"./lib/main.js": "./lib/browser.js"
}
}
61 changes: 61 additions & 0 deletions lib/node_modules/@stdlib/symbol/split/test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var tape = require( 'tape' );
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' )();
var SPLIT = require( './../lib' );


// TESTS //

tape( 'main export is a symbol or string', function test( t ) {
t.ok( typeof SPLIT === 'symbol' || typeof SPLIT === 'string', 'main export is a symbol or string' );
t.end();
});

tape( 'if environment has `Symbol` support, the export is a symbol', function test( t ) {
if ( hasSymbolSupport ) {
t.equal( typeof SPLIT, 'symbol', 'is a symbol' );
}
t.end();
});

tape( 'if environment does not have `Symbol` support, the export is a string', function test( t ) {
if ( !hasSymbolSupport ) {
t.equal( typeof SPLIT, 'string', 'is a string' );
}
t.end();
});

tape( 'the export equals `Symbol.split` if environment has `Symbol` support', function test( t ) {
if ( hasSymbolSupport ) {
t.equal( SPLIT, Symbol.split, 'equals Symbol.split' );
}
t.end();
});

tape( 'the export equals `'@@split'` if environment does not have `Symbol` support', function test( t ) {
if ( !hasSymbolSupport ) {
t.equal( SPLIT, '@@split', 'equals @@split' );
}
t.end();
});
Loading