From 2ae2d02bebba93ff9281a85e2a8cabff7e8e5317 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sat, 30 May 2026 23:44:02 -0500 Subject: [PATCH 1/3] fix: make format identifier properties optional in `string/base/format-tokenize` The `flags`, `width`, `precision`, and `mapping` properties were declared as required, but the implementation emits tokens in which these fields may be `undefined`. Align the declaration with `string/base/format-interpolate`, which declares the same interface with optional properties. --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../string/base/format-tokenize/docs/types/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/string/base/format-tokenize/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/format-tokenize/docs/types/index.d.ts index 09f55acaa928..12921a49643e 100644 --- a/lib/node_modules/@stdlib/string/base/format-tokenize/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/format-tokenize/docs/types/index.d.ts @@ -30,22 +30,22 @@ interface FormatIdentifier { /** * Flags. */ - flags: string; + flags?: string; /** * Minimum field width (integer or `'*'`). */ - width: string; + width?: string; /** * Precision (integer or `'*'`). */ - precision: string; + precision?: string; /** * Positional mapping from format specifier to argument index. */ - mapping: number; + mapping?: number; } type StringOrToken = string | FormatIdentifier; From bb9974a6c28abd8f96ede544dcdada8e7761a1bf Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sat, 30 May 2026 23:45:37 -0500 Subject: [PATCH 2/3] docs: fix errors and inconsistencies in `@stdlib/string` declaration files - correct `// returns` annotations for `replace-before` and `slice` examples, including the namespace aggregator copies - fix stale copy-pasted `remove-first` example for the no-count overload - prefix bare `emojiProperty` example calls with `grapheme.` - bump stale `// TypeScript Version: 2.0` directives to `4.1` - align `first`/`last` `@returns` and `from-code-point`/`substring-*-last` `@param` descriptions with the rest of the namespace - add "characters" to `right-trim`/`base/right-trim` summaries - drop the unused `@stdlib/types` reference directive from `right-trim-n` - supply the missing `$ExpectType` argument in the `right-trim-n` type test --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/string/base/docs/types/index.d.ts | 4 ++-- .../base/remove-last-code-point/docs/types/index.d.ts | 2 +- .../base/remove-last-grapheme-cluster/docs/types/index.d.ts | 2 +- .../@stdlib/string/base/remove-last/docs/types/index.d.ts | 2 +- .../string/base/replace-before/docs/types/index.d.ts | 2 +- .../string/base/reverse-code-points/docs/types/index.d.ts | 2 +- .../base/reverse-grapheme-clusters/docs/types/index.d.ts | 2 +- .../@stdlib/string/base/reverse/docs/types/index.d.ts | 2 +- .../@stdlib/string/base/right-trim/docs/types/index.d.ts | 2 +- .../@stdlib/string/base/slice/docs/types/index.d.ts | 2 +- lib/node_modules/@stdlib/string/first/docs/types/index.d.ts | 6 +++--- .../@stdlib/string/from-code-point/docs/types/index.d.ts | 2 +- lib/node_modules/@stdlib/string/last/docs/types/index.d.ts | 6 +++--- .../@stdlib/string/num-code-points/docs/types/index.d.ts | 2 +- .../@stdlib/string/remove-first/docs/types/index.d.ts | 4 ++-- .../@stdlib/string/right-trim-n/docs/types/index.d.ts | 2 -- .../@stdlib/string/right-trim-n/docs/types/test.ts | 2 +- .../@stdlib/string/right-trim/docs/types/index.d.ts | 2 +- .../string/substring-after-last/docs/types/index.d.ts | 2 +- .../string/substring-before-last/docs/types/index.d.ts | 2 +- .../tools/grapheme-cluster-break/docs/types/index.d.ts | 4 ++-- 21 files changed, 27 insertions(+), 29 deletions(-) diff --git a/lib/node_modules/@stdlib/string/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/docs/types/index.d.ts index 9408d10b17a5..2719425b00fe 100644 --- a/lib/node_modules/@stdlib/string/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/docs/types/index.d.ts @@ -1086,7 +1086,7 @@ interface Namespace { * * @example * var out = ns.replaceBefore( 'Hello World!', '', 'foo', 0 ); - * // returns 'Hello world!' + * // returns 'Hello World!' * * @example * var out = ns.replaceBefore( 'Hello World!', 'xyz', 'foo', 0 ); @@ -1301,7 +1301,7 @@ interface Namespace { * * @example * var out = ns.slice( 'foo bar', 2, 7 ); - * // returns 'ar' + * // returns 'o bar' * * @example * var out = ns.slice( 'foo bar', -1, 7 ); diff --git a/lib/node_modules/@stdlib/string/base/remove-last-code-point/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/remove-last-code-point/docs/types/index.d.ts index 8a1c90be35e9..ea3fe0029455 100644 --- a/lib/node_modules/@stdlib/string/base/remove-last-code-point/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/remove-last-code-point/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Removes the last `n` Unicode code points of a string. diff --git a/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/docs/types/index.d.ts index bcefff046a0b..d6b01be29f8c 100644 --- a/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Removes the last `n` grapheme clusters (i.e., user-perceived characters) of a string. diff --git a/lib/node_modules/@stdlib/string/base/remove-last/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/remove-last/docs/types/index.d.ts index 025f444e63a2..4356e4e0c1a7 100644 --- a/lib/node_modules/@stdlib/string/base/remove-last/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/remove-last/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Removes the last `n` UTF-16 code units of a string. diff --git a/lib/node_modules/@stdlib/string/base/replace-before/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/replace-before/docs/types/index.d.ts index cd7cc8aeb710..6e1ce62af569 100644 --- a/lib/node_modules/@stdlib/string/base/replace-before/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/replace-before/docs/types/index.d.ts @@ -42,7 +42,7 @@ * * @example * var out = replaceBefore( 'Hello World!', '', 'foo', 0 ); -* // returns 'Hello world!' +* // returns 'Hello World!' * * @example * var out = replaceBefore( 'Hello World!', 'xyz', 'foo', 0 ); diff --git a/lib/node_modules/@stdlib/string/base/reverse-code-points/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/reverse-code-points/docs/types/index.d.ts index 48765eeb8827..894497512290 100644 --- a/lib/node_modules/@stdlib/string/base/reverse-code-points/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/reverse-code-points/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Reverses the Unicode code points of a string. diff --git a/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/docs/types/index.d.ts index 1f40280204a6..f322974648f3 100644 --- a/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Reverses the grapheme clusters (i.e., user-perceived characters) of a string. diff --git a/lib/node_modules/@stdlib/string/base/reverse/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/reverse/docs/types/index.d.ts index 43d3f4e76127..9300e8be96d1 100644 --- a/lib/node_modules/@stdlib/string/base/reverse/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/reverse/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Reverses the UTF-16 code units of a string. diff --git a/lib/node_modules/@stdlib/string/base/right-trim/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/right-trim/docs/types/index.d.ts index c3c2e00046e6..61a6af8d10ba 100644 --- a/lib/node_modules/@stdlib/string/base/right-trim/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/right-trim/docs/types/index.d.ts @@ -19,7 +19,7 @@ // TypeScript Version: 4.1 /** -* Trims whitespace from the end of a string. +* Trims whitespace characters from the end of a string. * * @param str - input string * @returns trimmed string diff --git a/lib/node_modules/@stdlib/string/base/slice/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/base/slice/docs/types/index.d.ts index 373d1aa1f1ac..32a0947294b7 100644 --- a/lib/node_modules/@stdlib/string/base/slice/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/base/slice/docs/types/index.d.ts @@ -44,7 +44,7 @@ * * @example * var out = slice( 'foo bar', 2, 7 ); -* // returns 'ar' +* // returns 'o bar' * * @example * var out = slice( 'foo bar', -1, 7 ); diff --git a/lib/node_modules/@stdlib/string/first/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/first/docs/types/index.d.ts index 6484c3a6e6fd..8852086bf30b 100644 --- a/lib/node_modules/@stdlib/string/first/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/first/docs/types/index.d.ts @@ -44,7 +44,7 @@ interface Options { * @param str - input string * @param n - number of characters to return * @param options - options -* @returns updated string +* @returns output string * * @example * var out = first( 'last man standing', 2 ); @@ -63,7 +63,7 @@ declare function first( str: string, n: number, options?: Options ): string; * * @param str - input string * @param options - options -* @returns updated string +* @returns output string * * @example * var out = first( 'last man standing', { @@ -84,7 +84,7 @@ declare function first( str: string, options?: Options ): string; * * @param str - input string * @param n - number of characters to return (default: 1) -* @returns updated string +* @returns output string * * @example * var out = first( 'last man standing' ); diff --git a/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts index 5d8d501fe9b9..d1016ec05bad 100644 --- a/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts @@ -43,7 +43,7 @@ declare function fromCodePoint( pts: ArrayLike ): string; * * - In addition to multiple arguments, the function also supports providing an array-like object as a single argument containing a sequence of Unicode code points. * -* @param pt - sequence of code points +* @param pt - Unicode code point * @throws must provide either an array-like object of code points or one or more code points as separate arguments * @throws a code point must be a nonnegative integer * @throws must provide a valid Unicode code point diff --git a/lib/node_modules/@stdlib/string/last/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/last/docs/types/index.d.ts index 72f5baf66368..ebabaea16e3f 100644 --- a/lib/node_modules/@stdlib/string/last/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/last/docs/types/index.d.ts @@ -44,7 +44,7 @@ interface Options { * @param str - input string * @param n - number of characters to return * @param options - options -* @returns updated string +* @returns output string * * @example * var out = last( 'last man standing', 2 ); @@ -63,7 +63,7 @@ declare function last( str: string, n: number, options?: Options ): string; * * @param str - input string * @param options - options -* @returns updated string +* @returns output string * * @example * var out = last( 'last man standing', { @@ -84,7 +84,7 @@ declare function last( str: string, options?: Options ): string; * * @param str - input string * @param n - number of characters to return (default: 1) -* @returns updated string +* @returns output string * * @example * var out = last( 'last man standing' ); diff --git a/lib/node_modules/@stdlib/string/num-code-points/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/num-code-points/docs/types/index.d.ts index 1822b69c50f0..89dcfe778317 100644 --- a/lib/node_modules/@stdlib/string/num-code-points/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/num-code-points/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Returns the number of code points in a string. diff --git a/lib/node_modules/@stdlib/string/remove-first/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/remove-first/docs/types/index.d.ts index 141c78080cd8..4494dd0d7463 100644 --- a/lib/node_modules/@stdlib/string/remove-first/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/remove-first/docs/types/index.d.ts @@ -74,10 +74,10 @@ declare function removeFirst( str: string, n: number, options?: Options ): strin * // returns 'ast man standing' * * @example -* var out = removeFirst( '🐶🐮🐷🐰🐸', 2, { +* var out = removeFirst( '🐶🐮🐷🐰🐸', { * 'mode': 'grapheme' * }); -* // returns '🐷🐰🐸' +* // returns '🐮🐷🐰🐸' */ declare function removeFirst( str: string, options?: Options ): string; diff --git a/lib/node_modules/@stdlib/string/right-trim-n/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/right-trim-n/docs/types/index.d.ts index 61d76a4b939f..6d1eed167fa6 100644 --- a/lib/node_modules/@stdlib/string/right-trim-n/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/right-trim-n/docs/types/index.d.ts @@ -18,8 +18,6 @@ // TypeScript Version: 4.1 -/// - /** * Trims `n` characters from the end of a string. * diff --git a/lib/node_modules/@stdlib/string/right-trim-n/docs/types/test.ts b/lib/node_modules/@stdlib/string/right-trim-n/docs/types/test.ts index 55250ad02b22..350a827a9d09 100644 --- a/lib/node_modules/@stdlib/string/right-trim-n/docs/types/test.ts +++ b/lib/node_modules/@stdlib/string/right-trim-n/docs/types/test.ts @@ -24,7 +24,7 @@ import rtrimN = require( './index' ); // The function returns a string... { rtrimN( ' abc ', 3 ); // $ExpectType string - rtrimN( '~~~abc~~~', 3, '~' ); // $ExpectType + rtrimN( '~~~abc~~~', 3, '~' ); // $ExpectType string } // The compiler throws an error if the function is provided arguments having invalid types... diff --git a/lib/node_modules/@stdlib/string/right-trim/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/right-trim/docs/types/index.d.ts index fcda90287e34..0867bfd67c35 100644 --- a/lib/node_modules/@stdlib/string/right-trim/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/right-trim/docs/types/index.d.ts @@ -19,7 +19,7 @@ // TypeScript Version: 4.1 /** -* Trims whitespace from the end of a string. +* Trims whitespace characters from the end of a string. * * @param str - input string * @returns trimmed string diff --git a/lib/node_modules/@stdlib/string/substring-after-last/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/substring-after-last/docs/types/index.d.ts index d608cb3ca859..281b87dcc7cc 100644 --- a/lib/node_modules/@stdlib/string/substring-after-last/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/substring-after-last/docs/types/index.d.ts @@ -24,7 +24,7 @@ * Returns the part of a string after the last occurrence of a specified substring. * * @param str - input string -* @param search - search value +* @param search - search string * @param fromIndex - index of last character to be considered beginning of a match (default: `str.length`) * @returns substring * diff --git a/lib/node_modules/@stdlib/string/substring-before-last/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/substring-before-last/docs/types/index.d.ts index b4620532fc49..d5ff417b4719 100644 --- a/lib/node_modules/@stdlib/string/substring-before-last/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/substring-before-last/docs/types/index.d.ts @@ -24,7 +24,7 @@ * Returns the part of a string before the last occurrence of a specified substring. * * @param str - input string -* @param search - search value +* @param search - search string * @returns substring * * @example diff --git a/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/docs/types/index.d.ts index 5840f028bb2f..211465b069ce 100644 --- a/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/docs/types/index.d.ts @@ -73,11 +73,11 @@ interface Grapheme { * @returns emoji property * * @example - * var out = emojiProperty( 0x23EC ); + * var out = grapheme.emojiProperty( 0x23EC ); * // returns 101 * * @example - * var out = emojiProperty( 0x1FFFE ); + * var out = grapheme.emojiProperty( 0x1FFFE ); * // returns 11 */ emojiProperty( code: number ): number; From 87705d30eec7751a3ecb0e59c0181a7d8192b7ef Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 31 May 2026 00:59:27 -0700 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/string/from-code-point/docs/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts b/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts index d1016ec05bad..5d8d501fe9b9 100644 --- a/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/string/from-code-point/docs/types/index.d.ts @@ -43,7 +43,7 @@ declare function fromCodePoint( pts: ArrayLike ): string; * * - In addition to multiple arguments, the function also supports providing an array-like object as a single argument containing a sequence of Unicode code points. * -* @param pt - Unicode code point +* @param pt - sequence of code points * @throws must provide either an array-like object of code points or one or more code points as separate arguments * @throws a code point must be a nonnegative integer * @throws must provide a valid Unicode code point