@@ -43,6 +43,8 @@ Manages an [`Error`][js-error].
4343* [ Api] ( #api )
4444* [ ` ValidationError ` ] ( #validationerror )
4545* [ Interface] ( #interface )
46+ * [ Experimental] ( #experimental )
47+ * [ Changelog] ( #changelog )
4648* [ Git] ( #git )
4749 * [ Commit] ( #commit )
4850 * [ Versioning] ( #versioning )
@@ -63,13 +65,15 @@ Type guard (constrain)
6365Guards
6466> It's a ** combination** of both above, ** constrains** the type of the parameter in the ** code editor** , and checks its provided argument.
6567
66- Sets
67- > Sets the existing given value in the ` object ` .
68-
6968Defines
70- > Returns defined value from the method of the ` object ` .
71- > Defines the new value in the ` object ` .
72- > Both above at the same time.
69+ > Returns defined value from a method of an object.
70+ > Defines new value in an object and returns a defined value.
71+
72+ Gets
73+ > Returns a value from an object.
74+
75+ Sets
76+ > Adds or updates an element with a specified key and a value to an object and returns an object.
7377
7478<br >
7579
@@ -110,6 +114,18 @@ import {
110114} from ' @angular-package/error' ;
111115```
112116
117+ ``` typescript
118+ /*
119+ * Experimental.
120+ */
121+ import {
122+ // Class.
123+ MessageBuilder ,
124+ MessageBuilderTemplate ,
125+ MessageFunctionBuilder ,
126+ } from ' @angular-package/error' ;
127+ ```
128+
113129<br >
114130
115131## ` ValidationError `
@@ -219,7 +235,7 @@ The **return value** is a message of a `string` type created from the provided `
219235
220236``` typescript
221237// Example usage.
222- import { ValidationError } from ' @angular-package/core ' ;
238+ import { ValidationError } from ' @angular-package/error ' ;
223239
224240const fix = ' There is no solution to the described problem.' ;
225241const problem = ' The problem has no solution.' ;
@@ -270,7 +286,7 @@ The **return value** is an instance of [`ValidationError`](#validationerror).
270286
271287``` typescript
272288// Example usage.
273- import { ValidationError } from ' @angular-package/core ' ;
289+ import { ValidationError } from ' @angular-package/error ' ;
274290
275291const fix = ' There is no solution to the described problem.' ;
276292const problem = ' The problem has no solution.' ;
@@ -302,6 +318,108 @@ interface ErrorMessage {
302318
303319<br >
304320
321+ ## Experimental
322+
323+ ![ experimental]
324+
325+ ### Message builder
326+
327+ #### ` MessageBuilder `
328+
329+ Message builder for error message of a [ ` string ` ] [ js-string ] type.
330+
331+ ``` typescript
332+ // Example usage of building a function.
333+ import { MessageBuilder } from ' @angular-package/error' ;
334+
335+ /**
336+ * Initialize `MessageBuilder`.
337+ */
338+ const messageFunctionBuilder = new MessageBuilder (' function' );
339+
340+ messageFunctionBuilder
341+ .setFunctionName (' guardString' )
342+ .setParam (' value' , ' string' )
343+ .setReturn (' boolean' );
344+
345+ // Console returns `guardString(value: string): boolean`
346+ console .log (messageFunctionBuilder .get );
347+ ```
348+
349+ ``` typescript
350+ // Example usage of building a method.
351+ import { MessageBuilder } from ' @angular-package/error' ;
352+
353+ /**
354+ * Initialize `MessageBuilder`.
355+ */
356+ const messageMethodBuilder = new MessageBuilder (' method' );
357+
358+ // Build the class method.
359+ messageMethodBuilder
360+ .setMethodName (' setPerson' )
361+ .setParam (' value' , ' string' )
362+ .setReturn (' this' );
363+
364+ // Console returns `setPerson(value: string): this`
365+ console .log (messageMethodBuilder .get );
366+ ```
367+
368+ ``` typescript
369+ // Example usage of building a class.
370+ import { MessageBuilder } from ' @angular-package/error' ;
371+
372+ /**
373+ * Initialize `MessageBuilder`.
374+ */
375+ const messageClassBuilder = new MessageBuilder (' class' );
376+
377+ // Build the class.
378+ messageClassBuilder
379+ .setClassName (' Person.prototype.' )
380+ .setMethodName (' setPerson' )
381+ .setParam (' value?' , ' object' )
382+ .setReturn (' object' );
383+
384+ // Console returns `Person.prototype.setPerson(value?: object): object`
385+ console .log (messageClassBuilder .get );
386+ ```
387+
388+ <br >
389+
390+ #### ` MessageFunctionBuilder `
391+
392+ Message function builder for error message of a [ ` string ` ] [ js-string ] type.
393+
394+ ``` typescript
395+ // Example usage of building a function.
396+ import { MessageFunctionBuilder } from ' @angular-package/error' ;
397+
398+ /**
399+ * Initialize `MessageFunctionBuilder`.
400+ */
401+ const messageFunctionBuilder = new MessageFunctionBuilder ();
402+
403+ messageFunctionBuilder
404+ .setName (' guardString' )
405+ .setParam (' value' , ' string' )
406+ .setReturn (' boolean' )
407+ .build ();
408+
409+ // Console returns `guardString(value: string): boolean`
410+ console .log (messageFunctionBuilder .get );
411+ ```
412+
413+ <br >
414+
415+ ## Changelog
416+
417+ The ** changelog** of this package is based on [ * keep a changelog* ] ( https://keepachangelog.com/en/1.0.0/ ) . To read it, click on the [ CHANGELOG.md] ( https://github.com/angular-package/error/blob/main/CHANGELOG.md ) link.
418+
419+ > A changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project. - [ * keep a changelog* ] ( https://keepachangelog.com/en/1.0.0/ )
420+
421+ <br >
422+
305423## GIT
306424
307425### Commit
@@ -345,6 +463,7 @@ MIT © angular-package ([license][error-license])
345463[ skeleton ] : https://github.com/angular-package/skeleton
346464
347465<!-- Update status -->
466+ [ experimental ] : https://img.shields.io/badge/-experimental-orange
348467[ fix ] : https://img.shields.io/badge/-fix-red
349468[ new ] : https://img.shields.io/badge/-new-green
350469[ update ] : https://img.shields.io/badge/-update-red
0 commit comments