This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
import { parsePhoneNumber, CountryCode } from 'libphonenumber-js/min'; | |
@Pipe({ | |
name: 'phone' | |
}) | |
export class PhonePipe implements PipeTransform { | |
transform(phoneValue: number | string, country: string): any { | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> | |
{{ user.getParsedPhone() | phone:'US' }} | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Request, Response } from 'express'; | |
let pkg = require(__dirname + '/../../package.json'); | |
export let index = (req: Request, res: Response) => { | |
res.json({ | |
message: 'Welcome to API sekeleton.', | |
version: pkg.version, | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as express from 'express'; | |
import * as dotenv from 'dotenv'; | |
import * as bodyParser from 'body-parser'; | |
import * as homeController from './controllers/home.controller'; | |
dotenv.config(); | |
const app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var nodeModules = {}; | |
fs.readdirSync('node_modules') | |
.filter(function(x) { | |
return ['.bin'].indexOf(x) === -1; | |
}) | |
.forEach(function(mod) { | |
nodeModules[mod] = 'commonjs ' + mod; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"files": [ | |
"server/server.ts" | |
], | |
"include": [ | |
"server/**/*.ts" | |
], | |
"compilerOptions": { | |
"module": "commonjs", | |
"noImplicitAny": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"jest": { | |
"globals": { | |
"ts-jest": { | |
"tsConfigFile": "tsconfig.json" | |
} | |
}, | |
"moduleFileExtensions": [ | |
"ts", | |
"js", | |
"json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as request from 'supertest'; | |
import {} from 'jest'; | |
import { expect, should } from 'chai'; | |
import * as app from '../server/server'; | |
describe('GET /', () => { | |
it('should return 200 OK', () => { | |
return request(app) | |
.get('/') | |
.expect(200) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"mapCoverage": true, | |
"collectCoverage": true, | |
"collectCoverageFrom": [ | |
"**/*.{ts,jsx}", | |
"!**/node_modules/**", | |
"!**/vendor/**", | |
"!**/coverage/**", | |
"!**/webpack.config.js" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"test": "jest --forceExit", | |
"test-ci": "npm test && cat ./coverage/lcov.info | coveralls" |
OlderNewer