Deploy dolanmiu/docx to github.com/dolanmiu/docx.git:gh-pages

This commit is contained in:
Deployment Bot (from Travis CI)
2018-08-07 00:29:54 +00:00
parent f1585efab4
commit 811a251597
424 changed files with 5731 additions and 5686 deletions

View File

@ -12,6 +12,51 @@
* Follow the `TSLint` rules
## Add vs Create
This is just a guideline, and the rules can sometimes be broken.
* Use `create` if the method `new`'s up an element inside:
```js
public createParagraph() {
const paragraph = new Paragraph();
this.root.push(paragraph);
}
```
* Use `add` if you add the element into the method as a parameter:
```js
public createParagraph(paragraph: Paragraph) {
this.root.push(paragraph);
}
```
## Getters and Setters
Getters and Setters are done with a capital letter like so:
```js
public get Level() {
}
```
There is no performance advantage by doing this. It means we don't need to prefix all private variables with the ugly `_`:
**Do not:**
```js
private get _level: string;
```
**Do**
```js
private get level: string;
```
## Testing
Please write a test of every file you make and suffix it with `.spec.ts`.