Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102278817
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
Wed, Feb 19, 01:17
Size
576 B
Mime Type
text/x-java
Expires
Fri, Feb 21, 01:17 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24322605
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