@@ -45,7 +45,7 @@ export class Wrapper<
45
45
}
46
46
47
47
/**
48
- * The method checks if the value of any type is an instance of the `Wrapper` of any, or given opening and closing chars.
48
+ * 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 .
49
49
* @param value The value of any type to test against the `Wrapper` instance.
50
50
* @param opening Optional opening chars of generic type variable `Opening` to check if the given `value` contains.
51
51
* @param closing Optional closing chars of generic type variable `Closing` to check if the given `value` contains.
@@ -70,10 +70,10 @@ 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 the closing chars in a given ` text` with a given replacement value at the end of the 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.
76
+ * @param replaceValue Replacement value for the given ` closing` characters in the given ` text` .
77
77
* @returns The return value is the text of `string` type with a replaced closing chars by a given replacement value.
78
78
* @angularpackage
79
79
*/
@@ -88,10 +88,10 @@ export class Wrapper<
88
88
}
89
89
90
90
/**
91
- * Replaces the opening chars in a given text with a given replacement value at the end of the text.
91
+ * Replaces the opening chars in a given ` text` with a given replacement value at the end of the text.
92
92
* @param text The text of `string` type in which the given `opening` chars are replaced by a given replacement value.
93
93
* @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.
94
+ * @param replaceValue Replacement value for the ` opening` characters in the given ` text` .
95
95
* @returns The return value is the text of `string` type with a replaced opening chars by a given replacement value.
96
96
* @angularpackage
97
97
*/
@@ -110,7 +110,7 @@ export class Wrapper<
110
110
* @param text The text of the `string` from which given opening and closing chars are removed.
111
111
* @param opening The opening chars of the `string` to be removed in the given `text`.
112
112
* @param closing The closing chars of the `string` to be removed in the given `text`.
113
- * @returns The return value is the text without the given opening and closing chars.
113
+ * @returns The return value is the text of string type without the given opening and closing chars.
114
114
* @angularpackage
115
115
*/
116
116
public static unwrap ( text : string , opening = '' , closing = '' ) : string {
@@ -138,51 +138,53 @@ export class Wrapper<
138
138
139
139
//#region instance public methods.
140
140
/**
141
- * Determines whether the provided `text` has the closing chars of the specified `Wrapper` object.
142
- * @param text The text of `string` to test for the existence of the closing chars at the end in it.
143
- * @returns The return value is a `boolean` indicating whether the given `text` has the closing of the wrap.
141
+ * Determines whether the provided `text` has the closing chars of the specified `Wrapper` object at the end .
142
+ * @param text The text of `string` to test for the existence of the closing chars at the end of it.
143
+ * @returns The return value is a `boolean` indicating whether the given `text` has the closing chars of the wrap.
144
144
* @angularpackage
145
145
*/
146
146
public isClosingIn ( text : string ) : boolean {
147
147
return Wrapper . hasClosing ( text , this . closing ) ;
148
148
}
149
149
150
150
/**
151
- * Checks if the provided `text` has the opening of a specified `Wrapper` object at the beginning of the text .
151
+ * Checks whether the provided `text` has the opening chars of a specified `Wrapper` object at the beginning.
152
152
* @param text The text of `string` to test for the existence of the opening chars at the beginning of it.
153
- * @returns The return value is a `boolean` indicating whether the given `text` has the opening of the wrap.
153
+ * @returns The return value is a `boolean` indicating whether the given `text` has the opening chars of the wrap.
154
154
* @angularpackage
155
155
*/
156
156
public isOpeningIn ( text : string ) : boolean {
157
157
return Wrapper . hasOpening ( text , this . opening ) ;
158
158
}
159
159
160
160
/**
161
- * Replaces the closing chars of the `Wrapper` object in the given text with a given replacement value.
161
+ * Replaces the closing chars of the `Wrapper` object in the given `text` with a given replacement value.
162
+ * The replacement succeeds if the closing characters exist at the end of the text.
162
163
* @param text The text of `string` type in which the closing chars are replaced by given replacement value.
163
164
* @param replaceValue The value of `string` type as a replacement for the closing chars at the end of the given `text`.
164
- * @returns The return value is the text of a `string` type with replaced closing chars by given replacement value.
165
+ * @returns The return value is the text of `string` type with replaced closing chars by given replacement value.
165
166
* @angularpackage
166
167
*/
167
168
public replaceClosingIn ( text : string , replaceValue : string ) : string {
168
169
return Wrapper . replaceClosing ( text , this . closing , replaceValue ) ;
169
170
}
170
171
171
172
/**
172
- * Replaces the opening chars of the `Wrapper` object in the given text with a given replacement value.
173
+ * Replaces the opening chars of the `Wrapper` object in the given `text` with a given replacement value.
174
+ * The replacement succeeds if the opening characters exist at the beginning of the text.
173
175
* @param text The text of `string` type in which the opening chars are replaced by given replacement value.
174
176
* @param replaceValue The value of `string` type as a replacement for the opening chars at the beginning of the given `text`.
175
- * @returns The return value is the text of a `string` type with replaced opening chars by given replacement value.
177
+ * @returns The return value is the text of `string` type with replaced opening chars by given replacement value.
176
178
* @angularpackage
177
179
*/
178
180
public replaceOpeningIn ( text : string , replaceValue : string ) : string {
179
181
return Wrapper . replaceOpening ( text , this . opening , replaceValue ) ;
180
182
}
181
183
182
184
/**
183
- * Returns given text without the opening and closing chars of the wrapper .
185
+ * Returns given ` text` without the opening and closing chars of the `Wrapper` object .
184
186
* @param text The text of a `string` type to unwrap with the opening and closing chars of the `Wrapper` object.
185
- * @returns The return value is the unwrapped text from the opening and closing chars of a `string` type .
187
+ * @returns The return value is the text of `string` type unwrapped from the opening and closing chars of the `Wrapper` object .
186
188
* @angularpackage
187
189
*/
188
190
public removeWrapIn ( text : string ) : string {
@@ -194,17 +196,19 @@ export class Wrapper<
194
196
}
195
197
196
198
/**
197
- * Replaces the closing chars of the `Wrapper` object in the text with the given closing chars.
199
+ * Replaces the closing chars of the `Wrapper` object in the text of the `Wrapper` object with the given `closing` chars.
200
+ * The replacement succeeds if the closing characters exist at the end of the text.
198
201
* @param closing The closing chars of `string` to replace in the text(part of the primitive value).
199
- * @returns The return value is the text of string type with replaced closing chars.
202
+ * @returns The return value is the text of ` string` type with replaced closing chars.
200
203
* @angularpackage
201
204
*/
202
205
public textReplaceClosing ( closing : string ) : string {
203
206
return Wrapper . replaceClosing ( this . text , this . closing , closing ) ;
204
207
}
205
208
206
209
/**
207
- * Replaces the opening chars of the `Wrapper` object in the text with the given opening chars.
210
+ * Replaces the opening chars of the `Wrapper` object in the text of the `Wrapper` object with the given `opening` chars. The replacement
211
+ * succeeds if the opening characters exist at the beginning of the text.
208
212
* @param opening The opening chars of `string` to replace in the text(part of the primitive value).
209
213
* @returns The return value is the text of string type with replaced opening chars.
210
214
* @angularpackage
@@ -214,29 +218,27 @@ export class Wrapper<
214
218
}
215
219
216
220
/**
217
- * The method returns the text of the `Wrapper` object without the opening and closing chars.
218
- * @param opening The opening chars of the generic type variable `CustomOpening` to remove from the beginning of the text of the `Wrapper`
219
- * instance. By default, its value is from the opening chars of an instance of `Wrapper`.
220
- * @param closing The closing chars of the generic type variable `CustomClosing` to remove from the end of the text of the `Wrapper`
221
- * instance. By default, its value is from the closing chars of an instance of `Wrapper`.
222
- * @returns The return value is the text of string type without the opening and closing chars.
221
+ * The method returns the text of the `Wrapper` object without its opening and closing chars or the given `opening` and `closing` chars.
222
+ * @param opening Optional opening chars of `string` type to remove from the beginning of the text of the `Wrapper` instance. By default,
223
+ * its value is equal to the opening chars of the `Wrapper` instance.
224
+ * @param closing Optional closing chars of `string` type to remove from the end of the text of the `Wrapper` instance. By default, its
225
+ * value is equal to the closing chars of the `Wrapper` instance.
226
+ * @returns The return value is the text of `string` type without the opening and closing chars of the `Wrapper` object or given `opening`
227
+ * and `closing` chars.
223
228
* @angularpackage
224
229
*/
225
- public textUnwrap <
226
- CustomOpening extends string = Opening ,
227
- CustomClosing extends string = Closing
228
- > (
229
- opening : CustomOpening = this . opening as any ,
230
- closing : CustomClosing = this . closing as any
230
+ public textUnwrap (
231
+ opening : string = this . opening ,
232
+ closing : string = this . closing
231
233
) : string {
232
234
return Wrapper . unwrap ( this . text , opening , closing ) ;
233
235
}
234
236
235
237
/**
236
- * The method returns the text of the `Wrapper` object wrapped by the given opening and closing chars.
238
+ * The method returns the text of the `Wrapper` object wrapped by the given ` opening` and ` closing` chars.
237
239
* @param opening The opening chars of a generic type variable `TextOpening` to wrap the text of the `Wrapper` instance.
238
240
* @param closing The closing chars of a generic type variable `TextClosing` to wrap the text of the `Wrapper` instance.
239
- * @returns The return value is wrapped text by given opening and closing chars of generic type `Wrapped`.
241
+ * @returns The return value is the text wrapped by given ` opening` and closing ` chars` of generic type `Wrapped`.
240
242
* @angularpackage
241
243
*/
242
244
public textWrap < TextOpening extends string , TextClosing extends string > (
@@ -274,37 +276,33 @@ export class Wrapper<
274
276
}
275
277
276
278
/**
277
- * The method returns the primitive value of a specified `Wrapper` object with unwrapped text from its opening and closing chars or the
278
- * given `opening` and `closing` chars.
279
- * @param opening The opening chars of the generic type variable `CustomOpening` to remove from the beginning of the text of the `Wrapper`
280
- * instance. By default, its value is from the opening chars of an instance of `Wrapper`.
281
- * @param closing The closing chars of the generic type variable `CustomClosing` to remove from the end of the text of the `Wrapper`
282
- * instance. By default, its value is from the closing chars of an instance of `Wrapper`.
283
- * @returns The return value is the primitive value of `string` type with unwrapped text from its opening and closing chars or from the
284
- * given `opening` and `closing` chars.
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.
281
+ * @param opening Optional opening chars of `string` type to remove from the beginning of the text of the `Wrapper` instance. By default,
282
+ * its value is equal to the opening chars of the `Wrapper` instance .
283
+ * @param closing Optional closing chars of `string` type to remove from the end of the text of the `Wrapper` instance. By default, its
284
+ * value is equal to the closing chars of the `Wrapper` instance .
285
+ * @returns The return value is the primitive value of `string` type with text unwrapped from the opening and closing chars of the
286
+ * `Wrapper` object or the given `opening` and `closing` chars.
285
287
* @angularpackage
286
288
*/
287
- public unwrapText <
288
- CustomOpening extends string = Opening ,
289
- CustomClosing extends string = Closing
290
- > (
291
- opening : CustomOpening = this . opening as any ,
292
- closing : CustomClosing = this . closing as any
289
+ public unwrapText (
290
+ opening : string = this . opening ,
291
+ closing : string = this . closing
293
292
) : string {
294
293
return `${ this . opening } ${ Wrapper . unwrap ( this . text , opening , closing ) } ${
295
294
this . closing
296
295
} `;
297
296
}
298
297
299
298
/**
300
- * The method wraps the primitive value of a specified `Wrapper` object by its opening and closing chars or the given `opening` and
301
- * `closing` chars.
302
- * @param opening The opening chars of a generic type variable `CustomOpening` to wrap the primitive value of the `Wrapper` instance. By
303
- * default, its value is from the opening chars of an instance of `Wrapper`.
304
- * @param closing The closing chars of a generic type variable `CustomClosing` to wrap the primitive value of the `Wrapper` instance. By
305
- * default, its value is from the closing chars of an instance of `Wrapper`.
306
- * @returns The return value is the wrapped primitive value by the given opening and closing chars or the opening and closing chars of the
307
- * `Wrapper` instance.
299
+ * The method wraps the primitive value of a specified `Wrapper` object by its opening and closing chars or given `opening` and `closing`
300
+ * chars.
301
+ * @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.
303
+ * @param closing Optional closing chars of a generic type variable `CustomClosing` to wrap the primitive value of the `Wrapper` instance.
304
+ * 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
306
* @angularpackage
309
307
*/
310
308
public wrap <
@@ -319,13 +317,13 @@ export class Wrapper<
319
317
320
318
/**
321
319
* Wraps given text with the wrap, the opening, and closing chars of the `Wrapper` object.
322
- * @param text The text of generic type variable `Txt ` to wrap by the opening and closing chars of the `Wrapper` instance.
323
- * @returns The return value is the wrapped text by the opening and closing chars of the `Wrapper` object of the generic type `Wrapped`.
320
+ * @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`.
324
322
* @angularpackage
325
323
*/
326
- public wrapOn < Txt extends string = '' > (
327
- text : Txt
328
- ) : Wrapped < Opening , Txt , Closing > {
324
+ public wrapOn < CustomText extends string = '' > (
325
+ text : CustomText
326
+ ) : Wrapped < Opening , CustomText , Closing > {
329
327
return new Wrap ( this . opening , this . closing , text ) . valueOf ( ) ;
330
328
}
331
329
0 commit comments