File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,7 @@ const LOWERCASE_S_CODE = 115; /* s */
58
58
* @returns
59
59
* Formatted string.
60
60
*/
61
- export default function sprintf (
62
- template : string ,
63
- ...values : unknown [ ]
64
- ) : string {
61
+ export function sprintf ( template : string , ...values : unknown [ ] ) : string {
65
62
if ( typeof template !== "string" ) {
66
63
throw new TypeError ( "First argument must be a string" ) ;
67
64
}
@@ -190,3 +187,11 @@ export default function sprintf(
190
187
191
188
return output ;
192
189
}
190
+
191
+ /**
192
+ * Format a string.
193
+ *
194
+ * @deprecated
195
+ * Use `sprintf` instead.
196
+ */
197
+ export default sprintf ;
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import test from "node:test";
4
4
test ( "@arcjet/sprintf" , async function ( t ) {
5
5
await t . test ( "should expose the public api" , async function ( ) {
6
6
assert . deepEqual ( Object . keys ( await import ( "../index.js" ) ) . sort ( ) , [
7
- // TODO(@wooorm-arcjet): named exports.
8
7
"default" ,
8
+ "sprintf" ,
9
9
] ) ;
10
10
} ) ;
11
11
} ) ;
You can’t perform that action at this time.
0 commit comments