@rapidrest/core 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/StringUtils.js +3 -3
- package/dist/types/StringUtils.d.ts +3 -3
- package/package.json +2 -7
- package/docs/Makefile +0 -20
- package/docs/conf.py +0 -58
- package/docs/index.rst +0 -17
- package/docs/make.bat +0 -35
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/README.md +0 -21
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +0 -33
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +0 -33
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +0 -33
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +0 -25
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +0 -31
- package/docs/reference/README.md +0 -35
- package/docs/reference/classes/AlertUtils.md +0 -158
- package/docs/reference/classes/ApiError.md +0 -251
- package/docs/reference/classes/ClassLoader.md +0 -224
- package/docs/reference/classes/Event.md +0 -109
- package/docs/reference/classes/EventUtils.md +0 -123
- package/docs/reference/classes/FileUtils.md +0 -193
- package/docs/reference/classes/JWTUtils.md +0 -139
- package/docs/reference/classes/MessagingUtils.md +0 -167
- package/docs/reference/classes/OASUtils.md +0 -227
- package/docs/reference/classes/ObjectFactory.md +0 -276
- package/docs/reference/classes/ObjectUtils.md +0 -60
- package/docs/reference/classes/StringUtils.md +0 -169
- package/docs/reference/classes/ThreadPool.md +0 -249
- package/docs/reference/classes/ThreadWorker.md +0 -91
- package/docs/reference/classes/UserUtils.md +0 -185
- package/docs/reference/classes/ValidationUtils.md +0 -294
- package/docs/reference/enumerations/AlertPriority.md +0 -61
- package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +0 -21
- package/docs/reference/enumerations/WorkerMessageType.md +0 -43
- package/docs/reference/functions/sleep.md +0 -25
- package/docs/reference/globals.md +0 -73
- package/docs/reference/interfaces/Alert.md +0 -101
- package/docs/reference/interfaces/AlertAttachment.md +0 -51
- package/docs/reference/interfaces/AlertClose.md +0 -31
- package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +0 -42
- package/docs/reference/interfaces/AlertUtilsOptions.md +0 -41
- package/docs/reference/interfaces/InstanceOptions.md +0 -41
- package/docs/reference/interfaces/JWTPayload.md +0 -143
- package/docs/reference/interfaces/JWTUser.md +0 -55
- package/docs/reference/interfaces/JWTUtilsConfig.md +0 -45
- package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +0 -68
- package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +0 -40
- package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +0 -78
- package/docs/reference/interfaces/NewEvent.md +0 -25
- package/docs/reference/interfaces/OriginSettings.md +0 -25
- package/docs/reference/interfaces/SlackConfig.md +0 -33
- package/docs/reference/interfaces/SmtpAuth.md +0 -25
- package/docs/reference/interfaces/SmtpConfig.md +0 -41
- package/docs/reference/interfaces/Template.md +0 -105
- package/docs/reference/interfaces/TemplateMapBase.md +0 -13
- package/docs/reference/interfaces/TwilioConfig.md +0 -33
- package/docs/reference/interfaces/WorkerMessage.md +0 -31
- package/docs/reference/interfaces/WorkerOptions.md +0 -61
- package/docs/reference/type-aliases/BooleanFunc.md +0 -23
- package/docs/reference/type-aliases/TemplateMap.md +0 -17
- package/docs/reference/type-aliases/WorkerCallback.md +0 -31
- package/docs/reference/variables/Logger.md +0 -25
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../globals.md) / ObjectFactory
|
|
6
|
-
|
|
7
|
-
# Class: ObjectFactory
|
|
8
|
-
|
|
9
|
-
Defined in: [src/ObjectFactory.ts:36](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L36)
|
|
10
|
-
|
|
11
|
-
The `ObjectFactory` is a manager for creating objects based on registered
|
|
12
|
-
class types. This allows for the tracking of multiple instances of objects
|
|
13
|
-
so that references can be referenced by unique name.
|
|
14
|
-
|
|
15
|
-
## Author
|
|
16
|
-
|
|
17
|
-
Jean-Philippe Steinmetz
|
|
18
|
-
|
|
19
|
-
## Constructors
|
|
20
|
-
|
|
21
|
-
### Constructor
|
|
22
|
-
|
|
23
|
-
> **new ObjectFactory**(`config?`, `logger?`): `ObjectFactory`
|
|
24
|
-
|
|
25
|
-
Defined in: [src/ObjectFactory.ts:55](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L55)
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
##### config?
|
|
30
|
-
|
|
31
|
-
`any`
|
|
32
|
-
|
|
33
|
-
##### logger?
|
|
34
|
-
|
|
35
|
-
`any`
|
|
36
|
-
|
|
37
|
-
#### Returns
|
|
38
|
-
|
|
39
|
-
`ObjectFactory`
|
|
40
|
-
|
|
41
|
-
## Properties
|
|
42
|
-
|
|
43
|
-
### classes
|
|
44
|
-
|
|
45
|
-
> `readonly` **classes**: `Map`\<`string`, `any`\>
|
|
46
|
-
|
|
47
|
-
Defined in: [src/ObjectFactory.ts:38](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L38)
|
|
48
|
-
|
|
49
|
-
A map for string fully qualified class names to their class types.
|
|
50
|
-
|
|
51
|
-
***
|
|
52
|
-
|
|
53
|
-
### config
|
|
54
|
-
|
|
55
|
-
> `protected` **config**: `any`
|
|
56
|
-
|
|
57
|
-
Defined in: [src/ObjectFactory.ts:41](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L41)
|
|
58
|
-
|
|
59
|
-
The global application configuration object.
|
|
60
|
-
|
|
61
|
-
***
|
|
62
|
-
|
|
63
|
-
### instances
|
|
64
|
-
|
|
65
|
-
> `readonly` **instances**: `Map`\<`string`, `any`\>
|
|
66
|
-
|
|
67
|
-
Defined in: [src/ObjectFactory.ts:44](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L44)
|
|
68
|
-
|
|
69
|
-
A map for the unique name to the intance of a particular class type.
|
|
70
|
-
|
|
71
|
-
***
|
|
72
|
-
|
|
73
|
-
### logger
|
|
74
|
-
|
|
75
|
-
> `protected` **logger**: `any`
|
|
76
|
-
|
|
77
|
-
Defined in: [src/ObjectFactory.ts:47](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L47)
|
|
78
|
-
|
|
79
|
-
The application logging utility.
|
|
80
|
-
|
|
81
|
-
## Methods
|
|
82
|
-
|
|
83
|
-
### clear()
|
|
84
|
-
|
|
85
|
-
> **clear**(): `void`
|
|
86
|
-
|
|
87
|
-
Defined in: [src/ObjectFactory.ts:158](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L158)
|
|
88
|
-
|
|
89
|
-
Deletes all instantiated objects.
|
|
90
|
-
|
|
91
|
-
#### Returns
|
|
92
|
-
|
|
93
|
-
`void`
|
|
94
|
-
|
|
95
|
-
***
|
|
96
|
-
|
|
97
|
-
### clearAll()
|
|
98
|
-
|
|
99
|
-
> **clearAll**(): `void`
|
|
100
|
-
|
|
101
|
-
Defined in: [src/ObjectFactory.ts:166](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L166)
|
|
102
|
-
|
|
103
|
-
Deletes all instantiated objects and registered class types.
|
|
104
|
-
|
|
105
|
-
#### Returns
|
|
106
|
-
|
|
107
|
-
`void`
|
|
108
|
-
|
|
109
|
-
***
|
|
110
|
-
|
|
111
|
-
### destroy()
|
|
112
|
-
|
|
113
|
-
> **destroy**(`objs?`): `Promise`\<`void`\>
|
|
114
|
-
|
|
115
|
-
Defined in: [src/ObjectFactory.ts:117](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L117)
|
|
116
|
-
|
|
117
|
-
Destroys the specified objects. If `undefined` is passed in, all objects managed by the factory are destroyed.
|
|
118
|
-
|
|
119
|
-
#### Parameters
|
|
120
|
-
|
|
121
|
-
##### objs?
|
|
122
|
-
|
|
123
|
-
`any`
|
|
124
|
-
|
|
125
|
-
#### Returns
|
|
126
|
-
|
|
127
|
-
`Promise`\<`void`\>
|
|
128
|
-
|
|
129
|
-
***
|
|
130
|
-
|
|
131
|
-
### getInitMethods()
|
|
132
|
-
|
|
133
|
-
> **getInitMethods**(`obj`): `Function`[]
|
|
134
|
-
|
|
135
|
-
Defined in: [src/ObjectFactory.ts:248](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L248)
|
|
136
|
-
|
|
137
|
-
Searches an object for one or more functions that implement a `@Init` decorator.
|
|
138
|
-
|
|
139
|
-
#### Parameters
|
|
140
|
-
|
|
141
|
-
##### obj
|
|
142
|
-
|
|
143
|
-
`any`
|
|
144
|
-
|
|
145
|
-
The object to search.
|
|
146
|
-
|
|
147
|
-
#### Returns
|
|
148
|
-
|
|
149
|
-
`Function`[]
|
|
150
|
-
|
|
151
|
-
The list of functions that implements the `@Init` decorator if found, otherwise undefined.
|
|
152
|
-
|
|
153
|
-
***
|
|
154
|
-
|
|
155
|
-
### getInstance()
|
|
156
|
-
|
|
157
|
-
> **getInstance**\<`T`\>(`nameOrType`): `T` \| `undefined`
|
|
158
|
-
|
|
159
|
-
Defined in: [src/ObjectFactory.ts:282](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L282)
|
|
160
|
-
|
|
161
|
-
Returns the object instance with the given unique name. Unique names take the form `<ClassName>:<InstanceName>`.
|
|
162
|
-
It is possible to only specifiy the `<ClassName>`, doing so will automatically look for the `<ClassName>:default`
|
|
163
|
-
instance or the first found instance of the given type.
|
|
164
|
-
|
|
165
|
-
#### Type Parameters
|
|
166
|
-
|
|
167
|
-
##### T
|
|
168
|
-
|
|
169
|
-
`T`
|
|
170
|
-
|
|
171
|
-
#### Parameters
|
|
172
|
-
|
|
173
|
-
##### nameOrType
|
|
174
|
-
|
|
175
|
-
`any`
|
|
176
|
-
|
|
177
|
-
The unique name or class type of the object to retrieve.
|
|
178
|
-
|
|
179
|
-
#### Returns
|
|
180
|
-
|
|
181
|
-
`T` \| `undefined`
|
|
182
|
-
|
|
183
|
-
The object instance associated with the given name if found, otherwise `undefined`.
|
|
184
|
-
|
|
185
|
-
***
|
|
186
|
-
|
|
187
|
-
### initialize()
|
|
188
|
-
|
|
189
|
-
> **initialize**\<`T`\>(`obj`): `T` \| `Promise`\<`T`\>
|
|
190
|
-
|
|
191
|
-
Defined in: [src/ObjectFactory.ts:175](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L175)
|
|
192
|
-
|
|
193
|
-
Scans the given object for any properties with the `@Inject` decorator and assigns the correct values.
|
|
194
|
-
|
|
195
|
-
#### Type Parameters
|
|
196
|
-
|
|
197
|
-
##### T
|
|
198
|
-
|
|
199
|
-
`T`
|
|
200
|
-
|
|
201
|
-
#### Parameters
|
|
202
|
-
|
|
203
|
-
##### obj
|
|
204
|
-
|
|
205
|
-
`any`
|
|
206
|
-
|
|
207
|
-
The object to initialize with injected defaults
|
|
208
|
-
|
|
209
|
-
#### Returns
|
|
210
|
-
|
|
211
|
-
`T` \| `Promise`\<`T`\>
|
|
212
|
-
|
|
213
|
-
***
|
|
214
|
-
|
|
215
|
-
### newInstance()
|
|
216
|
-
|
|
217
|
-
> **newInstance**\<`T`\>(`type`, `options?`): `T` \| `Promise`\<`T`\>
|
|
218
|
-
|
|
219
|
-
Defined in: [src/ObjectFactory.ts:323](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L323)
|
|
220
|
-
|
|
221
|
-
Creates a new instance of the class specified with the provided unique name or type and constructor arguments. If an existing
|
|
222
|
-
object has already been created with the given name, that instance is returned, otherwise a new instance is created
|
|
223
|
-
using the provided arguments.
|
|
224
|
-
|
|
225
|
-
#### Type Parameters
|
|
226
|
-
|
|
227
|
-
##### T
|
|
228
|
-
|
|
229
|
-
`T`
|
|
230
|
-
|
|
231
|
-
#### Parameters
|
|
232
|
-
|
|
233
|
-
##### type
|
|
234
|
-
|
|
235
|
-
`any`
|
|
236
|
-
|
|
237
|
-
The fully qualified name or type of the class to instantiate. If a type is given it's class name will be inferred
|
|
238
|
-
via the constructor name.
|
|
239
|
-
|
|
240
|
-
##### options?
|
|
241
|
-
|
|
242
|
-
[`InstanceOptions`](../interfaces/InstanceOptions.md)
|
|
243
|
-
|
|
244
|
-
The options to use when instantiating the new class object.
|
|
245
|
-
|
|
246
|
-
#### Returns
|
|
247
|
-
|
|
248
|
-
`T` \| `Promise`\<`T`\>
|
|
249
|
-
|
|
250
|
-
***
|
|
251
|
-
|
|
252
|
-
### register()
|
|
253
|
-
|
|
254
|
-
> **register**(`clazz`, `fqn?`): `void`
|
|
255
|
-
|
|
256
|
-
Defined in: [src/ObjectFactory.ts:399](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectFactory.ts#L399)
|
|
257
|
-
|
|
258
|
-
Registers the given class type for the provided fully qualified name.
|
|
259
|
-
|
|
260
|
-
#### Parameters
|
|
261
|
-
|
|
262
|
-
##### clazz
|
|
263
|
-
|
|
264
|
-
`any`
|
|
265
|
-
|
|
266
|
-
The class type to register.
|
|
267
|
-
|
|
268
|
-
##### fqn?
|
|
269
|
-
|
|
270
|
-
`string`
|
|
271
|
-
|
|
272
|
-
The fully qualified name of the class to register. If not specified, the class name will be used.
|
|
273
|
-
|
|
274
|
-
#### Returns
|
|
275
|
-
|
|
276
|
-
`void`
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../globals.md) / ObjectUtils
|
|
6
|
-
|
|
7
|
-
# Class: ObjectUtils
|
|
8
|
-
|
|
9
|
-
Defined in: [src/ObjectUtils.ts:12](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectUtils.ts#L12)
|
|
10
|
-
|
|
11
|
-
Utility class for working with objects.
|
|
12
|
-
|
|
13
|
-
## Author
|
|
14
|
-
|
|
15
|
-
Jean-Philippe Steinmetz
|
|
16
|
-
|
|
17
|
-
## Constructors
|
|
18
|
-
|
|
19
|
-
### Constructor
|
|
20
|
-
|
|
21
|
-
> **new ObjectUtils**(): `ObjectUtils`
|
|
22
|
-
|
|
23
|
-
#### Returns
|
|
24
|
-
|
|
25
|
-
`ObjectUtils`
|
|
26
|
-
|
|
27
|
-
## Methods
|
|
28
|
-
|
|
29
|
-
### validate()
|
|
30
|
-
|
|
31
|
-
> `static` **validate**(`obj`, `clazz?`, `recurse?`): `void`
|
|
32
|
-
|
|
33
|
-
Defined in: [src/ObjectUtils.ts:21](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ObjectUtils.ts#L21)
|
|
34
|
-
|
|
35
|
-
Performs validation of the given object or array. Validation is performed by scanning the object class for properties
|
|
36
|
-
decorated with `@Validator` and executing the provided validation function.
|
|
37
|
-
|
|
38
|
-
#### Parameters
|
|
39
|
-
|
|
40
|
-
##### obj
|
|
41
|
-
|
|
42
|
-
`any`
|
|
43
|
-
|
|
44
|
-
The object or array of objects to validate.
|
|
45
|
-
|
|
46
|
-
##### clazz?
|
|
47
|
-
|
|
48
|
-
`any`
|
|
49
|
-
|
|
50
|
-
The class type that contains the validation metadata.
|
|
51
|
-
|
|
52
|
-
##### recurse?
|
|
53
|
-
|
|
54
|
-
`boolean`
|
|
55
|
-
|
|
56
|
-
Set to `true` to validate all child objects.
|
|
57
|
-
|
|
58
|
-
#### Returns
|
|
59
|
-
|
|
60
|
-
`void`
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../globals.md) / StringUtils
|
|
6
|
-
|
|
7
|
-
# Class: StringUtils
|
|
8
|
-
|
|
9
|
-
Defined in: [src/StringUtils.ts:10](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/StringUtils.ts#L10)
|
|
10
|
-
|
|
11
|
-
Utility functions for working with strings.
|
|
12
|
-
|
|
13
|
-
## Author
|
|
14
|
-
|
|
15
|
-
Jean-Philippe Steinmetz
|
|
16
|
-
|
|
17
|
-
## Constructors
|
|
18
|
-
|
|
19
|
-
### Constructor
|
|
20
|
-
|
|
21
|
-
> **new StringUtils**(): `StringUtils`
|
|
22
|
-
|
|
23
|
-
#### Returns
|
|
24
|
-
|
|
25
|
-
`StringUtils`
|
|
26
|
-
|
|
27
|
-
## Methods
|
|
28
|
-
|
|
29
|
-
### findAndReplace()
|
|
30
|
-
|
|
31
|
-
> `static` **findAndReplace**(`contents`, `variables`): `string`
|
|
32
|
-
|
|
33
|
-
Defined in: [src/StringUtils.ts:46](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/StringUtils.ts#L46)
|
|
34
|
-
|
|
35
|
-
Performs a search and replace on the provided contents with the map of variable replacements. The contents
|
|
36
|
-
must use Mustache formatted tokens such as `{{toreplace}}`.
|
|
37
|
-
|
|
38
|
-
#### Parameters
|
|
39
|
-
|
|
40
|
-
##### contents
|
|
41
|
-
|
|
42
|
-
`string`
|
|
43
|
-
|
|
44
|
-
The stringt to perform the find and replace on.
|
|
45
|
-
|
|
46
|
-
##### variables
|
|
47
|
-
|
|
48
|
-
`any`
|
|
49
|
-
|
|
50
|
-
A map of key=>value pairs to search for and replace.
|
|
51
|
-
|
|
52
|
-
#### Returns
|
|
53
|
-
|
|
54
|
-
`string`
|
|
55
|
-
|
|
56
|
-
***
|
|
57
|
-
|
|
58
|
-
### getParameters()
|
|
59
|
-
|
|
60
|
-
> `static` **getParameters**(`str`): `string`[]
|
|
61
|
-
|
|
62
|
-
Defined in: [src/StringUtils.ts:18](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/StringUtils.ts#L18)
|
|
63
|
-
|
|
64
|
-
Returns a list of all parameters contained within the string. A parameter is a bracket delimited substring
|
|
65
|
-
(e.g. /my/{key}/with/{id}).
|
|
66
|
-
|
|
67
|
-
#### Parameters
|
|
68
|
-
|
|
69
|
-
##### str
|
|
70
|
-
|
|
71
|
-
`string`
|
|
72
|
-
|
|
73
|
-
The string to search for parameters.
|
|
74
|
-
|
|
75
|
-
#### Returns
|
|
76
|
-
|
|
77
|
-
`string`[]
|
|
78
|
-
|
|
79
|
-
A list of parameters contained in the provided string.
|
|
80
|
-
|
|
81
|
-
***
|
|
82
|
-
|
|
83
|
-
### replaceAll()
|
|
84
|
-
|
|
85
|
-
> `static` **replaceAll**(`str`, `match`, `prefix`): `string`
|
|
86
|
-
|
|
87
|
-
Defined in: [src/StringUtils.ts:87](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/StringUtils.ts#L87)
|
|
88
|
-
|
|
89
|
-
Replaces all instances of the match regex pattern with the contents of the inner regular expression pattern for
|
|
90
|
-
the given string.
|
|
91
|
-
|
|
92
|
-
e.g.
|
|
93
|
-
|
|
94
|
-
let result = replaceAll('/my/path/{id}', new RegExp('\{([^\}]+)\}'), ':');
|
|
95
|
-
console.log(result); // -> /my/path/:id
|
|
96
|
-
|
|
97
|
-
#### Parameters
|
|
98
|
-
|
|
99
|
-
##### str
|
|
100
|
-
|
|
101
|
-
`string`
|
|
102
|
-
|
|
103
|
-
The string to perform replacement on.
|
|
104
|
-
|
|
105
|
-
##### match
|
|
106
|
-
|
|
107
|
-
`string` \| `RegExp`
|
|
108
|
-
|
|
109
|
-
The regular expression pattern to match containing an outer and inner pattern.
|
|
110
|
-
|
|
111
|
-
##### prefix
|
|
112
|
-
|
|
113
|
-
`string`
|
|
114
|
-
|
|
115
|
-
The prefix to prepend the replacement text with.
|
|
116
|
-
|
|
117
|
-
#### Returns
|
|
118
|
-
|
|
119
|
-
`string`
|
|
120
|
-
|
|
121
|
-
The fully replaced contents of the string.
|
|
122
|
-
|
|
123
|
-
***
|
|
124
|
-
|
|
125
|
-
### toCamelCase()
|
|
126
|
-
|
|
127
|
-
> `static` **toCamelCase**(`str`): `string`
|
|
128
|
-
|
|
129
|
-
Defined in: [src/StringUtils.ts:104](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/StringUtils.ts#L104)
|
|
130
|
-
|
|
131
|
-
Converts the first character in the given string to be lowercase (e.g. myVariable).
|
|
132
|
-
|
|
133
|
-
#### Parameters
|
|
134
|
-
|
|
135
|
-
##### str
|
|
136
|
-
|
|
137
|
-
`string`
|
|
138
|
-
|
|
139
|
-
The string to convert to camelCase.
|
|
140
|
-
|
|
141
|
-
#### Returns
|
|
142
|
-
|
|
143
|
-
`string`
|
|
144
|
-
|
|
145
|
-
The string converted to camelCase.
|
|
146
|
-
|
|
147
|
-
***
|
|
148
|
-
|
|
149
|
-
### toPascalCase()
|
|
150
|
-
|
|
151
|
-
> `static` **toPascalCase**(`str`): `string`
|
|
152
|
-
|
|
153
|
-
Defined in: [src/StringUtils.ts:114](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/StringUtils.ts#L114)
|
|
154
|
-
|
|
155
|
-
Converts the first character in the given string to be uppercase (e.g. MyVariable).
|
|
156
|
-
|
|
157
|
-
#### Parameters
|
|
158
|
-
|
|
159
|
-
##### str
|
|
160
|
-
|
|
161
|
-
`string`
|
|
162
|
-
|
|
163
|
-
The string to convert to PascalCase.
|
|
164
|
-
|
|
165
|
-
#### Returns
|
|
166
|
-
|
|
167
|
-
`string`
|
|
168
|
-
|
|
169
|
-
The string converted to PascalCase.
|