type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
onClickChangePassword() { this.checkNationalCode(); if (this.userform.valid) { this.randomPass = (Math.floor(Math.random() * (999999 - 100000)) + 100000).toString(); this.userService.recoverpassword(this.userform.controls["NatioalCode"].value, this.randomPass, environment.appId).subscribe( ...
rroona/Ng-Prime-master
src/app/core/recover-password/recover-password.component.ts
TypeScript
MethodDeclaration
onClickGoToLogin() { this.router.navigate(['/main/dashboard']); }
rroona/Ng-Prime-master
src/app/core/recover-password/recover-password.component.ts
TypeScript
MethodDeclaration
showResponse(event) { this.isClickCapcha = true }
rroona/Ng-Prime-master
src/app/core/recover-password/recover-password.component.ts
TypeScript
ClassDeclaration
class TestController extends Controller { protected index(request: Request, params: NodeJS.Dict<string>) { return this.response("HELLO 2!"); } }
Wulfy-JS/Wulfy
src/test/controllers/test/test.ts
TypeScript
MethodDeclaration
protected index(request: Request, params: NodeJS.Dict<string>) { return this.response("HELLO 2!"); }
Wulfy-JS/Wulfy
src/test/controllers/test/test.ts
TypeScript
ArrowFunction
() => { let component: GraphContainerComponent; let fixture: ComponentFixture<GraphContainerComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [GraphContainerComponent] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponen...
PaulBoutes/client-visualizer
src/app/graph-container/graph-container.component.spec.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ declarations: [GraphContainerComponent] }) .compileComponents(); }
PaulBoutes/client-visualizer
src/app/graph-container/graph-container.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(GraphContainerComponent); component = fixture.componentInstance; fixture.detectChanges(); }
PaulBoutes/client-visualizer
src/app/graph-container/graph-container.component.spec.ts
TypeScript
FunctionDeclaration
export function isPromiseCompletionSource<T>(obj: any): obj is PromiseCompletionSource<T> { return obj.promise && obj.resolve && obj.reject; }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
ArrowFunction
(resolve, reject) => { this._resolve = resolve; this._reject = reject; }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
ArrowFunction
() => { const i = this.eventSubscribers.indexOf(observer); if (i >= 0) { this.eventSubscribers.splice(i, 1); } }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
ClassDeclaration
export class PromiseCompletionSource<T> { private _resolve: (value: T) => void = () => { }; private _reject: (reason: any) => void = () => { }; readonly promise: Promise<T>; constructor() { this.promise = new Promise<T>((resolve, reject) => { this._resolve = resolve; th...
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
ClassDeclaration
export class GenericChannel implements contracts.KernelCommandAndEventChannel { private stillRunning: PromiseCompletionSource<number>; private commandHandler: contracts.KernelCommandEnvelopeHandler = () => Promise.resolve(); private eventSubscribers: Array<contracts.KernelEventEnvelopeObserver> = []; ...
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
ClassDeclaration
export class CommandAndEventReceiver { private _waitingOnMessages: PromiseCompletionSource<contracts.KernelCommandEnvelope | contracts.KernelEventEnvelope> | null = null; private readonly _envelopeQueue: (contracts.KernelCommandEnvelope | contracts.KernelEventEnvelope)[] = []; public delegate(commandOrEve...
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
resolve(value: T) { this._resolve(value); }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
reject(reason: any) { this._reject(reason); }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
dispose(): void { this.stop(); }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
async run(): Promise<void> { while (true) { let message = await Promise.race([this.messageReceiver(), this.stillRunning.promise]); if (typeof message === 'number') { return; } if (utilities.isKernelCommandEnvelope(message)) { this....
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
stop() { this.stillRunning.resolve(-1); }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
submitCommand(commandEnvelope: contracts.KernelCommandEnvelope): Promise<void> { return this.messageSender(commandEnvelope); }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
publishKernelEvent(eventEnvelope: contracts.KernelEventEnvelope): Promise<void> { return this.messageSender(eventEnvelope); }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
subscribeToKernelEvents(observer: contracts.KernelEventEnvelopeObserver): contracts.DisposableSubscription { this.eventSubscribers.push(observer); return { dispose: () => { const i = this.eventSubscribers.indexOf(observer); if (i >= 0) { t...
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
setCommandHandler(handler: contracts.KernelCommandEnvelopeHandler) { this.commandHandler = handler; }
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
public delegate(commandOrEvent: contracts.KernelCommandEnvelope | contracts.KernelEventEnvelope) { if (this._waitingOnMessages) { let capturedMessageWaiter = this._waitingOnMessages; this._waitingOnMessages = null; capturedMessageWaiter.resolve(commandOrEvent); } el...
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
MethodDeclaration
public read(): Promise<contracts.KernelCommandEnvelope | contracts.KernelEventEnvelope> { let envelope = this._envelopeQueue.shift(); if (envelope) { return Promise.resolve<contracts.KernelCommandEnvelope | contracts.KernelEventEnvelope>(envelope); } else { Logge...
alireza-rezaee/interactive
src/microsoft-dotnet-interactive/src/genericChannel.ts
TypeScript
ArrowFunction
(resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.create(productAttributes).then((product: ProductInstance) => { logger.info(`Created product with name ${productAttributes.name}.`); resolve(product); }).catch((error: E...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(t: Transaction) => { return models.Product.create(productAttributes).then((product: ProductInstance) => { logger.info(`Created product with name ${productAttributes.name}.`); resolve(product); }).catch((error: Error) => { logger.error(error.message); reject(erro...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(product: ProductInstance) => { logger.info(`Created product with name ${productAttributes.name}.`); resolve(product); }
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(error: Error) => { logger.error(error.message); reject(error); }
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.findOne({where: {name: name}}).then((product: ProductInstance) => { if (product) { logger.info(`Retrieved product with name ${name}.`); } else { logger....
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(t: Transaction) => { return models.Product.findOne({where: {name: name}}).then((product: ProductInstance) => { if (product) { logger.info(`Retrieved product with name ${name}.`); } else { logger.info(`Product with name ${name} does not exist.`); } ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(product: ProductInstance) => { if (product) { logger.info(`Retrieved product with name ${name}.`); } else { logger.info(`Product with name ${name} does not exist.`); } resolve(product); }
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.findAll().then((products: Array<ProductInstance>) => { logger.info("Retrieved all products."); console.log("Retrieved all products."); resolve(products); }).c...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(t: Transaction) => { return models.Product.findAll().then((products: Array<ProductInstance>) => { logger.info("Retrieved all products."); console.log("Retrieved all products."); resolve(products); }).catch((error: Error) => { logger.error(error.message); ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(products: Array<ProductInstance>) => { logger.info("Retrieved all products."); console.log("Retrieved all products."); resolve(products); }
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.update(productAttributes, {where: {name: name}}) .then((results: [number, Array<ProductInstance>]) => { if (results.length > 0) { logger.info(`Updated product with ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(t: Transaction) => { return models.Product.update(productAttributes, {where: {name: name}}) .then((results: [number, Array<ProductInstance>]) => { if (results.length > 0) { logger.info(`Updated product with name ${name}.`); } else { logger.info(`Product wi...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(results: [number, Array<ProductInstance>]) => { if (results.length > 0) { logger.info(`Updated product with name ${name}.`); } else { logger.info(`Product with name ${name} does not exist.`); } resolve(null); }
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.destroy({where: {name: name}}).then((afffectedRows: number) => { if (afffectedRows > 0) { logger.info(`Deleted product with name ${name}`); } else { log...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(t: Transaction) => { return models.Product.destroy({where: {name: name}}).then((afffectedRows: number) => { if (afffectedRows > 0) { logger.info(`Deleted product with name ${name}`); } else { logger.info(`Product with name ${name} does not exist.`); } ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ArrowFunction
(afffectedRows: number) => { if (afffectedRows > 0) { logger.info(`Deleted product with name ${name}`); } else { logger.info(`Product with name ${name} does not exist.`); } resolve(null); }
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
ClassDeclaration
export class ProductService { createProduct(productAttributes: ProductAttributes): Promise<ProductInstance> { let promise = new Promise<ProductInstance>((resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.create(productAttributes).then((produ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
MethodDeclaration
createProduct(productAttributes: ProductAttributes): Promise<ProductInstance> { let promise = new Promise<ProductInstance>((resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.create(productAttributes).then((product: ProductInstance) => { ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
MethodDeclaration
retrieveProduct(name: string): Promise<ProductInstance> { let promise = new Promise<ProductInstance>((resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.findOne({where: {name: name}}).then((product: ProductInstance) => { if (product) ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
MethodDeclaration
retrieveProducts(): Promise<Array<ProductInstance>> { let promise = new Promise<Array<ProductInstance>>((resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.findAll().then((products: Array<ProductInstance>) => { logger.info("Retrieved ...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
MethodDeclaration
updateProduct(name: string, productAttributes: any): Promise<void> { let promise = new Promise<void>((resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.update(productAttributes, {where: {name: name}}) .then((results: [number, Array<P...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
MethodDeclaration
deleteProduct(name: string): Promise<void> { let promise = new Promise<void>((resolve: Function, reject: Function) => { sequelize.transaction((t: Transaction) => { return models.Product.destroy({where: {name: name}}).then((afffectedRows: number) => { if (afffectedRows > 0) { log...
CarrotWang/tsBlog
sequelize-express/src/services/product-service.ts
TypeScript
TypeAliasDeclaration
export type RemoveIndex<T> = { [P in keyof T as string extends P ? never : number extends P ? never : P]: T[P] }
Sphereon-Opensource/hellobloom-ecdsa
packages/vc/src/util.ts
TypeScript
FunctionDeclaration
function main(): void { attachComponentAreaHandlers(); attachSubmitButtonHandler(); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function attachSubmitButtonHandler(): void { $("#submitButton").click(submitButtonClickedHandler); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function submitButtonClickedHandler() { getUserIP(); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function attachComponentAreaHandlers(): void { console.log("Attaching Component Area Handlers"); for (let i: number = 0; i <= 7; i++) { $("#component-" + i).click(imgClickedHandler); } }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function imgClickedHandler(event: any): void { typeID = event.target.id.split('-')[1]; attachSchematicAreaHandlers(); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function attachSchematicAreaHandlers(): void { console.log("Attaching Schematic Area Handlers"); // Attaches schematicArea listeners for (let i:number = 0; i <= 24; i++) { //document.getElementById(String(i)).addEventListener("mousedown", mouseDownHandler); //TODO: R...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function rightClickHandler(event: any): void { event.stopPropagation(); if (event.target.tagName.toLowerCase() == "img") { return; } removePlacedFromID(event.target.id); notifyControllerOfRemoval(event.target.id); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function notifyControllerOfRemoval(cellRemovedFromID: string): void { let url: string = `http://localhost:8001/API/RemoveComponent`; $.ajax({ type: "POST", url: url, data: { "removedFrom": cellRemovedFromID }, ...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function mouseDownHandler(event: any): void { console.log(event); if (event.target.tagName.toLowerCase() == "img") { return; } if (event.which == 3) { rightClickHandler(event); return; } console.log("Clicked on: " + event.tar...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function removePlacedFromID(parentID: string): void { console.log("Removing Placed"); let parent: HTMLElement = document.getElementById(parentID); let children: HTMLCollection = parent.children; for (let i: number = 0; i < parent.childElementCount; i++) { ...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function placeComponent(parentID: string): void { let parent: HTMLElement = document.getElementById(parentID); let element: HTMLImageElement = document.createElement('img'); let url: string = getURLFromTypeID(); element.src = url; element.id = "PlacedCompone...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function getUserIP(): void { $.get("https://api.ipify.org?format=json", (data: any): void => { let url: string = `http://localhost:8001/API/SetUserID`; $.ajax({ type: "POST", url: url, data: { ...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function successFunction(data: any): void { console.log("SUCCESS :D"); console.log(data); setUserID(data.ip); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function setUserID(IP: string): void { let url: string = `http://localhost:8001/API/SetUserID`; /*let IP: string = getUserIP();*/ //console.log(IP); $.ajax({ type: "POST", url: url, data: { "userID": I...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function notifyControllerOfPlace(element: HTMLImageElement): void { let url: string = `http://localhost:8001/API/PlaceComponent?`; url += `typeID=${typeID}&`; url += `parentElementID=${element.parentElement.id}`; console.log(`URL: ${url}`); $.ajax({ ...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
FunctionDeclaration
function getURLFromTypeID(): string { let url: string = "http://localhost:8001/Images/ComponentImage?TypeID="; return url + typeID; }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(): void => { fallback.load({ jQuery: [ // Google's CDN "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js", // Local fallback "http://localhost:8001/lib/jquery/dist/jquery.js" ] }); // When jQuery is loaded fallback.ready(...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(jQuery): void => { console.log("Loaded jQuery"); let typeID: string = ""; let placedNum: number = 0; let value: number = 0; $(document).ready((): void => { console.log("setIP"); getUserIP(); }) main(); function main(): void { ...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(): void => { console.log("setIP"); getUserIP(); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(): void => { console.log("Successful POST to remove component"); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(data: any): void => { let url: string = `http://localhost:8001/API/SetUserID`; $.ajax({ type: "POST", url: url, data: { "userID": data.ip }, success: (): void =>...
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(): void => { console.log("Successful POST to set userID"); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(): void => { console.log("Successful POST to set userID"); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(): void => { console.log("Successful POST"); }
Eyrim/circuit-sharp
wwwroot/js/Editor/GhostHandlerTS.ts
TypeScript
ArrowFunction
(user: Kinvey.User) => { // Redirect to members screen if successful this.nav.navigate(["members"]); }
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
ArrowFunction
(error: Kinvey.BaseError) => { this.isAuthenticating = false; dialogs.alert({ title: "Invalid Credentials", message: error.message, okButtonText: "ok" }); }
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
ClassDeclaration
@Component({ moduleId: module.id, templateUrl: "./login.component.html", styleUrls: ["./login-common.scss"] }) export class LoginComponent implements OnInit { user: User; isAuthenticating: boolean = false; @ViewChild("password") password: ElementRef; constructor( private page...
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
MethodDeclaration
ngOnInit() { // Hide action bar this.page.actionBarHidden = true; // Retrieve kinvey active user const activeUser = Kinvey.User.getActiveUser(); if (activeUser) { // Navigate back to members this.nav.navigate(["members"], { cl...
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
MethodDeclaration
login() { if (this.isEmpty(this.user)) { return alert("Please enter your email address and password."); } if (this.user.isValidEmail() === false) { return alert("Please enter a valid email address."); } if (this.user.isValidPassword() === false) { ...
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
MethodDeclaration
focusPassword() { this.password.nativeElement.focus(); }
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
MethodDeclaration
private isEmpty(obj) { for (const key in obj) { if (obj.hasOwnProperty(key)) { return false; } } return true; }
sambacon-paceit/pug-demo-app
src/app/login/login.component.ts
TypeScript
ArrowFunction
({ createdDate }: {createdDate: Date }) => { const createdDateString = createdDate.toDateString(); const weatherStyles = React.useContext(WeatherTypeContext); const currentTime = weatherStyles.time as TimeOptions; const currentWeather = weatherStyles.weather as WeatherOptions; const textStyles = w...
scorbettUM/persona-blog
src/components/posts/header/PostDateDisplay.tsx
TypeScript
ArrowFunction
() => { renderHook(() => {}) const { ready } = useTimeout(10) expect(ready.value).toEqual(false) setTimeout(() => { expect(ready.value).toEqual(true) }, 10) }
Yaob1990/vueuse
packages/shared/useTimeout/index.test.ts
TypeScript
ArrowFunction
() => { expect(ready.value).toEqual(true) }
Yaob1990/vueuse
packages/shared/useTimeout/index.test.ts
TypeScript
ArrowFunction
(error: ErrnoException) => destination.emit('error', error)
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
ArrowFunction
(entry: Entry) => destination.emit('data', options.transform(entry))
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
ArrowFunction
() => destination.emit('end')
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
ArrowFunction
() => source.destroy()
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
ClassDeclaration
export default class ProviderStream extends Provider<Readable> { protected _reader: ReaderStream = new ReaderStream(this._settings); public read(task: Task): Readable { const root = this._getRootDirectory(task); const options = this._getReaderOptions(task); const source = this.api(root, task, options); con...
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
MethodDeclaration
public read(task: Task): Readable { const root = this._getRootDirectory(task); const options = this._getReaderOptions(task); const source = this.api(root, task, options); const destination = new Readable({ objectMode: true, read: () => { /* noop */ } }); source .once('error', (error: ErrnoException) => ...
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
MethodDeclaration
public api(root: string, task: Task, options: ReaderOptions): Readable { if (task.dynamic) { return this._reader.dynamic(root, options); } return this._reader.static(task.patterns, options); }
AgentEnder/fast-glob
src/providers/stream.ts
TypeScript
ArrowFunction
() => { expect(true).toBe(true); }
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
async () => { Container.bind(LoggerApi).to(NoopLoggerImpl); const catalogLoader: CatalogLoaderApi = Container.get(CatalogLoaderApi); catalog = await catalogLoader.loadCatalog(`file:/${process.cwd()}/test/catalog.yaml`) classUnderTest = Container.get(ModuleSelector); }
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
() => { const modules = [ 'github.com/cloud-native-toolkit/terraform-ibm-container-platform', 'github.com/cloud-native-toolkit/terraform-tools-argocd', ]; let bom: BillOfMaterialModel; beforeEach(() => { bom = new BillOfMaterial({spec: {modules}}); }); test...
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
() => { bom = new BillOfMaterial({spec: {modules}}); }
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
async () => { const actualResult: SingleModuleVersion[] = await classUnderTest.resolveBillOfMaterial( catalog, bom, ); const actualIds = actualResult.map(m => m.id).filter(id => modules.includes(id)); expect(actualIds).toEqual(modules); expect(actualResult....
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
id => modules.includes(id)
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
m => m.bomModule
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
m => !!m
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
m => !m
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
() => { const modules = [ {name: 'ibm-container-platform'}, {name: 'argocd'}, ]; let bom: BillOfMaterialModel; beforeEach(() => { bom = new BillOfMaterial({spec: {modules}}); }); test('then should resolve modules', async () => { const actualResult: ...
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript
ArrowFunction
async () => { const actualResult: SingleModuleVersion[] = await classUnderTest.resolveBillOfMaterial( catalog, bom, ); expect(actualResult.length).toBeGreaterThan(0); const mapNames = actualResult.map(m => ({name: m.name})).filter(m => modules.some(v => v.name === m...
csantanapr/iascable
src/services/module-selector/module-selector.impl.spec.ts
TypeScript