This fun collection of JS files, provides some tooling that i use with alot of projects.
** 21.9.2020 - while some of these are no longer needed, it is still nice to have this as an archive of old practices.
Some documentation for the most frequently used:
guid.js
class - Guid
method - newGuid(): generates a lowercase random guid.
example:
Guid.newGuid()
result:"9619d99e-ac91-874d-06d2-2512ab68a465"
method - isGuid(str): returns bool, checks whehter input string is a guid.
namespace.js
method - namespace(name, seperator, container): generates a hierarchy of objects to the by the desired string.
example:
namespace("solution.project").SomeClass = function () { }
will create an object under the following tree: solution.project.SomeClass
stringPrototype.js
class - String
method - format(): acts like c++'s format function.
example:
"{0} World {1}".format("Hello",":)");
result: "Hello World :)"
method - camelize(): replaces first letter to uppercase and lowers the rest. example: ``` "hello".camelize(); ``` result: "Hello";
method - stripAllAfter(str): Cuts of a string after a specific character/word.
method - contains(str): Checks whether an input string is contained in the string, one or more times.
method - hashCode(): generates a number identifier coressponding to the string.