There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "To override New, Edit, or View, the Lightning component must implement the Lightning:actionOverride interface."
A block of code is set as follows:
function StringUtils() {};
StringUtils.prototype.concatenate = function(str1,str2) {
return str1.concat(str2);
};
StringUtils.prototype.camelcase = function(string) {
string = string.toLowerCase().replace(/(?:(^.)|([-_s]+.))/g, function(match) {
return match.charAt(match.length-1).toUpperCase();
});
return string.charAt(0).toLowerCase() + string.substring(1);
};
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
describe("when string operations are performed", function(){
//Spec for Concatenation operation
it("should be able to concatenate hello and world", function() {
expect(stringUtil.concatenate('Hello','World')).toEqual('HelloWorld');
});
//Spec for camelcase operation
it("should be able to camelcase", function() {
expect(stringUtil.camelcase('hello-world')).toEqual('helloWorld');
});
//Spec for capitalizeFirstLetter
it("should be able to capitalize First Letter", function() {
expect(stringUtil.capitalizeFirstLetter('world')).toEqual('World');
});
});
Any command-line input or output is written as follows:
sfdx force:lightning:test:run
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Once in the Setup menu, find App Manager from the search box. A new Lightning app can be created using the New Lightning App button."