MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / humanizeString

Function humanizeString

lib/utils.js:610–619  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

608}
609
610export const humanizeString = function (string) {
611 // split strings by words, then make them all lowercase
612 const _result = string
613 .replace(/([a-z](?=[A-Z]))/g, '$1 ')
614 .split(' ')
615 .map(word => word.toLowerCase())
616
617 _result[0] = _result[0] === 'i' ? ucfirst(_result[0]) : _result[0]
618 return _result.join(' ').trim()
619}
620
621/**
622 * Creates a circular-safe replacer function for JSON.stringify

Callers 3

pageStateToMarkdownFunction · 0.90
humanizeMethod · 0.90
humanizeMethod · 0.90

Calls 1

ucfirstFunction · 0.85

Tested by

no test coverage detected