Skip to content

Commit

Permalink
feat: add base.forEachGraphemeCluster to namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Jul 15, 2023
1 parent 1b8d401 commit 98ef4c5
Show file tree
Hide file tree
Showing 27 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ base.floorb,"@stdlib/math/base/special/floorb"
base.floorf,"@stdlib/math/base/special/floorf"
base.floorn,"@stdlib/math/base/special/floorn"
base.floorsd,"@stdlib/math/base/special/floorsd"
base.forEachGraphemeCluster,"@stdlib/string/base/for-each-grapheme-cluster"
base.fresnel,"@stdlib/math/base/special/fresnel"
base.fresnelc,"@stdlib/math/base/special/fresnelc"
base.fresnels,"@stdlib/math/base/special/fresnels"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ base.floorb,"base.ceilb,base.floor,base.floorn,base.roundb"
base.floorf,"base.ceilf,base.floor"
base.floorn,"base.ceiln,base.floor,base.floorb,base.roundn"
base.floorsd,"base.ceilsd,base.floor,base.roundsd,base.truncsd"
base.forEachGraphemeCluster,"forEachChar"
base.fresnel,"base.fresnelc,base.fresnels"
base.fresnelc,"base.fresnel,base.fresnels"
base.fresnels,"base.fresnel,base.fresnelc"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ base.floorb,"@stdlib/math-base-special-floorb"
base.floorf,"@stdlib/math-base-special-floorf"
base.floorn,"@stdlib/math-base-special-floorn"
base.floorsd,"@stdlib/math-base-special-floorsd"
base.forEachGraphemeCluster,"@stdlib/string-base-for-each-grapheme-cluster"
base.fresnel,"@stdlib/math-base-special-fresnel"
base.fresnelc,"@stdlib/math-base-special-fresnelc"
base.fresnels,"@stdlib/math-base-special-fresnels"
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/namespace/aliases/data/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/namespace/aliases/data/data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ base.floorb
base.floorf
base.floorn
base.floorsd
base.forEachGraphemeCluster
base.fresnel
base.fresnelc
base.fresnels
Expand Down
12 changes: 12 additions & 0 deletions lib/node_modules/@stdlib/namespace/lib/namespace/base/f.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ ns.push({
]
});

ns.push({
'alias': 'base.forEachGraphemeCluster',
'path': '@stdlib/string/base/for-each-grapheme-cluster',
'value': require( '@stdlib/string/base/for-each-grapheme-cluster' ),
'type': 'Function',
'related': [
'@stdlib/string/base/for-each',
'@stdlib/string/base/for-each-code-point',
'@stdlib/string/for-each'
]
});

ns.push({
'alias': 'base.fresnel',
'path': '@stdlib/math/base/special/fresnel',
Expand Down
1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@
"@stdlib/math/base/special/floorf",base.floorf
"@stdlib/math/base/special/floorn",base.floorn
"@stdlib/math/base/special/floorsd",base.floorsd
"@stdlib/string/base/for-each-grapheme-cluster",base.forEachGraphemeCluster
"@stdlib/math/base/special/fresnel",base.fresnel
"@stdlib/math/base/special/fresnelc",base.fresnelc
"@stdlib/math/base/special/fresnels",base.fresnels
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@
"@stdlib/math/base/special/floorf","@stdlib/math/base/special/ceilf,@stdlib/math/base/special/floor"
"@stdlib/math/base/special/floorn","@stdlib/math/base/special/ceiln,@stdlib/math/base/special/floor,@stdlib/math/base/special/floorb,@stdlib/math/base/special/roundn"
"@stdlib/math/base/special/floorsd","@stdlib/math/base/special/ceilsd,@stdlib/math/base/special/floor,@stdlib/math/base/special/roundsd,@stdlib/math/base/special/truncsd"
"@stdlib/string/base/for-each-grapheme-cluster","@stdlib/string/for-each"
"@stdlib/math/base/special/fresnel","@stdlib/math/base/special/fresnelc,@stdlib/math/base/special/fresnels"
"@stdlib/math/base/special/fresnelc","@stdlib/math/base/special/fresnel,@stdlib/math/base/special/fresnels"
"@stdlib/math/base/special/fresnels","@stdlib/math/base/special/fresnel,@stdlib/math/base/special/fresnelc"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@
"@stdlib/math/base/special/floorf","@stdlib/math-base-special-floorf"
"@stdlib/math/base/special/floorn","@stdlib/math-base-special-floorn"
"@stdlib/math/base/special/floorsd","@stdlib/math-base-special-floorsd"
"@stdlib/string/base/for-each-grapheme-cluster","@stdlib/string-base-for-each-grapheme-cluster"
"@stdlib/math/base/special/fresnel","@stdlib/math-base-special-fresnel"
"@stdlib/math/base/special/fresnelc","@stdlib/math-base-special-fresnelc"
"@stdlib/math/base/special/fresnels","@stdlib/math-base-special-fresnels"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@
"@stdlib/math-base-special-floorf","@stdlib/math/base/special/floorf"
"@stdlib/math-base-special-floorn","@stdlib/math/base/special/floorn"
"@stdlib/math-base-special-floorsd","@stdlib/math/base/special/floorsd"
"@stdlib/string-base-for-each-grapheme-cluster","@stdlib/string/base/for-each-grapheme-cluster"
"@stdlib/math-base-special-fresnel","@stdlib/math/base/special/fresnel"
"@stdlib/math-base-special-fresnelc","@stdlib/math/base/special/fresnelc"
"@stdlib/math-base-special-fresnels","@stdlib/math/base/special/fresnels"
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/repl/code-blocks/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,7 @@ Float64Array.prototype.values,"var arr = new Float64Array( [ 1.0, -1.0 ] );\nit
forEach,"function logger( v, i ) { console.log( '%s: %d', i, v ); };\nvar arr = [ 1, 2, 3, 4 ];\nforEach( arr, logger )\n"
forEachAsync,"function onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar arr = [ 3000, 2500, 1000 ];\nforEachAsync( arr, onDuration, done )\nfunction onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar opts = { 'limit': 2 };\nvar arr = [ 3000, 2500, 1000 ];\nforEachAsync( arr, opts, onDuration, done )\nfunction onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar opts = { 'series': true };\nvar arr = [ 3000, 2500, 1000 ];\nforEachAsync( arr, opts, onDuration, done )\n"
forEachAsync.factory,"function onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nvar opts = { 'series': true };\nvar f = forEachAsync.factory( opts, onDuration );\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar arr = [ 3000, 2500, 1000 ];\nf( arr, done )\narr = [ 2000, 1500, 1000 ];\nf( arr, done )\n"
forEachChar,"var n = 0;\nfunction fcn() { n += 1; };\nforEachChar( 'hello world!', fcn );\nn\n"
forEachRight,"function logger( v, i ) { console.log( '%s: %d', i, v ); };\nvar arr = [ 1, 2, 3, 4 ];\nforEachRight( arr, logger )\n"
forEachRightAsync,"function onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar arr = [ 1000, 2500, 3000 ];\nforEachRightAsync( arr, onDuration, done )\nfunction onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar opts = { 'limit': 2 };\nvar arr = [ 1000, 2500, 3000 ];\nforEachRightAsync( arr, opts, onDuration, done )\nfunction onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar opts = { 'series': true };\nvar arr = [ 1000, 2500, 3000 ];\nforEachRightAsync( arr, opts, onDuration, done )\n"
forEachRightAsync.factory,"function onDuration( value, next ) {\n setTimeout( onTimeout, value );\n function onTimeout() {\n console.log( value );\n next();\n }\n };\nvar opts = { 'series': true };\nvar f = forEachRightAsync.factory( opts, onDuration );\nfunction done( error ) {\n if ( error ) {\n throw error;\n }\n console.log( 'Done.' );\n };\nvar arr = [ 1000, 2500, 3000 ];\nf( arr, done )\narr = [ 1000, 1500, 2000 ];\nf( arr, done )\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/code-blocks/data/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/repl/help/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ base.floorb,"\nbase.floorb( x, n, b )\n Rounds a numeric value to the nearest
base.floorf,"\nbase.floorf( x )\n Rounds a single-precision floating-point number toward negative infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floorf( 3.14 )\n 3.0\n > y = base.floorf( -4.2 )\n -5.0\n > y = base.floorf( -4.6 )\n -5.0\n > y = base.floorf( 9.5 )\n 9.0\n > y = base.floorf( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceilf, base.floor\n"
base.floorn,"\nbase.floorn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward negative\n infinity.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.floorn( 3.14159, -4 )\n 3.1415\n\n // If `n = 0`, standard round toward negative infinity behavior:\n > y = base.floorn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.floorn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floor, base.floorb, base.roundn\n"
base.floorsd,"\nbase.floorsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward negative infinity with\n `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floorsd( 3.14159, 5 )\n 3.1415\n > y = base.floorsd( 3.14159, 1 )\n 3.0\n > y = base.floorsd( 12368.0, 2 )\n 12000.0\n > y = base.floorsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floor, base.roundsd, base.truncsd\n"
base.forEachGraphemeCluster,"\nbase.forEachGraphemeCluster( str, clbk[, thisArg] )\n Invokes a function for each grapheme cluster (i.e., user-perceived\n character) in a string.\n\n When invoked, the provided function is provided three arguments:\n\n - value: grapheme cluster\n - index: starting grapheme cluster index\n - str: input string\n\n Parameters\n ----------\n str: string\n Input string over which to iterate.\n\n clbk: Function\n The function to invoke for each grapheme cluster in the input string.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: string\n Input string.\n\n Examples\n --------\n > var n = 0;\n > function fcn() { n += 1; };\n > base.forEachGraphemeCluster( 'hello world!', fcn );\n > n\n 12\n\n See Also\n --------\n forEachChar\n"
base.fresnel,"\nbase.fresnel( x )\n Computes the Fresnel integrals S(x) and C(x).\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: Array<number>\n S(x) and C(x).\n\n Examples\n --------\n > var y = base.fresnel( 0.0 )\n [ ~0.0, ~0.0 ]\n > y = base.fresnel( 1.0 )\n [ ~0.438, ~0.780 ]\n > y = base.fresnel( PINF )\n [ ~0.5, ~0.5 ]\n > y = base.fresnel( NINF )\n [ ~-0.5, ~-0.5 ]\n > y = base.fresnel( NaN )\n [ NaN, NaN ]\n\n\nbase.fresnel.assign( x, out, stride, offset )\n Computes the Fresnel integrals S(x) and C(x) and assigns results to a\n provided output array.\n\n Parameters\n ----------\n x: number\n Input value.\n\n out: Array<number>\n Destination array.\n\n stride: integer\n Output array stride.\n\n offset: integer\n Output array index offset.\n\n Returns\n -------\n out: Array<number>\n S(x) and C(x).\n\n Examples\n --------\n > var out = new Float64Array( 2 );\n > var v = base.fresnel.assign( 0.0, out, 1, 0 )\n <Float64Array>[ ~0.0, ~0.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.fresnelc, base.fresnels"
base.fresnel.assign,"\nbase.fresnel.assign( x, out, stride, offset )\n Computes the Fresnel integrals S(x) and C(x) and assigns results to a\n provided output array.\n\n Parameters\n ----------\n x: number\n Input value.\n\n out: Array<number>\n Destination array.\n\n stride: integer\n Output array stride.\n\n offset: integer\n Output array index offset.\n\n Returns\n -------\n out: Array<number>\n S(x) and C(x).\n\n Examples\n --------\n > var out = new Float64Array( 2 );\n > var v = base.fresnel.assign( 0.0, out, 1, 0 )\n <Float64Array>[ ~0.0, ~0.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.fresnelc, base.fresnels"
base.fresnelc,"\nbase.fresnelc( x )\n Computes the Fresnel integral C(x).\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n C(x).\n\n Examples\n --------\n > var y = base.fresnelc( 0.0 )\n ~0.0\n > y = base.fresnelc( 1.0 )\n ~0.780\n > y = base.fresnelc( PINF )\n ~0.5\n > y = base.fresnelc( NINF )\n ~-0.5\n > y = base.fresnelc( NaN )\n NaN\n\n See Also\n --------\n base.fresnel, base.fresnels\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/help/data/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/repl/info/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,7 @@ Float64Array.prototype.values,"\nFloat64Array.prototype.values()\n Returns an
forEach,"\nforEach( collection:Array|TypedArray|Object, fcn:Function[, thisArg:any] )\n Invokes a function for each element in a collection.\n"
forEachAsync,"\nforEachAsync( collection:Array|TypedArray|Object, [options:Object,] \n fcn:Function, done:Function )\n Invokes a function once for each element in a collection.\n"
forEachAsync.factory,"\nforEachAsync.factory( [options:Object,] fcn:Function )\n Returns a function which invokes a function once for each element in a\n collection.\n"
forEachChar,"\nforEachChar( str:string, clbk:Function[, thisArg:any] )\n Invokes a function for each character in a string.\n"
forEachRight,"\nforEachRight( collection:Array|TypedArray|Object, fcn:Function[, thisArg:any] )\n Invokes a function for each element in a collection, iterating from right to\n left.\n"
forEachRightAsync,"\nforEachRightAsync( collection:Array|TypedArray|Object, [options:Object,] \n fcn:Function, done:Function )\n Invokes a function once for each element in a collection, iterating from\n right to left.\n"
forEachRightAsync.factory,"\nforEachRightAsync.factory( [options:Object,] fcn:Function )\n Returns a function which invokes a function once for each element in a\n collection, iterating from right to left.\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/info/data/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/repl/signature/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,7 @@ Float64Array.prototype.values,"Float64Array.prototype.values()"
forEach,"forEach( collection, fcn[, thisArg] )"
forEachAsync,"forEachAsync( collection, [options,] fcn, done )"
forEachAsync.factory,"forEachAsync.factory( [options,] fcn )"
forEachChar,"forEachChar( str, clbk[, thisArg] )"
forEachRight,"forEachRight( collection, fcn[, thisArg] )"
forEachRightAsync,"forEachRightAsync( collection, [options,] fcn, done )"
forEachRightAsync.factory,"forEachRightAsync.factory( [options,] fcn )"
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/signature/data/data.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,7 @@ Float64Array.prototype.values,"Float64Array.prototype.values()"
forEach,"forEach( collection:Array|TypedArray|Object, fcn:Function[, thisArg:any] )"
forEachAsync,"forEachAsync( collection:Array|TypedArray|Object, [options:Object,] fcn:Function, done:Function )"
forEachAsync.factory,"forEachAsync.factory( [options:Object,] fcn:Function )"
forEachChar,"forEachChar( str:string, clbk:Function[, thisArg:any] )"
forEachRight,"forEachRight( collection:Array|TypedArray|Object, fcn:Function[, thisArg:any] )"
forEachRightAsync,"forEachRightAsync( collection:Array|TypedArray|Object, [options:Object,] fcn:Function, done:Function )"
forEachRightAsync.factory,"forEachRightAsync.factory( [options:Object,] fcn:Function )"
Expand Down

Large diffs are not rendered by default.

0 comments on commit 98ef4c5

Please sign in to comment.