Skip to content

Commit 822da22

Browse files
committed
moved declarations in seperate files; renaming
1 parent 733583c commit 822da22

File tree

8 files changed

+60
-60
lines changed

8 files changed

+60
-60
lines changed

dist/index.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
var StringBuilder = (function () {
4-
function StringBuilder(value) {
5-
if (value === void 0) { value = String.Empty; }
6-
this.Values = [];
7-
this.Values = new Array(value);
8-
}
9-
StringBuilder.prototype.ToString = function () {
10-
return this.Values.join('');
11-
};
12-
StringBuilder.prototype.Append = function (value) {
13-
this.Values.push(value);
14-
};
15-
StringBuilder.prototype.AppendFormat = function (format) {
16-
var args = [];
17-
for (var _i = 1; _i < arguments.length; _i++) {
18-
args[_i - 1] = arguments[_i];
19-
}
20-
this.Values.push(String.Format.apply(String, [format].concat(args)));
21-
};
22-
StringBuilder.prototype.Clear = function () {
23-
this.Values = [];
24-
};
25-
return StringBuilder;
26-
}());
27-
exports.StringBuilder = StringBuilder;
283
var String = (function () {
294
function String() {
305
}
@@ -210,3 +185,28 @@ var String = (function () {
210185
return String;
211186
}());
212187
exports.String = String;
188+
var StringBuilder = (function () {
189+
function StringBuilder(value) {
190+
if (value === void 0) { value = String.Empty; }
191+
this.Values = [];
192+
this.Values = new Array(value);
193+
}
194+
StringBuilder.prototype.ToString = function () {
195+
return this.Values.join('');
196+
};
197+
StringBuilder.prototype.Append = function (value) {
198+
this.Values.push(value);
199+
};
200+
StringBuilder.prototype.AppendFormat = function (format) {
201+
var args = [];
202+
for (var _i = 1; _i < arguments.length; _i++) {
203+
args[_i - 1] = arguments[_i];
204+
}
205+
this.Values.push(String.Format.apply(String, [format].concat(args)));
206+
};
207+
StringBuilder.prototype.Clear = function () {
208+
this.Values = [];
209+
};
210+
return StringBuilder;
211+
}());
212+
exports.StringBuilder = StringBuilder;

dist/index.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
export class StringBuilder {
2-
public Values: string[] = [];
3-
4-
constructor(value: string = String.Empty) {
5-
this.Values = new Array(value);
6-
}
7-
public ToString() {
8-
return this.Values.join('');
9-
}
10-
public Append(value: string) {
11-
this.Values.push(value);
12-
}
13-
public AppendFormat(format: string, ...args: any[]) {
14-
this.Values.push(String.Format(format, ...args));
15-
}
16-
public Clear() {
17-
this.Values = [];
18-
}
19-
}
20-
21-
221
export class String {
232
public static Empty: string = "";
243

@@ -216,4 +195,24 @@ export class String {
216195
}
217196
return temp;
218197
}
198+
}
199+
200+
export class StringBuilder {
201+
public Values: string[] = [];
202+
203+
constructor(value: string = String.Empty) {
204+
this.Values = new Array(value);
205+
}
206+
public ToString() {
207+
return this.Values.join('');
208+
}
209+
public Append(value: string) {
210+
this.Values.push(value);
211+
}
212+
public AppendFormat(format: string, ...args: any[]) {
213+
this.Values.push(String.Format(format, ...args));
214+
}
215+
public Clear() {
216+
this.Values = [];
217+
}
219218
}

dist/index.d.ts renamed to dist/string.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
export declare class StringBuilder {
2-
Values: string[];
3-
constructor(value?: string);
4-
ToString(): string;
5-
Append(value: string): void;
6-
AppendFormat(value: string, ...args: string[]): void;
7-
Clear(): void;
8-
}
91
export declare class String {
102
static Empty: string;
113
static IsNullOrWhiteSpace(value: string): boolean;

dist/stringbuilder.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export declare class StringBuilder {
2+
Values: string[];
3+
constructor(value?: string);
4+
ToString(): string;
5+
Append(value: string): void;
6+
AppendFormat(value: string, ...args: string[]): void;
7+
Clear(): void;
8+
}

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gulp.task("default", function() {
1212
.js.pipe(gulp.dest("dist"));
1313
});
1414

15-
gulp.task("rename", function(cb) {
15+
gulp.task("rename", function() {
1616
return gulp
1717
.src("dist/index.js")
1818
.pipe(rename("index.min.js"))

index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
import { String, StringBuilder } from "./dist/index";
2-
export { String, StringBuilder }
1+
import { String } from "./dist/string";
2+
import { StringBuilder } from "./dist/stringbuilder";
3+
export { String, StringBuilder };

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "typescript-string-operations",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Simple lightweight string operation library for Typescript, works with Angular",
5-
"main": "dist/index.min.js",
5+
"main": "dist/index.min.js",
66
"scripts": {
77
"test": "mocha -r ts-node/register tests/**/tests.ts",
88
"build": "gulp default && gulp compress"

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"noImplicitAny": true,
77
"removeComments": true,
88
"target": "es5",
9-
"module": "commonjs"
9+
"module": "commonjs"
1010
}
1111
}

0 commit comments

Comments
 (0)