Skip to content

Commit

Permalink
chore: format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sonirico committed Jan 30, 2021
1 parent 8484c45 commit 5eefd1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"clean": "rm -rf ./models ./utils ./lexer ./parser ./ast ./exceptions ./token",
"build": "npm run clean && tsc",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "tslint -p tsconfig.json",
"postversion": "git push && git push --tags",
"prepare": "npm run build",
Expand Down
4 changes: 2 additions & 2 deletions src/ast/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class SnapExpression implements Expression {
export namespace AmountModifiers {
const values: string[] = ['s', 'm', 'h', 'd', 'w', 'M'];

export const valuesString = `(${values.map(v => `"${v}"`).join(',')})`;
export const valuesString = `(${values.map((v) => `"${v}"`).join(',')})`;

export function checkModifier(modifier: string) {
return values.includes(modifier);
Expand All @@ -202,7 +202,7 @@ export namespace AmountModifiers {
export namespace SnapModifiers {
const values: string[] = ['s', 'm', 'h', 'd', 'w', 'bw', 'M', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];

export const valuesString = `(${values.map(v => `"${v}"`).join(',')})`;
export const valuesString = `(${values.map((v) => `"${v}"`).join(',')})`;

export function checkModifier(modifier: string) {
return values.includes(modifier);
Expand Down
8 changes: 4 additions & 4 deletions src/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export class Token {
}

get isSnapped(): boolean {
return this.expressionNodes.some(node => node instanceof SnapExpression);
return this.expressionNodes.some((node) => node instanceof SnapExpression);
}

get isModified(): boolean {
return this.expressionNodes.some(node => node instanceof ModifierExpression);
return this.expressionNodes.some((node) => node instanceof ModifierExpression);
}

public static fromString(value: string, at?: Date): Token {
Expand Down Expand Up @@ -51,10 +51,10 @@ export class Token {
}

public toString(): string {
return this.expressionNodes.map(n => n.toString()).join('');
return this.expressionNodes.map((n) => n.toString()).join('');
}

public toJSON(): object[] {
return this.nodes.map(node => node.toJSON());
return this.nodes.map((node) => node.toJSON());
}
}

0 comments on commit 5eefd1c

Please sign in to comment.