diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/README.md b/lib/node_modules/@stdlib/string/base/slice-code-points/README.md new file mode 100644 index 000000000000..bd375ca53143 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/README.md @@ -0,0 +1,90 @@ + + +# sliceCodePoints + +> Slice a string based on Unicode code point indices. + +
+ +## Usage + +```javascript +var sliceCodePoints = require( '@stdlib/string/base/slice-code-points' ); +``` + +#### sliceCodePoints( str, start, end ) + +Slices a string based on Unicode code point indices. + +```javascript +var out = sliceCodePoints( 'Hello ๐Ÿ‘‹ World', 0, 7 ); +// returns 'Hello ๐Ÿ‘‹' + +out = sliceCodePoints( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 1, 2 ); +// returns '๐Ÿ‘‹' +``` + +The function accepts the following arguments: + +- **str**: input string. +- **start**: the `ith` Unicode code point to start a slice (inclusive). +- **end**: the `jth` Unicode code point to end a slice (exclusive). + +
+ + + +
+ +## Examples + +```javascript +var sliceCodePoints = require( '@stdlib/string/base/slice-code-points' ); + +console.log( sliceCodePoints( 'Hello ๐Ÿ‘‹ World', 0, 7 ) ); +// => 'Hello ๐Ÿ‘‹' + +console.log( sliceCodePoints( 'last man standing', 1, 17 ) ); +// => 'ast man standing' + +console.log( sliceCodePoints( 'ๅ…ญไนฆ/ๅ…ญๆ›ธ', 1, 14 ) ); +// => 'ไนฆ/ๅ…ญๆ›ธ' +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/benchmark/benchmark.js b/lib/node_modules/@stdlib/string/base/slice-code-points/benchmark/benchmark.js new file mode 100644 index 000000000000..525025ed48f1 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/benchmark/benchmark.js @@ -0,0 +1,57 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var pkg = require( './../package.json' ).name; +var sliceCodePoints = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var values; + var out; + var i; + + values = [ + 'Iรฑtรซrnรขtiรดnร lizรฆtiรธn', + 'presidential election', + '๐Ÿถ๐Ÿฎ๐Ÿท๐Ÿฐ๐Ÿธ', + 'Hello ๐Ÿ‘‹ World', + 'เค…เคจเฅเคšเฅเค›เฅ‡เคฆ' + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = sliceCodePoints( values[ i%values.length ], 1, 3 ); + if ( typeof out !== 'string' ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/docs/repl.txt b/lib/node_modules/@stdlib/string/base/slice-code-points/docs/repl.txt new file mode 100644 index 000000000000..6647a36a9044 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/docs/repl.txt @@ -0,0 +1,29 @@ + +{{alias}}( str, start, end ) + Slices a string based on Unicode code point indices. + + Parameters + ---------- + str: string + Input string. + start: integer + The `ith` Unicode code point to start a slice (inclusive). + end: integer + The `jth` Unicode code point to end a slice (exclusive). + + Returns + ------- + out: string + Output string. + + Examples + -------- + > var out = {{alias}}( 'Hello ๐Ÿ‘‹ World', 1, 3 ) + 'el' + > out = {{alias}}( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 1, 2 ) + '๐Ÿ‘‹' + > out = {{alias}}( 'ๅ…ญไนฆ/ๅ…ญๆ›ธ', 1, 14 ) + 'ไนฆ/ๅ…ญๆ›ธ' + + See Also + -------- diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/slice-code-points/docs/types/index.d.ts new file mode 100644 index 000000000000..6779de9d8722 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/docs/types/index.d.ts @@ -0,0 +1,42 @@ +/* +* @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. +*/ + +// TypeScript Version: 4.1 + +/** +* Slices a string based on Unicode code point indices. +* +* @param str - input string +* @param start - the `ith` Unicode code point to start a slice (inclusive) +* @param end - the `jth` Unicode code point to end a slice (exclusive) +* @returns output string +* +* @example +* var out = sliceCodePoints( 'Hello ๐Ÿ‘‹ World', 1, 3 ); +* // returns 'el' +* +* @example +* var out = sliceCodePoints( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 1, 2 ); +* // returns '๐Ÿ‘‹' +*/ +declare function sliceCodePoints( str: string, start: number, end: number ): string; + + +// EXPORTS // + +export = sliceCodePoints; diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/docs/types/test.ts b/lib/node_modules/@stdlib/string/base/slice-code-points/docs/types/test.ts new file mode 100644 index 000000000000..5e7baf157e5e --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/docs/types/test.ts @@ -0,0 +1,68 @@ +/* +* @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. +*/ + +import sliceCodePoints = require( './index' ); + + +// TESTS // + +// The function returns a string... +{ + sliceCodePoints( 'abc', 1, 2 ); // $ExpectType string +} + +// The compiler throws an error if the function is provided a value other than a string... +{ + sliceCodePoints( true, 1, 2 ); // $ExpectError + sliceCodePoints( false, 1, 2 ); // $ExpectError + sliceCodePoints( null, 1, 2 ); // $ExpectError + sliceCodePoints( undefined, 1, 2 ); // $ExpectError + sliceCodePoints( 5, 1, 2 ); // $ExpectError + sliceCodePoints( [], 1, 2 ); // $ExpectError + sliceCodePoints( {}, 1, 2 ); // $ExpectError + sliceCodePoints( ( x: number ): number => x, 1, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument that is not a number... +{ + sliceCodePoints( 'abc', true, 2 ); // $ExpectError + sliceCodePoints( 'abc', false, 2 ); // $ExpectError + sliceCodePoints( 'abc', null, 2 ); // $ExpectError + sliceCodePoints( 'abc', 'abc', 2 ); // $ExpectError + sliceCodePoints( 'abc', [], 2 ); // $ExpectError + sliceCodePoints( 'abc', {}, 2 ); // $ExpectError + sliceCodePoints( 'abc', ( x: number ): number => x, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument that is not a number... +{ + sliceCodePoints( 'abc', 1, true ); // $ExpectError + sliceCodePoints( 'abc', 1, false ); // $ExpectError + sliceCodePoints( 'abc', 1, null ); // $ExpectError + sliceCodePoints( 'abc', 1, 'abc' ); // $ExpectError + sliceCodePoints( 'abc', 1, [] ); // $ExpectError + sliceCodePoints( 'abc', 1, {} ); // $ExpectError + sliceCodePoints( 'abc', 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + sliceCodePoints(); // $ExpectError + sliceCodePoints( 'abc' ); // $ExpectError + sliceCodePoints( 'abc', 1, 2, {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/examples/index.js b/lib/node_modules/@stdlib/string/base/slice-code-points/examples/index.js new file mode 100644 index 000000000000..25556534a021 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/examples/index.js @@ -0,0 +1,30 @@ +/** +* @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'; + +var sliceCodePoints = require( './../lib' ); + +console.log( sliceCodePoints( 'Hello ๐Ÿ‘‹ World', 0, 7 ) ); +// => 'Hello ๐Ÿ‘‹' + +console.log( sliceCodePoints( 'last man standing', 1, 17 ) ); +// => 'ast man standing' + +console.log( sliceCodePoints( 'ๅ…ญไนฆ/ๅ…ญๆ›ธ', 1, 14 ) ); +// => 'ไนฆ/ๅ…ญๆ›ธ' diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/lib/index.js b/lib/node_modules/@stdlib/string/base/slice-code-points/lib/index.js new file mode 100644 index 000000000000..2020cfff8b75 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/lib/index.js @@ -0,0 +1,43 @@ +/** +* @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'; + +/** +* Slice a string based on Unicode code point indices. +* +* @module @stdlib/string/base/slice-code-points +* +* @example +* var sliceCodePoints = require( '@stdlib/string/base/slice-code-points' ); +* +* var out = sliceCodePoints( 'Hello ๐Ÿ‘‹ World', 1, 3 ); +* // returns 'el' +* +* out = sliceCodePoints( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 1, 2 ); +* // returns '๐Ÿ‘‹' +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/lib/main.js b/lib/node_modules/@stdlib/string/base/slice-code-points/lib/main.js new file mode 100644 index 000000000000..e1d4c6496949 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/lib/main.js @@ -0,0 +1,107 @@ +/** +* @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 numCodePoints = require( '@stdlib/string/num-code-points' ); +var max = require( '@stdlib/math/base/special/fast/max' ); + + +// VARIABLES // + +var RE_UTF16_LOW_SURROGATE = /[\uDC00-\uDFFF]/; // TODO: replace with stdlib pkg +var RE_UTF16_HIGH_SURROGATE = /[\uD800-\uDBFF]/; // TODO: replace with stdlib pkg + + +// MAIN // + +/** +* Slices a string based on Unicode code points. +* +* @param {string} str - input string +* @param {integer} start - the `ith` Unicode code point to start a slice (inclusive) +* @param {integer} end - the `jth` Unicode code point to end a slice (exclusive) +* @returns {string} output string +* +* @example +* var out = sliceCodePoints( 'Hello ๐Ÿ‘‹ World', 1, 3 ); +* // returns 'el' +* +* out = sliceCodePoints( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 1, 2 ); +* // returns '๐Ÿ‘‹' +*/ +function sliceCodePoints( str, start, end ) { + var totalCodePoints; + var codePoints; + var len; + var ch1; + var ch2; + var idx; + var ch; + var i; + + len = str.length; + if ( len === 0 ) { + return ''; + } + totalCodePoints = numCodePoints( str ); + if ( start < 0 ) { + start = max( totalCodePoints + start, 0 ); + } + if ( end < 0 ) { + end = max( totalCodePoints + end, 0 ); + } else if ( end > totalCodePoints ) { + end = totalCodePoints; + } + if ( start >= totalCodePoints || end <= start ) { + return ''; + } + codePoints = ''; + idx = 0; + + // Process the string one Unicode code unit at a time and handle UTF-16 surrogate pairs as a single Unicode code point... + for ( i = 0; i < len && idx < end; i++ ) { + ch1 = str[ i ]; + ch = ch1; + + // Check for a UTF-16 surrogate pair... + if ( i < len-1 && RE_UTF16_HIGH_SURROGATE.test( ch1 ) ) { + // Check whether the high surrogate is paired with a low surrogate... + ch2 = str[ i+1 ]; + if ( RE_UTF16_LOW_SURROGATE.test( ch2 ) ) { + // We found a surrogate pair: + ch += ch2; + i += 1; // bump the index to process the next code unit + } + } + // Note: `ch` may be a lone surrogate (e.g., a low surrogate without a preceding high surrogate or a high surrogate at the end of the input string). + + if ( idx >= start && idx < end ) { + codePoints += ch; + } + idx += 1; + } + return codePoints; +} + + +// EXPORTS // + +module.exports = sliceCodePoints; diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/package.json b/lib/node_modules/@stdlib/string/base/slice-code-points/package.json new file mode 100644 index 000000000000..ffd42a4e8738 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/package.json @@ -0,0 +1,65 @@ +{ + "name": "@stdlib/string/base/slice-code-points", + "version": "0.0.0", + "description": "Slice a string based on Unicode code points.", + "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/main.js", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "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": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "string", + "str", + "base", + "slice", + "substring", + "unicode", + "code", + "point", + "codepoint", + "utilities", + "utils" + ] +} diff --git a/lib/node_modules/@stdlib/string/base/slice-code-points/test/test.js b/lib/node_modules/@stdlib/string/base/slice-code-points/test/test.js new file mode 100644 index 000000000000..1ba51bf50729 --- /dev/null +++ b/lib/node_modules/@stdlib/string/base/slice-code-points/test/test.js @@ -0,0 +1,152 @@ +/** +* @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 sliceCodePoints = require( './../lib/main.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof sliceCodePoints, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( sliceCodePoints.length, 3, 'the function has an arity of 3' ); + t.end(); +}); + +tape( 'the function returns an empty string if provided an empty string', function test( t ) { + t.strictEqual( sliceCodePoints( '', 1, 2 ), '', 'returns expected value' ); + t.strictEqual( sliceCodePoints( '', 2, 3 ), '', 'returns expected value' ); + t.strictEqual( sliceCodePoints( '', 3, 4 ), '', 'returns expected value' ); + t.end(); +}); + +tape( 'the function slices a string based on code point indices', function test( t ) { + var str; + var out; + + str = 'Hello World'; + out = sliceCodePoints( str, 1, 5 ); + t.strictEqual( out, 'ello', 'returns expected value' ); + + str = 'Hello ๐Ÿ‘‹ World'; + out = sliceCodePoints( str, 5, 7 ); + t.strictEqual( out, ' ๐Ÿ‘‹', 'returns expected value' ); + + str = 'เค…เคจเฅเคšเฅเค›เฅ‡เคฆ'; + out = sliceCodePoints( str, 1, str.length ); + t.strictEqual( out, 'เคจเฅเคšเฅเค›เฅ‡เคฆ', 'returns expected value' ); + + str = 'ๅ…ญไนฆ/ๅ…ญๆ›ธ'; + out = sliceCodePoints( str, 1, str.length ); + t.strictEqual( out, 'ไนฆ/ๅ…ญๆ›ธ', 'returns expected value' ); + + str = '๐’ป๐“Ÿ'; + out = sliceCodePoints( str, 1, str.length ); + t.strictEqual( out, '๐“Ÿ', 'returns expected value' ); + + str = '\uD800'; + out = sliceCodePoints( str, 1, 2 ); + t.strictEqual( out, '', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports providing negative indices', function test( t ) { + var str; + var out; + + str = 'Hello World'; + out = sliceCodePoints( str, -5, -1 ); + t.strictEqual( out, 'Worl', 'returns expected value' ); + + str = 'Hello ๐Ÿ‘‹ World'; + out = sliceCodePoints( str, 0, -6 ); + t.strictEqual( out, 'Hello ๐Ÿ‘‹', 'returns expected value' ); + + str = 'เค…เคจเฅเคšเฅเค›เฅ‡เคฆ'; + out = sliceCodePoints( str, -7, str.length ); + t.strictEqual( out, 'เคจเฅเคšเฅเค›เฅ‡เคฆ', 'returns expected value' ); + + str = 'ๅ…ญไนฆ/ๅ…ญๆ›ธ'; + out = sliceCodePoints( str, -4, str.length ); + t.strictEqual( out, 'ไนฆ/ๅ…ญๆ›ธ', 'returns expected value' ); + + str = '๐’ป๐“Ÿ'; + out = sliceCodePoints( str, -1, str.length ); + t.strictEqual( out, '๐“Ÿ', 'returns expected value' ); + + str = '\uD800'; + out = sliceCodePoints( str, -1, str.length ); + t.strictEqual( out, '\uD800', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function handles surrogate pairs correctly', function test( t ) { + var out; + + out = sliceCodePoints( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 0, 1 ); + t.strictEqual( out, '๐Ÿ‘‹', 'returns expected value' ); + + out = sliceCodePoints( '๐Ÿ‘‹๐Ÿ‘‹๐Ÿ‘‹', 1, 2 ); + t.strictEqual( out, '๐Ÿ‘‹', 'returns expected value' ); + + out = sliceCodePoints( '๐Ÿ‘‹a๐Ÿ‘‹b๐Ÿ‘‹', 1, 4 ); + t.strictEqual( out, 'a๐Ÿ‘‹b', 'returns expected value' ); + + out = sliceCodePoints( '๐Ÿ‘‹a๐Ÿ‘‹b๐Ÿ‘‹', 1, 4 ); + t.strictEqual( out, 'a๐Ÿ‘‹b', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function handles lone surrogates', function test( t ) { + var out; + + out = sliceCodePoints( '\uD800abc', 0, 2 ); + t.strictEqual( out, '\uD800a', 'returns expected value for lone high surrogate' ); + + out = sliceCodePoints( '\uDC00abc', 0, 2 ); + t.strictEqual( out, '\uDC00a', 'returns expected value for lone low surrogate' ); + + t.end(); +}); + +tape( 'the function truncates the end index to the string length', function test( t ) { + var out; + + out = sliceCodePoints( 'hello', 0, 10 ); + t.strictEqual( out, 'hello', 'returns expected value' ); + + out = sliceCodePoints( 'ๅ…ญไนฆ/ๅ…ญๆ›ธ', 1, 10 ); + t.strictEqual( out, 'ไนฆ/ๅ…ญๆ›ธ', 'returns expected value' ); + + out = sliceCodePoints( '๐Ÿ๏ธ๐ŸŒท', 0, 5 ); + t.strictEqual( out, '๐Ÿ๏ธ๐ŸŒท', 'returns expected value' ); + + t.end(); +});