This file contains 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
type ParamValue = string | number | boolean; | |
export interface ParamsObject { | |
[key: string]: ParamValue | ParamValue[]; | |
} | |
export class RouterWrapper { | |
private _location: Location; | |
private _URL: typeof URL; |
This file contains 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 jsyaml from 'js-yaml'; | |
import * as path from 'path'; | |
import * as fs from 'fs'; | |
interface PropertyStructure { | |
required: string[]; | |
properties: Record<string, { type: string }>; | |
} | |
class Definition { |
This file contains 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
const fs = require('fs'); | |
const path = require('path'); | |
const root = path.resolve(); | |
// Create jest.config.js | |
const jestConfigJS = `module.exports = { | |
preset: 'jest-preset-angular', | |
roots: ['src'], | |
testRegex: '\\\\.spec\\\\.ts$', |
This file contains 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 { WindowWrapper } from './WindowWrapper'; | |
let _namespace: Namespace | undefined; | |
export class Namespace { | |
private readonly key: string; | |
static fromName(key: string): Namespace { | |
if (!_namespace) { | |
_namespace = new Namespace(key); |
This file contains 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 fs from 'fs-extra' | |
import * as nodeID3 from 'node-id3' | |
import * as path from 'path' | |
const TARGET = 'au_kaiwa_1705_A' | |
const filePaths = fs.readdirSync(TARGET) | |
.map((file) => path.join(process.cwd(), TARGET, file)) | |
.filter((filePath) => fs.existsSync(filePath)) |
This file contains 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
require('setimmediate') | |
const asap = require('asap') as (func: Function) => void | |
const cloneDeep = require('lodash.clonedeep') as <T>(obj: T) => T | |
import { createStore, applyMiddleware, Store } from 'redux' | |
import { Observable } from 'rxjs/Observable' | |
import { Subject } from 'rxjs/Subject' | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject' | |
import 'rxjs/add/observable/of' | |
import 'rxjs/add/observable/from' |
This file contains 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 'core-js'; | |
import { Observable, Subject, BehaviorSubject } from 'rxjs'; | |
type Action = { | |
key: string; | |
value: any; | |
} | |
type State = { |
This file contains 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 'babel-polyfill'; | |
import 'zone.js/dist/zone-node'; | |
declare const Zone: any; | |
Zone.current.fork({}).run(async () => { | |
// (async () => { | |
const obj = { | |
increment: Promise.resolve({ |
This file contains 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 chokidar from 'chokidar'; // @types/chokidar | |
import parse from 'csv-parse'; // @types/csv-parse | |
import fs from 'fs'; // @types/node | |
chokidar.watch('S:/chokidar', { ignored: /[\/\\]\./ }).on('all', (event: string, path: string) => { | |
if (event === 'add' || event === 'change') { | |
if (new RegExp(/\.(csv|txt)$/).test(path)) { | |
console.log(event, path); | |
fs.readFile(path, 'utf8', (err, data: string) => { |
This file contains 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
const Hapi = require('hapi'); | |
const Inert = require('inert'); | |
const Vision = require('vision'); | |
const Joi = require('joi'); | |
const HapiSwagger = require('hapi-swagger'); | |
const Pack = require('./package.json'); | |
const server = new Hapi.Server(); | |
server.connection({ | |
host: 'localhost', |
NewerOlder