Skip to content

Commit 62410dc

Browse files
author
Sven Ulrich
committed
updatedeps: rename StringBuilder methods
1 parent 51f17d1 commit 62410dc

File tree

7 files changed

+43
-16
lines changed

7 files changed

+43
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- feature: added `AppendLine` and `AppendLineFormat`
99
- feature: added hexadecimal conversion specifier
1010
- bugfix: `StringBuilder` initialization without parameter adds empty string to internal Values Array.
11-
- bugfix: When there is no placeholder in the template passed to String.Format it should return the original template
11+
- bugfix: When there is no placeholder in the template passed to String.format it should return the original template
1212

1313
#### 1.5.0
1414
- Using latest typescript version, please check if your environment still works with this version before upgrading!

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var builder = new StringBuilder("My favorite fruits are: ");
126126
builder.Append("Apples, ");
127127
builder.Append("Bananas ");
128128

129-
// using String.Format() internally
129+
// using String.format() internally
130130
builder.AppendFormat("and especially {0:U}!", favoriteFruit);
131131
builder.AppendFormat(" I eat {0} every day!", 10);
132132

index.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ export class $String {
270270
}
271271
}
272272

273-
274273
export class String extends $String { }
275274

276275
export class StringBuilder {
@@ -284,27 +283,52 @@ export class StringBuilder {
284283
}
285284
}
286285

287-
public ToString() {
286+
public toString() {
288287
return this.Values.join($String.empty);
289288
}
290289

291-
public Append(value: string) {
290+
public ToString() {
291+
return this.toString();
292+
}
293+
294+
public append(value: string) {
292295
this.Values.push(value);
293296
}
294297

295-
public AppendLine(value: string) {
298+
public Append(value: string) {
299+
this.append(value);
300+
}
301+
302+
public appendLine(value: string) {
296303
this.Values.push(EOL + value);
297304
}
298305

299-
public AppendFormat(format: string, ...args: any[]) {
306+
public AppendLine(value: string) {
307+
this.appendLine(value);
308+
}
309+
310+
public appendFormat(format: string, ...args: any[]) {
300311
this.Values.push($String.format(format, ...args));
301312
}
302313

303-
public AppendLineFormat(format: string, ...args: any[]) {
314+
public AppendFormat(format: string, ...args: any[]) {
315+
this.appendFormat(format, ...args);
316+
}
317+
318+
public appendLineFormat(format: string, ...args: any[]) {
304319
this.Values.push(EOL + $String.format(format, ...args));
305320
}
306321

307-
public Clear() {
322+
public AppendLineFormat(format: string, ...args: any[]) {
323+
return this.appendLineFormat(format, ...args);
324+
}
325+
326+
public clear() {
308327
this.Values = [];
309328
}
329+
330+
public Clear() {
331+
this.clear();
332+
}
333+
310334
}

string.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export declare class $String {
32
static empty: string;
43
static isNullOrWhiteSpace(value: string | null | undefined): boolean;
@@ -24,4 +23,3 @@ export declare class String extends $String {
2423
*/
2524
static Format(format: string, ...args: any[]): string;
2625
}
27-

tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"scripts": {
44
},
55
"devDependencies": {
6-
"typescript-string-operations": "^1.5.0-beta"
6+
"typescript-string-operations": "^1.5.0-rc.6"
77
}
88
}

tests/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# yarn lockfile v1
33

44

5-
typescript-string-operations@^1.5.0-beta:
6-
version "1.5.0-beta.4"
7-
resolved "https://registry.yarnpkg.com/typescript-string-operations/-/typescript-string-operations-1.5.0-beta.4.tgz#09e9910d7846a1e33caaa53cad150c2c0eb7b846"
8-
integrity sha512-bUeUdJ6P+evjV5a9PzOhRCpfObvEmTAWWHoo7KJYtQ4ED0rdLcLV/+70+o4USYTmvwPPhXKpNkTQ6eByhv8NDA==
5+
typescript-string-operations@^1.5.0-rc.6:
6+
version "1.5.0-rc.6"
7+
resolved "https://registry.yarnpkg.com/typescript-string-operations/-/typescript-string-operations-1.5.0-rc.6.tgz#61518adab7568ca2671c6298feb55b0ce19bc23c"
8+
integrity sha512-JhIX/pTTA9kEIS6Hd6hBdneJNNdL8wSzN9ierO5fK8aGQleEempdOXJ0atEnu5GazbImSh/kaghCRBX/BXQlww==

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,11 @@ type-fest@^0.20.2:
12421242
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
12431243
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
12441244

1245+
typescript-string-operations@1.5.0-rc.3:
1246+
version "1.5.0-rc.3"
1247+
resolved "https://registry.yarnpkg.com/typescript-string-operations/-/typescript-string-operations-1.5.0-rc.3.tgz#8d0e9c867d5cc9a9b27866eb50ca39b08e8bb7f6"
1248+
integrity sha512-Ta80Fw1nkOXVSYgFXhfHH43WFwQfS0R+cSpabGZyzRP0CSVd10GJMYIt7k/P3giJlMy9NBwbWeSjWmWQGcFmjQ==
1249+
12451250
typescript@^4.7.4:
12461251
version "4.7.4"
12471252
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"

0 commit comments

Comments
 (0)