Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100884907
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, Feb 3, 14:57
Size
576 B
Mime Type
text/x-java
Expires
Wed, Feb 5, 14:57 (2 d)
Engine
blob
Format
Raw Data
Handle
24049001
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