type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
FunctionDeclaration
function testRelationshipFilter(body: any, relationship: string, relationshipID: number) { body['data'].forEach((r: any) => { const relationshipData = r['relationships'][relationship].data; expect(relationshipData['id']).to.be.equal(relationshipID); }); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
FunctionDeclaration
function singleTests(prefix: string, modelType: string) { describe('GET', () => { it(`a ${modelType} object`, async () => { const res = await chai.request(server).get(`${prefix}`); basicSingleModel(res, modelType); }); }); if (models[modelType].include) { describe('GET (i...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
FunctionDeclaration
function basicCreate(res: any, ofModel: string) { expect(res).to.be.json; expect(res).to.have.status(201); hasJSONAPIDocumentForm(res.body); expect(res.body['data']).to.be.an('object'); expect(res.body['data']['type']).to.be.equal(ofModel); isFullModel(models[ofModel], res.body['data']); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(modelName) => { server.use(`/${modelName}`, createModelRouter(modelName, mockHandler, '/')); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(val: string) => Date.parse(val)
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(val: string) => Number(val)
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(d: any) => { expect(d['type']).to.be.equal(ofModel); isFullModel(models[ofModel], d, attrFields, relFields); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(sum: any, m: any) => { const relationData = m['relationships'][include]['data']; if (Array.isArray(relationData)) { relationData.forEach((r: any) => { sum[r.id] = true; }); } else { sum[relationData.id] = true; } return sum; }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(r: any) => { sum[r.id] = true; }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(sum: any, m: any) => { sum[m.id] = sum[m.id] || 0; sum[m.id] += 1; return sum; }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(key) => { expect(lookup[key]).to.be.equal(1); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(r: any) => { attrs.forEach((a, i) => { expect(r['attributes'][a]).to.be.equal(values[i]); }); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(a, i) => { expect(r['attributes'][a]).to.be.equal(values[i]); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(r: any) => { const relationshipData = r['relationships'][relationship].data; expect(relationshipData['id']).to.be.equal(relationshipID); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { it(`List of ${modelType} objects`, async () => { const res = await chai.request(server).get(`${prefix}`); basicModelList(res, modelType); expect(res.body['data'][0].id).to.be.equal(allModels[0].id); expect(res.body['meta']['page']['total']) .to.be.equal(allMode...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get(`${prefix}`); basicModelList(res, modelType); expect(res.body['data'][0].id).to.be.equal(allModels[0].id); expect(res.body['meta']['page']['total']) .to.be.equal(allModels.length); expect(res.body['included'])....
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { it(`the first paged list of ${modelType} objects`, async () => { const PER_PAGE = 3; const res = await chai.request(server).get(`${prefix}?page[limit]=${PER_PAGE}`); basicModelList(res, modelType); expect(res.body['included']).to.be.empty; expect(res.body['meta'][...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const PER_PAGE = 3; const res = await chai.request(server).get(`${prefix}?page[limit]=${PER_PAGE}`); basicModelList(res, modelType); expect(res.body['included']).to.be.empty; expect(res.body['meta']['page']['total']) .to.be.equal(allModels.length); ...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const PER_PAGE = 1; const res = await chai.request(server).get( `${prefix}?page[limit]=${PER_PAGE}&page[offset]=${PER_PAGE}`, ); basicModelList(res, modelType); expect(res.body['included']).to.be.empty; expect(res.body['meta']['page']['total']) ...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const PER_PAGE = 5; const OFFSET = allModels.length; const res = await chai.request(server).get( `${prefix}?page[limit]=${PER_PAGE}&page[offset]=${OFFSET}`, ); basicModelList(res, modelType); expect(res.body['meta']['page']['total']) ...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { const includeType = models[modelType].include[0]; it(`included ${includeType} of ${modelType} objects`, async () => { const res = await chai.request(server).get( `${prefix}?include=${includeType}`, ); basicModelList(res, modelType); expect(re...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get( `${prefix}?include=${includeType}`, ); basicModelList(res, modelType); expect(res.body['meta']['page']['total']) .to.be.equal(allModels.length); testIncludesOfType(res.body, includeTyp...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { it(`filtered ${modelType} objects by a single attribute`, async () => { const firstObj = models[modelType].spec; const firstAttr = Object.keys(omit(firstObj, ['id', 'type']))[0]; const firstValue = firstObj[firstAttr]; const res = await chai.request(server).get( ...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const firstObj = models[modelType].spec; const firstAttr = Object.keys(omit(firstObj, ['id', 'type']))[0]; const firstValue = firstObj[firstAttr]; const res = await chai.request(server).get( `${prefix}?filter[${firstAttr}]=${encodeURIComponent(firstValue)}`, ...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const firstAttr = modelKeys[0]; const firstValue = lastObj[firstAttr]; const secondAttr = modelKeys[2]; const secondValue = lastObj[secondAttr]; const res = await chai.request(server).get( `${prefix}?filter[${firstAttr}]=${encodeURIComponent(...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const firstObj = models[modelType].spec; const relationship = models[modelType].include[0]; const relationshipID = firstObj[relationship].id; const res = await chai.request(server).get( `${prefix}?filter[${relationship}]=${relationshipID}`, );...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { const allFields = Object.keys( omit(models[modelType].spec, ['id', 'type']), ).filter((f) => ( (typeof models[modelType].spec[f] === 'string') || (typeof models[modelType].spec[f] === 'number') )); const firstAttr = allFields[0]; const secondAttr = ...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
(f) => ( (typeof models[modelType].spec[f] === 'string') || (typeof models[modelType].spec[f] === 'number') )
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get(`${prefix}?sort=${firstAttr}`); basicModelList(res, modelType); // TODO: why is the normaliser necessary? const n = getNormaliser(firstAttr); expect(n(res.body.data[0].attributes[firstAttr])) .to.be.lte(n(res....
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get(`${prefix}?sort=-${firstAttr}`); basicModelList(res, modelType); const n = getNormaliser(firstAttr); expect(n(res.body.data[0].attributes[firstAttr])) .to.be.gte(n(res.body.data[1].attributes[firstAttr])); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get( `${prefix}?sort=${firstAttr},${secondAttr}`, ); basicModelList(res, modelType); const n = getNormaliser(firstAttr); expect(n(res.body.data[0].attributes[firstAttr])) .to.be.lte(n(res....
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get( `${prefix}?sort=-${firstAttr},-${secondAttr}`, ); basicModelList(res, modelType); const n = getNormaliser(firstAttr); expect(n(res.body.data[0].attributes[firstAttr])) .to.be.gte(n(re...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { it(`a ${modelType} object`, async () => { const res = await chai.request(server).get(`${prefix}`); basicSingleModel(res, modelType); }); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get(`${prefix}`); basicSingleModel(res, modelType); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
() => { const includeType = models[modelType].include[0]; it(`included ${includeType} of ${modelType} objects`, async () => { const res = await chai.request(server).get( `${prefix}?include=${includeType}`, ); basicSingleModel(res, modelType); testInc...
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
ArrowFunction
async () => { const res = await chai.request(server).get( `${prefix}?include=${includeType}`, ); basicSingleModel(res, modelType); testIncludesOfType(res.body, includeType); }
ryanardo/conversationai-moderator
packages/backend-api/src/test/integration/jsonapi/test_helper.ts
TypeScript
FunctionDeclaration
export declare function setTransactionParams(trxParams?: ITrxParamsArgument): ITrxParams;
equilibrium-eosdt/eosdt-js
dist/utils.d.ts
TypeScript
FunctionDeclaration
export declare function dateToEosDate(date: Date): string;
equilibrium-eosdt/eosdt-js
dist/utils.d.ts
TypeScript
FunctionDeclaration
export declare function amountToAssetString(amount: number | string, assetSymbol: string, customDecimals?: number): string;
equilibrium-eosdt/eosdt-js
dist/utils.d.ts
TypeScript
FunctionDeclaration
export declare function balanceToNumber(balance: string[]): number;
equilibrium-eosdt/eosdt-js
dist/utils.d.ts
TypeScript
FunctionDeclaration
export declare function validateExternalData(data: any, name: string, keys: string[], canBeUndefined?: boolean): any;
equilibrium-eosdt/eosdt-js
dist/utils.d.ts
TypeScript
ArrowFunction
(resolve, reject) => { fs.readdir(dirPath, (err, result) => { if (err) { reject(err); } resolve(result); }); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
ArrowFunction
(err, result) => { if (err) { reject(err); } resolve(result); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
ArrowFunction
(resolve, reject) => { fs.stat(filePath, (err, result) => { if (err) { reject(err); } resolve(result); }); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
ArrowFunction
(err, result) => { if (err) { reject(err); } resolve(result); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
ArrowFunction
(resolve) => { fsExtra.exists(filePath, resolve); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
ArrowFunction
(line) => { let match; if (match = /(\w+)=(.+)/.exec(line)) { manifestValues[match[1]] = match[2]; } }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
ClassDeclaration
class Util { public async readDir(dirPath: string) { return await new Promise<string[]>((resolve, reject) => { fs.readdir(dirPath, (err, result) => { if (err) { reject(err); } resolve(result); }); }); } public checkForTrailingSlash(di...
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
public async readDir(dirPath: string) { return await new Promise<string[]>((resolve, reject) => { fs.readdir(dirPath, (err, result) => { if (err) { reject(err); } resolve(result); }); }); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
public checkForTrailingSlash(dirPath: string) { return dirPath.substr(dirPath.length - 1) !== '/' ? dirPath + '/' : dirPath; }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
public async stat(filePath: string) { return await new Promise((resolve, reject) => { fs.stat(filePath, (err, result) => { if (err) { reject(err); } resolve(result); }); }); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
public async fixFilePathExtension(filePath: string) { const dirPath = path.join(filePath, '../'); const fileName = filePath.replace(dirPath, ''); // with extension, return directly if (fileName.indexOf('.') > 0) { return filePath; } // Traverse the director...
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
private async traverse(dirPath: string, fileName: string) { let dir = await this.readDir(dirPath); for (let ext of extensions) { if (dir.indexOf(fileName + ext) > -1) { return path.join(dirPath, fileName + ext); } } if (dir.indexOf(fileName) !== -...
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
/** * Determine if a file exists * @param filePath */ public fileExists(filePath: string) { return new Promise((resolve) => { fsExtra.exists(filePath, resolve); }); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
/** * Creates a delay in execution * @param ms time to delay in milliseconds */ public delay(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
/** * Remove a single trailing newline from a string (\n or \r\n) */ public removeTrailingNewline(value: string) { return value.replace(/(.*?)\r?\n$/, '$1'); }
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
/** * Reads the the manifest file and converts to a javascript object skipping empty lines and comments * @param path location of the manifest file */ public async convertManifestToObject(path: string): Promise<{ [key: string]: string } | undefined> { if (await this.fileExists(path) === false) { ...
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
MethodDeclaration
/** * With return the differences in two objects * @param obj1 base target * @param obj2 comparison target * @param exclude fields to exclude in the comparison */ public objectDiff(obj1: object, obj2: object, exclude?: string[]) { let r = {}; if (!exclude) { exclude = []; } ...
AlejandroJL/vscode-brightscript-language
src/util.ts
TypeScript
FunctionDeclaration
export default function deleteNullOrUndefined< TInput extends Record<string, unknown> >(input: TInput): WithoutNulls<TInput> { const result: any = {}; Object.entries(input).forEach(([key, value]) => { if (value != null) { result[key] = value; } }); return result; }
mjwbenton/billio
packages/graphql/src/shared/deleteNullOrUndefined.ts
TypeScript
ArrowFunction
([key, value]) => { if (value != null) { result[key] = value; } }
mjwbenton/billio
packages/graphql/src/shared/deleteNullOrUndefined.ts
TypeScript
TypeAliasDeclaration
type NullOrUndefinedKeysOf<T> = Exclude< { [Key in keyof T]: null extends T[Key] ? Key : undefined extends T[Key] ? Key : never; }[keyof T], undefined >;
mjwbenton/billio
packages/graphql/src/shared/deleteNullOrUndefined.ts
TypeScript
TypeAliasDeclaration
type NonNullableKeysOf<T> = keyof Omit<T, NullOrUndefinedKeysOf<T>>;
mjwbenton/billio
packages/graphql/src/shared/deleteNullOrUndefined.ts
TypeScript
TypeAliasDeclaration
type WithoutNulls<T extends Record<string, unknown>> = { [Key in NullOrUndefinedKeysOf<T>]?: Exclude<T[Key], null>; } & { [Key in NonNullableKeysOf<T>]: T[Key]; };
mjwbenton/billio
packages/graphql/src/shared/deleteNullOrUndefined.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-navigation', templateUrl: './navigation.component.html', styleUrls: ['./navigation.component.scss'] }) export class NavigationComponent implements OnInit { public navItems: NavigationItem[]; constructor(private router: Router) { this.navItems = [ { label: 'Dashboard', ...
qcoronia/clear-cms
src/clear-cms/src/app/core/navigation/navigation.component.ts
TypeScript
ArrowFunction
() => ( <main> <p>Sorry, page
jpbamberg1993/srpp
src/pages/404.tsx
TypeScript
ClassDeclaration
@Injectable() export class TeacherService { constructor(private prisma: PrismaService) {} async create(createTeacherDto: CreateTeacherDto) { try { createTeacherDto.id = uuid(); return await this.prisma.teacher.create({ data: { id: createTeacherDto.id, name: createTeache...
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
MethodDeclaration
async create(createTeacherDto: CreateTeacherDto) { try { createTeacherDto.id = uuid(); return await this.prisma.teacher.create({ data: { id: createTeacherDto.id, name: createTeacherDto.name, cpf: createTeacherDto.cpf, }, }); } catch (error) { ...
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
MethodDeclaration
async findAll() { try { return await this.prisma.teacher.findMany(); } catch (error) { throw new BadRequestException(); } }
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
MethodDeclaration
async findOne(id: string) { try { return await this.prisma.teacher.findFirst({ where: { id: id, }, }); } catch (error) { throw new BadRequestException(); } }
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
MethodDeclaration
async findByName(name: string) { try { return await this.prisma.teacher.findMany({ where: { name: name, }, }); } catch (error) { throw new BadRequestException(); } }
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
MethodDeclaration
async update(id: string, updateTeacherDto: UpdateTeacherDto) { try { return await this.prisma.teacher.update({ data: { name: updateTeacherDto.name, }, where: { id: id, }, }); } catch (error) { throw new BadRequestException(); } }
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
MethodDeclaration
async remove(id: string) { try { return await this.prisma.teacher.delete({ where: { id: id, }, }); } catch (error) { throw new BadRequestException(); } }
akaLuisinho/school-management
src/teacher/teacher.service.ts
TypeScript
ArrowFunction
() => this._startScreenListener.startGame()
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
ArrowFunction
() => this._startButton.alpha = 0.3
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
ArrowFunction
() => this._startButton.alpha = 0.6
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
ArrowFunction
() => this._startScreenGroup.destroy()
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
ClassDeclaration
export default class StartScreen { private _startScreenGroup: Phaser.Group private _titleText: Phaser.Text private _descriptionText: Phaser.Text private _spaceInstructions: Phaser.Text private _spaceClickSprite: Phaser.Sprite private _mouseClickInstructions: Phaser.Text private _mouseClickSprite: Phaser...
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
InterfaceDeclaration
export interface IStartScreenListener { startGame: () => void }
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
MethodDeclaration
public init() { this._titleText = new Phaser.Text(this._game, this._game.width * 0.5, this._game.height * 0.30, 'PLANET GRAVITY GAME', { font: '80px ' + Assets.GoogleWebFonts.LibreBarcode39ExtendedText }) this._titleText.anchor.set(0.5) this._titleText.addColor('#ffffff', 0) this._startScreenGroup.addC...
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
MethodDeclaration
public hide() { this._game.add.tween(this._startScreenGroup).to({ alpha: 0.0 }, 1000, 'Sine.easeInOut', true) setTimeout(() => this._startScreenGroup.destroy(), 1000) }
kantedal/planet_gravity_game
src/states/space/start-screen.ts
TypeScript
ArrowFunction
(event, result)=> { if (result) { console.log('database reset completed'); this.zone.run(()=> { this.projects = []; }); } else { console.log('database reset failed'); } }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
()=> { this.projects = []; }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
(event, data)=> { this.zone.run(() => { try { this.email = data[0].email; this.secret = data[0].secret; } catch(e) { console.log('secret not found'); } }); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
() => { try { this.email = data[0].email; this.secret = data[0].secret; } catch(e) { console.log('secret not found'); } }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
(event, message)=> { this.zone.run(() => { this.project = ''; this.projects.push(message); }); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
() => { this.project = ''; this.projects.push(message); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
(event, message)=> { this.zone.run(() => { this.projects = message; }); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ArrowFunction
() => { this.projects = message; }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { email: string; secret: string; project: string; projects: any; constructor(private router: Router, private zone: NgZone, private electronServ...
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
MethodDeclaration
ngOnDestroy(): void { this.electronService.ipcRenderer.removeAllListeners('projectListed'); this.electronService.ipcRenderer.removeAllListeners('projectCreated'); this.electronService.ipcRenderer.removeAllListeners('configurationLoaded'); this.electronService.ipcRenderer.removeAllListeners('credentialS...
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
MethodDeclaration
resetDatabase () :void { this.electronService.ipcRenderer.send('resetDatabase'); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
MethodDeclaration
onSubmit(myform: NgForm) :void { console.log(myform.value); this.electronService.ipcRenderer.send('saveCredentials', myform.value); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
MethodDeclaration
credentialSaved () :void { console.log('credential saved'); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
MethodDeclaration
createProject (myform: NgForm) :void { this.electronService.ipcRenderer.send('createProject', { name: myform.value.project }); }
kevanmoothien/einstein-app
src/app/home/home.component.ts
TypeScript
FunctionDeclaration
export function initializeDB(platform : sql.SQLitePlatform) { const filename = platform.getSqliteDB(); const key = platform.getSqliteKey(); const prefs = platform.getSharedPreferences(); prefs.set('sqlite-schema-version', currentVersion); const db = new sqlite3.Database(filename, sqlite3.OPEN_READ...
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
FunctionDeclaration
export function migrateDB(platform : sql.SQLitePlatform) { // cloud migrations are handled out of band const filename = platform.getSqliteDB(); const key = platform.getSqliteKey(); const prefs = platform.getSharedPreferences(); let version = prefs.get('sqlite-schema-version') as number|undefined; ...
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
(resolve, reject) => { db.on('error', (err) => { console.error('Failed to initialize DB schema', err); reject(err); }); db.serialize(() => { if (key) { console.log('Initializing key in Sqlite DB'); db.run(sql.makeKeyPragma(key)...
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
(err) => { console.error('Failed to initialize DB schema', err); reject(err); }
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
() => { if (key) { console.log('Initializing key in Sqlite DB'); db.run(sql.makeKeyPragma(key)); } db.run('PRAGMA journal_mode=WAL'); db.exec(DatabaseSchema); }
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript