This repository was archived by the owner on Feb 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ export default capitalizeFirstLetter
2+
3+ /**
4+ * Original source: https://stackoverflow.com/questions/1026069/
5+ * This function would convert the first letter of any string passed to it into uppercase
6+ * it is a copy
7+ * @param {string }string - The string to capitalize the first letter of a string
8+ * @return {string } - The capitalized string
9+ **/
10+ function capitalizeFirstLetter ( string ) {
11+ return string . charAt ( 0 ) . toUpperCase ( ) + string . slice ( 1 )
12+ }
Original file line number Diff line number Diff line change 11import isEven from './is-even'
2+ import capitalizeFirstLetter from './convert-first-letter-to-capital'
23import revstring from './revstring'
34import initArray from './init-array'
45import reduce from './reduce-to-tally'
@@ -52,6 +53,7 @@ import median from './array-median'
5253
5354export {
5455 isOdd ,
56+ capitalizeFirstLetter ,
5557 isEven ,
5658 revstring ,
5759 initArray ,
Original file line number Diff line number Diff line change 1+ import test from 'ava'
2+ import { capitalizeFirstLetter } from '../src'
3+
4+ test ( 'capitalize first letter' , t => {
5+ const original = 'oyinkan'
6+ const expected = 'Oyinkan'
7+ const actual = capitalizeFirstLetter ( original )
8+ t . deepEqual ( actual , expected )
9+ } )
You can’t perform that action at this time.
0 commit comments