@@ -17,7 +17,7 @@ export class Wrapper<
17
17
* `typeOf()` function of `@angular-package/type`.
18
18
*/
19
19
public get [ Symbol . toStringTag ] ( ) : string {
20
- return 'wrapper ' ;
20
+ return 'Wrapper ' ;
21
21
}
22
22
//#endregion instance accessors.
23
23
@@ -43,7 +43,7 @@ export class Wrapper<
43
43
}
44
44
45
45
/**
46
- * The method checks if the value of any type is an instance of the `Wrapper` of any, or the given opening, closing chars, and text.
46
+ * The method checks if the value of any type is an instance of the `Wrapper` of any, or the given ` opening`, ` closing` chars, and ` text` .
47
47
* @param value The value of any type to test against the `Wrapper` instance.
48
48
* @param opening Optional opening chars of generic type variable `Opening` to check if the given `value` contains.
49
49
* @param closing Optional closing chars of generic type variable `Closing` to check if the given `value` contains.
@@ -55,7 +55,7 @@ export class Wrapper<
55
55
public static isWrapper <
56
56
Opening extends string ,
57
57
Closing extends string ,
58
- Text extends string = ''
58
+ Text extends string = string
59
59
> (
60
60
value : any ,
61
61
opening ?: Opening ,
@@ -70,11 +70,12 @@ export class Wrapper<
70
70
}
71
71
72
72
/**
73
- * Replaces the closing chars in a given `text` with a given replacement value at the end of the text.
73
+ * Replaces given `closing` chars with a given replacement value at the end of the given ` text` .
74
74
* @param text The text of `string` type in which given `closing` characters are replaced by a given replacement value.
75
75
* @param closing The closing chars of the `string` to replace by a given replacement value at the end of the given `text`.
76
- * @param replaceValue Replacement value for the given `closing` characters in the given `text`.
77
- * @returns The return value is the text of `string` type with a replaced closing chars by a given replacement value.
76
+ * @param replaceValue The replacement value of a string type for the given `closing` characters in the given `text`.
77
+ * @returns The return value is the given `text` of `string` type with a replaced `closing` chars by a given replacement value or the
78
+ * specified `text` unchanged if it does not contain the given `closing` chars.
78
79
* @angularpackage
79
80
*/
80
81
public static replaceClosing (
@@ -88,11 +89,12 @@ export class Wrapper<
88
89
}
89
90
90
91
/**
91
- * Replaces the opening chars in a given `text` with a given replacement value at the beginning of the text.
92
+ * Replaces given `opening` chars with a given replacement value at the beginning of the given ` text` .
92
93
* @param text The text of `string` type in which the given `opening` chars are replaced by a given replacement value.
93
94
* @param opening The opening chars of the `string` to replace by a given replacement value at the beginning of the given `text`.
94
- * @param replaceValue Replacement value for the `opening` characters in the given `text`.
95
- * @returns The return value is the text of `string` type with a replaced opening chars by a given replacement value.
95
+ * @param replaceValue The replacement value of a string type for the given `opening` characters in the given `text`.
96
+ * @returns The return value is the given `text` of `string` type with a replaced `opening` chars by a given replacement value or the
97
+ * specified `text` unchanged if it does not contain the given `opening` chars.
96
98
* @angularpackage
97
99
*/
98
100
public static replaceOpening (
@@ -106,14 +108,15 @@ export class Wrapper<
106
108
}
107
109
108
110
/**
109
- * The method returns the text without the given `opening` and `closing` chars.
111
+ * The method returns the given ` text` without the given `opening` and `closing` chars.
110
112
* @param text The text of the `string` from which given opening and closing chars are removed.
111
113
* @param opening The opening chars of the `string` to be removed in the given `text`.
112
114
* @param closing The closing chars of the `string` to be removed in the given `text`.
113
- * @returns The return value is the text of string type without the given opening and closing chars.
115
+ * @returns The return value is the given `text` of `string` type without the given `opening` and `closing` chars or unchanged `text` if
116
+ * it does not contain the given `opening` and `closing` chars.
114
117
* @angularpackage
115
118
*/
116
- public static unwrap ( text : string , opening = '' , closing = '' ) : string {
119
+ public static unwrap ( text : string , opening : string , closing : string ) : string {
117
120
return (
118
121
( text = this . replaceClosing ( text , closing , '' ) ) ,
119
122
( text = this . replaceOpening ( text , opening , '' ) ) ,
@@ -162,7 +165,7 @@ export class Wrapper<
162
165
* The replacement succeeds if the closing characters exist at the end of the text.
163
166
* @param text The text of `string` type in which the closing chars are replaced by given replacement value.
164
167
* @param replaceValue The value of `string` type as a replacement for the closing chars at the end of the given `text`.
165
- * @returns The return value is the text of `string` type with replaced closing chars by given replacement value.
168
+ * @returns The return value is the given ` text` of `string` type with replaced closing chars by given replacement value.
166
169
* @angularpackage
167
170
*/
168
171
public replaceClosingIn ( text : string , replaceValue : string ) : string {
@@ -174,7 +177,7 @@ export class Wrapper<
174
177
* The replacement succeeds if the opening characters exist at the beginning of the text.
175
178
* @param text The text of `string` type in which the opening chars are replaced by given replacement value.
176
179
* @param replaceValue The value of `string` type as a replacement for the opening chars at the beginning of the given `text`.
177
- * @returns The return value is the text of `string` type with replaced opening chars by given replacement value.
180
+ * @returns The return value is the given ` text` of `string` type with replaced opening chars by given replacement value.
178
181
* @angularpackage
179
182
*/
180
183
public replaceOpeningIn ( text : string , replaceValue : string ) : string {
@@ -183,7 +186,7 @@ export class Wrapper<
183
186
184
187
/**
185
188
* Returns given `text` without the opening and closing chars of the `Wrapper` object.
186
- * @param text The text of a `string` type to unwrap with the opening and closing chars of the `Wrapper` object.
189
+ * @param text The text of a `string` type to unwrap from the opening and closing chars of the `Wrapper` object.
187
190
* @returns The return value is the text of `string` type unwrapped from the opening and closing chars of the `Wrapper` object.
188
191
* @angularpackage
189
192
*/
@@ -210,7 +213,7 @@ export class Wrapper<
210
213
* Replaces the opening chars of the `Wrapper` object in the text of the `Wrapper` object with the given `opening` chars. The replacement
211
214
* succeeds if the opening characters exist at the beginning of the text.
212
215
* @param opening The opening chars of `string` to replace in the text(part of the primitive value).
213
- * @returns The return value is the text of string type with replaced opening chars.
216
+ * @returns The return value is the text of ` string` type with replaced opening chars.
214
217
* @angularpackage
215
218
*/
216
219
public textReplaceOpening ( opening : string ) : string {
@@ -276,8 +279,8 @@ export class Wrapper<
276
279
}
277
280
278
281
/**
279
- * The method returns the primitive value of a specified `Wrapper` object with text unwrapped from its opening and closing chars or given
280
- * `opening` and `closing` chars.
282
+ * The method returns the primitive value of a specified `Wrapper` object with text unwrapped from the opening and closing chars of the
283
+ * `Wrapper` instance or given ` opening` and `closing` chars.
281
284
* @param opening Optional opening chars of `string` type to remove from the beginning of the text of the `Wrapper` instance. By default,
282
285
* its value is equal to the opening chars of the `Wrapper` instance.
283
286
* @param closing Optional closing chars of `string` type to remove from the end of the text of the `Wrapper` instance. By default, its
@@ -299,10 +302,11 @@ export class Wrapper<
299
302
* The method wraps the primitive value of a specified `Wrapper` object by its opening and closing chars or given `opening` and `closing`
300
303
* chars.
301
304
* @param opening Optional opening chars of a generic type variable `CustomOpening` to wrap the primitive value of the `Wrapper` instance.
302
- * By default, its value is equal to the closing chars of the `Wrapper` instance.
305
+ * By default, its value is equal to the opening chars of the `Wrapper` instance.
303
306
* @param closing Optional closing chars of a generic type variable `CustomClosing` to wrap the primitive value of the `Wrapper` instance.
304
307
* By default, its value is equal to the closing chars of the `Wrapper` instance.
305
- * @returns The return value is a primitive value wrapped by the given opening and closing chars or from the `Wrapper` instance.
308
+ * @returns The return value is a primitive value wrapped by the opening and closing chars of the `Wrapper` instance or the given
309
+ * `opening` and `closing` chars.
306
310
* @angularpackage
307
311
*/
308
312
public wrap <
@@ -316,9 +320,10 @@ export class Wrapper<
316
320
}
317
321
318
322
/**
319
- * Wraps given text with the wrap, the opening, and closing chars of the `Wrapper` object.
323
+ * The method wraps the given ` text` with the wrap, the ` opening` , and ` closing` chars of the `Wrapper` object.
320
324
* @param text The text of generic type variable `CustomText` to wrap by the opening and closing chars of the `Wrapper` instance.
321
- * @returns The return value is the text wrapped by the opening and closing chars of the `Wrapper` object of the generic type `Wrapped`.
325
+ * @returns The return value is the given `text` wrapped by the opening and closing chars of the `Wrapper` object of the generic type
326
+ * `Wrapped`.
322
327
* @angularpackage
323
328
*/
324
329
public wrapOn < CustomText extends string = '' > (
0 commit comments