Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99929889
capitalize.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 27, 08:13
Size
576 B
Mime Type
text/x-java
Expires
Wed, Jan 29, 08:13 (2 d)
Engine
blob
Format
Raw Data
Handle
23851208
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
capitalize.js
View Options
import
_formatMuiErrorMessage
from
"./formatMuiErrorMessage"
;
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
//
// A strict capitalization should uppercase the first letter of each word in the sentence.
// We only handle the first word.
export
default
function
capitalize
(
string
)
{
if
(
typeof
string
!==
'string'
)
{
throw
new
Error
(
process
.
env
.
NODE_ENV
!==
"production"
?
`
MUI
:
\`
capitalize
(
string
)
\`
expects
a
string
argument
.
`
:
_formatMuiErrorMessage
(
7
));
}
return
string
.
charAt
(
0
).
toUpperCase
()
+
string
.
slice
(
1
);
}
Event Timeline
Log In to Comment