type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
() => { filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; mockColumn.filter.operator = '>'; const spyCallback = jest.spyOn(filterArguments, 'callback'); filter.init(filterArguments); const filterSelectElm = divContainer.querySelector<HTMLInputElement>('.search-filter.filter-finish select...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { i18n.setLocale('fr-CA'); // will be trimmed to "fr" filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; mockColumn.filter.operator = '<='; const spyCallback = jest.spyOn(filterArguments, 'callback'); filter.init(filterArguments); const filterInputElm = divContainer.querySelecto...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { i18n.setLocale('zx'); const consoleSpy = jest.spyOn(global.console, 'warn').mockReturnValue(); filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; mockColumn.filter.operator = '<='; filter.init(filterArguments); const filterInputElm = divContainer.querySelector<HTMLInputElemen...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; const spyCallback = jest.spyOn(filterArguments, 'callback'); filter.init(filterArguments); filter.clear(); const filterInputElm = divContainer.querySelector<HTMLInputElement>('.search-filter.filter-finish .flatpickr input.input');...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; const spyCallback = jest.spyOn(filterArguments, 'callback'); filter.init(filterArguments); filter.clear(false); const filterInputElm = divContainer.querySelector<HTMLInputElement>('.search-filter.filter-finish .flatpickr input.inp...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { mockColumn.filter.filterOptions = { enableTime: true, allowInput: true }; // change to allow input value only for testing purposes mockColumn.outputType = FieldType.dateTimeIsoAmPm; mockColumn.filter.operator = '>'; const spyCallback = jest.spyOn(filterArguments, 'callback'); filter.init(f...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { mockColumn.outputType = null; filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; mockColumn.filter.operator = '<='; const spyCallback = jest.spyOn(filterArguments, 'callback'); filter.init(filterArguments); const filterInputElm = divContainer.querySelector<HTMLInputElement>('....
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { mockColumn.outputType = null; filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; filter.init(filterArguments); const filterOperatorElm = divContainer.querySelectorAll<HTMLSelectElement>('.input-group-prepend.operator select'); expect(filterOperatorElm[0][0].title).toBe(''); e...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { beforeEach(() => { gridOptionMock.enableTranslate = true; i18n.setLocale('fr'); }); it('should have French text translated with operator dropdown options related to dates', () => { mockColumn.outputType = null; filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; ...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { gridOptionMock.enableTranslate = true; i18n.setLocale('fr'); }
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ArrowFunction
() => { mockColumn.outputType = null; filterArguments.searchTerms = ['2000-01-01T05:00:00.000Z']; filter.init(filterArguments); const filterOperatorElm = divContainer.querySelectorAll<HTMLSelectElement>('.input-group-prepend.operator select'); expect(filterOperatorElm[0][0].title).toBe(...
zewa666/aurelia-slickgrid
src/aurelia-slickgrid/filters/__tests__/compoundDateFilter.spec.ts
TypeScript
ClassDeclaration
export class HeilbaumPhotoswipe extends ViewController { private _app: App; /** * Constructor of class * * @param app * @param data */ constructor(app: App, data: any) { data = data || {}; super(HeilbaumPhotoswipeComponent, data, ''); this._app = app; ...
jonathanheilmann/heilbaum-ionic-photoswipe
src/providers/heilbaum-photoswipe.ts
TypeScript
ClassDeclaration
@Injectable() export class HeilbaumPhotoswipeController { /** * Constructor of class * * @param _app */ constructor(private _app: App) { } /** * Creates a new PhotoSwipe instance * * @param items * @param options * @returns {HeilbaumPhotoswipe} */ ...
jonathanheilmann/heilbaum-ionic-photoswipe
src/providers/heilbaum-photoswipe.ts
TypeScript
MethodDeclaration
/** * Presents the action sheet instance. * * @param navOptions * @returns {Promise} Returns a promise which is resolved when the transition has completed. */ present(navOptions = {}) { return this._app.present(this, navOptions, AppPortal.MODAL); }
jonathanheilmann/heilbaum-ionic-photoswipe
src/providers/heilbaum-photoswipe.ts
TypeScript
MethodDeclaration
/** * Creates a new PhotoSwipe instance * * @param items * @param options * @returns {HeilbaumPhotoswipe} */ create(items: Array<PhotoswipeItem>, options: PhotoswipeOptions = {}) { return new HeilbaumPhotoswipe(this._app, {items, options}) }
jonathanheilmann/heilbaum-ionic-photoswipe
src/providers/heilbaum-photoswipe.ts
TypeScript
ClassDeclaration
@Component({ selector: 'detail', templateUrl: './detail.component.html' }) export class Detail { constructor() { } ngOnInit() { console.log('hello `Detail` component'); } }
Twiinlab/angular2-starter-kit
src/app/+detail/detail.component.ts
TypeScript
MethodDeclaration
ngOnInit() { console.log('hello `Detail` component'); }
Twiinlab/angular2-starter-kit
src/app/+detail/detail.component.ts
TypeScript
FunctionDeclaration
/** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ export default function fla...
taoqf/lodash
src/flatten.ts
TypeScript
ClassDeclaration
@Injectable({ providedIn: 'root' }) export class TipoEstabelecimentoService { constructor( @Inject('TIPO_ESTABELECIMENTO_ENDPOINT') private tipoEndpoint: string, private httpClient: HttpClient ) { } getTipos(): Observable<TipoEstabelecimentoModel[]> { return this.httpClient.get<TipoEstabelecimento...
marcostark/pbd-frontend
src/app/tipo-estabelecimento/tipo-estabelecimento.service.ts
TypeScript
MethodDeclaration
getTipos(): Observable<TipoEstabelecimentoModel[]> { return this.httpClient.get<TipoEstabelecimentoModel[]>(this.tipoEndpoint); }
marcostark/pbd-frontend
src/app/tipo-estabelecimento/tipo-estabelecimento.service.ts
TypeScript
MethodDeclaration
getTipo(id: number): Observable<TipoEstabelecimentoModel> { return this.httpClient.get<TipoEstabelecimentoModel>(this.tipoEndpoint + id + '/'); }
marcostark/pbd-frontend
src/app/tipo-estabelecimento/tipo-estabelecimento.service.ts
TypeScript
MethodDeclaration
adicionarTipo(_tipoEstabelecimento: TipoEstabelecimentoModel): Observable<TipoEstabelecimentoModel> { return this.httpClient.post<TipoEstabelecimentoModel>(this.tipoEndpoint, _tipoEstabelecimento); }
marcostark/pbd-frontend
src/app/tipo-estabelecimento/tipo-estabelecimento.service.ts
TypeScript
MethodDeclaration
editarTipo(tipo: any): Observable<TipoEstabelecimentoModel> { return this.httpClient.put<TipoEstabelecimentoModel>(this.tipoEndpoint + tipo.id + '/', tipo); }
marcostark/pbd-frontend
src/app/tipo-estabelecimento/tipo-estabelecimento.service.ts
TypeScript
MethodDeclaration
// TODO resolver problema de CORS removerTipo(id: number): Observable<any> { return this.httpClient.delete(this.tipoEndpoint + `${id}`); }
marcostark/pbd-frontend
src/app/tipo-estabelecimento/tipo-estabelecimento.service.ts
TypeScript
ArrowFunction
async ()=>{ try { this.filesContent.push((await this.promiseReadFileAsText(files[i])).toString()); //this.filesContent += await this.promiseReadFileAsText(files[i]); this.fileNames.push((i+1)+': '+files[i].name); } catch (e) { console.warn(e.message); } ...
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
ArrowFunction
(inputFile:File)=>{ let tempFileReader = new FileReader(); return new Promise((resolve, reject) => { tempFileReader.onerror = () => { tempFileReader.abort(); reject(new DOMException("Problem reading file")); }; tempFileReader.onload = () => { resolve(tempFileReader.res...
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
ArrowFunction
(resolve, reject) => { tempFileReader.onerror = () => { tempFileReader.abort(); reject(new DOMException("Problem reading file")); }; tempFileReader.onload = () => { resolve(tempFileReader.result); }; tempFileReader.readAsText(inputFile) }
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
ArrowFunction
() => { tempFileReader.abort(); reject(new DOMException("Problem reading file")); }
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
ArrowFunction
() => { resolve(tempFileReader.result); }
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-load-dialog', templateUrl: './load-dialog.component.html', styleUrls: ['./load-dialog.component.css'] }) export class LoadDialogComponent { public filesContent: string[]; public fileNames: string[]; constructor(public dialogRef: MatDialogRef<LoadDialogComponent>) { } public ...
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
MethodDeclaration
public onCancel(){ this.dialogRef.close(); }
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
MethodDeclaration
public handleFiles(files: FileList){ if(!files){return;} if(!this.filesContent){ this.filesContent = new Array<string>(); this.fileNames = new Array<string>(); } for (let i=0, numFiles = files.length; i<numFiles;i++){ (async ()=>{ try { this.filesContent.push((await...
JamesShull/rentcheck
src/app/load-dialog/load-dialog.component.ts
TypeScript
FunctionDeclaration
export async function getEntities(url: string): Promise<Entity[]> { const { response, representation } = await Hydra.loadResource(url) const rootResource = representation!.root! as RdfResource //@ts-ignor const links: { supportedProperty: SupportedProperty; resources: RdfResource[] }[] = (rootResource...
alexkreidler/semanticweb
packages/loqu/src/hydra/entities.ts
TypeScript
ArrowFunction
(l) => ({ class: l.supportedProperty.property!.range!, })
alexkreidler/semanticweb
packages/loqu/src/hydra/entities.ts
TypeScript
ArrowFunction
(l) => { if (l.resources.length > 1) { throw new Error("Multiple links?!") } return { resource: l.resources[0] } }
alexkreidler/semanticweb
packages/loqu/src/hydra/entities.ts
TypeScript
TypeAliasDeclaration
export type Entity = { class: Class; resource: Resource }
alexkreidler/semanticweb
packages/loqu/src/hydra/entities.ts
TypeScript
ArrowFunction
<T, U>(f: (val: T) => U) => (arr: T[]) => arr.map(f)
chorobin/unify
src/map/map.ts
TypeScript
ArrowFunction
(arr: T[]) => arr.map(f)
chorobin/unify
src/map/map.ts
TypeScript
ArrowFunction
<T, U>(f: (val: T) => U) => ( iter: ImmutableIterable<number, T>, ) => iter.map(f as (val: T | undefined) => U)
chorobin/unify
src/map/map.ts
TypeScript
ArrowFunction
( iter: ImmutableIterable<number, T>, ) => iter.map(f as (val: T | undefined) => U)
chorobin/unify
src/map/map.ts
TypeScript
ArrowFunction
<T, U>(f: (val: T) => U) => <TMonad extends Monad<T>>( monad: TMonad, ) => resolve( rxMap(f), immutableIterableMap(f), arrayMap(f), maybeMap(f), iterableMap(f), monad, ) as MapMonad<TMonad, U>
chorobin/unify
src/map/map.ts
TypeScript
ArrowFunction
<TMonad extends Monad<T>>( monad: TMonad, ) => resolve( rxMap(f), immutableIterableMap(f), arrayMap(f), maybeMap(f), iterableMap(f), monad, ) as MapMonad<TMonad, U>
chorobin/unify
src/map/map.ts
TypeScript
ClassDeclaration
@Directive({ selector: '[starkG2plotArea]', exportAs: 'g2plotArea' }) export class G2plotAreaDirective implements AfterViewInit { @Input() options: AreaOptions; public instance: Area; constructor( private elementRef: ElementRef ) { } ngAfterViewInit(): void { const hostElement = this.elementR...
stack-stark/ngx-g2plot
projects/ngx-g2plot/src/lib/g2plot-area/g2plot-area.directive.ts
TypeScript
MethodDeclaration
ngAfterViewInit(): void { const hostElement = this.elementRef.nativeElement; this.instance = new Area(hostElement, this.options); this.instance.render(); }
stack-stark/ngx-g2plot
projects/ngx-g2plot/src/lib/g2plot-area/g2plot-area.directive.ts
TypeScript
MethodDeclaration
/** * 通过这个方法,可以增量的更新图表配置 * @param options AreaOptions */ update(options: AreaOptions): void { this.instance.update(options); }
stack-stark/ngx-g2plot
projects/ngx-g2plot/src/lib/g2plot-area/g2plot-area.directive.ts
TypeScript
MethodDeclaration
/** * 通过这个方法,可以修改图表的数据,并自动重新渲染 * @param newData Array<object> */ changeData(newData: Array<object>): void { this.instance.changeData(newData); }
stack-stark/ngx-g2plot
projects/ngx-g2plot/src/lib/g2plot-area/g2plot-area.directive.ts
TypeScript
MethodDeclaration
/** * 完全销毁整个画布,回收所有资源,仅仅保留传入的 DOM container 容器 */ destroy(): void { this.instance.destroy(); }
stack-stark/ngx-g2plot
projects/ngx-g2plot/src/lib/g2plot-area/g2plot-area.directive.ts
TypeScript
FunctionDeclaration
export async function* getExclusionsPreviewPaginate( config: InspectorPaginationConfiguration, input: GetExclusionsPreviewCommandInput, ...additionalArguments: any ): Paginator<GetExclusionsPreviewCommandOutput> { let token: string | undefined = config.startingToken || undefined; let hasNext = true; let pa...
brmur/aws-sdk-js-v3
clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts
TypeScript
ArrowFunction
async ( client: InspectorClient, input: GetExclusionsPreviewCommandInput, ...args: any ): Promise<GetExclusionsPreviewCommandOutput> => { // @ts-ignore return await client.send(new GetExclusionsPreviewCommand(input, ...args)); }
brmur/aws-sdk-js-v3
clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts
TypeScript
ArrowFunction
async ( client: Inspector, input: GetExclusionsPreviewCommandInput, ...args: any ): Promise<GetExclusionsPreviewCommandOutput> => { // @ts-ignore return await client.getExclusionsPreview(input, ...args); }
brmur/aws-sdk-js-v3
clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-login', templateUrl: './login.component.html', styleUrls: ['./login.component.css'] }) export class LoginComponent implements OnInit { constructor(private loginService: LoginService) { } ngOnInit(): void { this.loginService.login(); } }
smartcommunitylab/enabler.dsa
dsa-console/src/app/components/login/login.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.loginService.login(); }
smartcommunitylab/enabler.dsa
dsa-console/src/app/components/login/login.component.ts
TypeScript
ArrowFunction
() => { const testDir = join(__filename, "..", "..", "..", "test_env"); before((done) => { createDir(testDir).then(async () => { await createFile(join(testDir, "TestFirstJUnit.java")); await createFile(join(testDir, "TestSecondJUnit.java")); await createFile(join(te...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
(done) => { createDir(testDir).then(async () => { await createFile(join(testDir, "TestFirstJUnit.java")); await createFile(join(testDir, "TestSecondJUnit.java")); await createFile(join(testDir, "TestThirdJUnit.java")); await createFile(join(testDir, "TestFourthJU...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
async () => { await createFile(join(testDir, "TestFirstJUnit.java")); await createFile(join(testDir, "TestSecondJUnit.java")); await createFile(join(testDir, "TestThirdJUnit.java")); await createFile(join(testDir, "TestFourthJUnit.java")); await createFile(jo...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestFirstJUnit.java"); let test = new Test("firstTest", filename, new JUnitLibrary(new JavaHandler()), "TestFirstJUnit"); writeFileSync(filename, "class TestFirstJUnit {\n\n}", "utf-8"); test.appendTestToFile(); const shouldBe = ...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestSecondJUnit.java"); let test = new Test("firstTest", filename, new JUnitLibrary(new JavaHandler()), "TestSecondJUnit"); writeFileSync(filename, "", "utf-8"); test.appendTestToFile(); const shouldBe = "import org.junit.*;\n\...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestThirdJUnit.java"); let test = new Test("thirdTest", filename, new JUnitLibrary(new JavaHandler()), "TestThirdJUnit"); writeFileSync(filename, "import org.junit.*;\n\n" + "class TestThirdJUnit {\n\n" + "\t@Test\n" + ...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestTenthJUnit.java"); let test = new Test("tenthTest", filename, new JUnitLibrary(new JavaHandler()), "TestTenthJUnit"); writeFileSync(filename, "package mypackage;\n" + "class TestTenthJUnit {\n\n" + "}", { encoding: ...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestNinethJUnit.java"); let test = new Test("tenthTest", filename, new JUnitLibrary(new JavaHandler()), "TestNinethJUnit"); writeFileSync(filename, "package mypackage;\n" + "class TestNinethJUnit {\n\n" + "}", { encodin...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestEleventhJUnit.java"); let test = new Test("thirdTest", filename, new JUnitLibrary(new JavaHandler()), "TestEleventhJUnit"); writeFileSync(filename, "import org.java.junit.*;\n\n" + "class TestEleventhJUnit {\n\n" + ...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const testDir = join(__filename, "..", "..", "..", "test_env"); before((done) => { createDir(testDir).then(async () => { createFile(join(testDir, "TestFifthJUnit.java")); createFile(join(testDir, "TestSixthJUnit.java")); done(); }); }); test...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
(done) => { createDir(testDir).then(async () => { createFile(join(testDir, "TestFifthJUnit.java")); createFile(join(testDir, "TestSixthJUnit.java")); done(); }); }
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
async () => { createFile(join(testDir, "TestFifthJUnit.java")); createFile(join(testDir, "TestSixthJUnit.java")); done(); }
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestFifthJUnit.java"); writeFileSync(filename, "", { encoding: "utf8" }); const testList = new TestList(filename, new JUnitLibrary(new JavaHandler()), "TestFifthJUnit"); testList.addTest("test"); testList.addTestsToFile(); const ...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ArrowFunction
() => { const filename = join(testDir, "TestSixthJUnit.java"); writeFileSync(filename, "", { encoding: "utf8" }); const testList = new TestList(filename, new JUnitLibrary(new JavaHandler()), "TestSixthJUnit"); testList.addTest("test1"); testList.addTest("test2"); testLi...
E-Jacques/pytestersuits
src/test/suite/java/testClass.test.ts
TypeScript
ClassDeclaration
/** * Cannot be a title case string validator. * * @export * @class CannotBeTitleCaseValidator * @extends {Validator} */ export class CannotBeTitleCaseValidator extends Validator { // #region Constructors (1) /** * Creates an instance of CannotBeTitleCaseValidator. * @param {(string | null | un...
aljazsim/validation-framework-for-typescript
source/validators/string/cannot/cannot-be-title-case.validator.ts
TypeScript
MethodDeclaration
// #endregion // #region Public Methods (1) /** * Validates the specified value. * * @param {*} value * @returns {boolean} - True if the value is valid; false otherwise. */ public isValid(value: any): boolean { if (isNull(value)) { return true; } ...
aljazsim/validation-framework-for-typescript
source/validators/string/cannot/cannot-be-title-case.validator.ts
TypeScript
MethodDeclaration
// #endregion // #region Protected Methods (1) /** * Gets the default message. * * @protected * @returns {string} - The default message. */ protected getDefaultMessage(): string { return "Value cannot be title case."; }
aljazsim/validation-framework-for-typescript
source/validators/string/cannot/cannot-be-title-case.validator.ts
TypeScript
FunctionDeclaration
function decodeChapterImages(input: string) { const key = CryptoJS.enc.Utf8.parse("123456781234567G") const iv = CryptoJS.enc.Utf8.parse("ABCDEF1G34123412") let decryptedStr = CryptoJS.AES.decrypt( input, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 } ).toString(CryptoJS....
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
FunctionDeclaration
function parseComicHTML(html: string, referer: string) { let chapterImagesMatch = /chapterImages = "([^"]+)"/.exec(html) let prevChapterDataMatch = /prevChapterData = ([^;]*)/.exec(html) let nextChapterDataMatch = /nextChapterData = ([^;]*)/.exec(html) let chapterPathMatch = /chapterPath = "([^"]*)"/.e...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
FunctionDeclaration
function parseMangaHTML(html: string, meta: MangaMeta, referer: string) { let root = HTMLParser.parse(html) let cover = root.querySelector(".comic_i_img img") let coverSource = { uri: cover.attributes['src'], headers: { 'User-Agent': userAgent, Referer: referer ...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
FunctionDeclaration
function parseSearchResult(html: string, referer: string) { let root = HTMLParser.parse(html) let entries = root.querySelectorAll('.list-comic a.image-link') let resultCount = parseInt(root.querySelector('.comi_num em').text) let results = entries.map(item => { let title = item.attributes['ti...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
(item: string) => { if (item.startsWith("http")) { if (/eshanyao/.exec(item) != null) return item else return `https://mhimg.eshanyao.com/showImage.php?url=${encodeURI(item)}` } else { return `https://mhimg.eshanyao.com/${chapterPath}$...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
(item: string) => ({ uri: uriFromItem(item), headers: { 'User-Agent': userAgent, Referer: referer } })
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
item => { console.log(item.attributes['href']) let hrefMatch = /\/manhua\/([^\/]+)\/(\d+)/.exec(item.attributes['href']) let manga = hrefMatch && hrefMatch[1] let chapterId = hrefMatch && hrefMatch[2] let title = item.attributes['title'] console.log(chapterId) ...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
item => { let title = item.attributes['title'] let mangaIdMatch = /\/manhua\/([^\/]*)\//.exec(item.attributes['href']) let mangaId = mangaIdMatch && mangaIdMatch[1] let coverElement = item.querySelector('img') let coverSource = { uri: coverElement.attributes['src'], ...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
res => res.text().then(html => { let parseResult = parseComicHTML(html, pageUrl) this.prevChapter = parseResult.prevChapter this.nextChapter = parseResult.nextChapter callback({ meta: { title: parseResult.title, man...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
html => { let parseResult = parseComicHTML(html, pageUrl) this.prevChapter = parseResult.prevChapter this.nextChapter = parseResult.nextChapter callback({ meta: { title: parseResult.title, mangaNo: this.mangaId, ...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
(item: any) => ({ source: item })
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
res => res.text().then(html => { let parseResult = parseSearchResult(html, searchUrl) this.totalResults = parseResult.totalCount callback(parseResult.results) })
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
html => { let parseResult = parseSearchResult(html, searchUrl) this.totalResults = parseResult.totalCount callback(parseResult.results) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
item => item.id == entry.id
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
item => item.id != entry.id
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
res => res.text().then(html => callback(parseMangaHTML(html, meta, mangaUrl)))
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
html => callback(parseMangaHTML(html, meta, mangaUrl))
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ClassDeclaration
class ManhuaduiChapterFeeder implements ChapterFeeder { nextChapter: string | null = null prevChapter: string | null = null chapterId: string mangaId: string constructor(meta: ChapterMeta) { this.chapterId = meta.chapterNo this.mangaId = meta.mangaNo } current(callback: (c...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ClassDeclaration
class ManhuaduiSearchResultFeeder implements SearchResultFeeder { totalResults: number = 0 currentPage: number = 0 constructor(private queryStr: string) { } more(callback: (result: MangaMeta[]) => void) { if (this.currentPage != 0 && this.currentPage * 36 >= this.totalResults) ret...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ClassDeclaration
export default class ManhuaduiAPI implements MangaAPI { name: string = "manhuadui" getFavorite(entries: MangaMeta[]) { return entries } addFavorite(entries: MangaMeta[], entry: MangaMeta) { if (entries.find(item => item.id == entry.id)) return entries return entrie...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
current(callback: (chapter?: ChapterInfo) => void) { const pageUrl = `https://www.manhuadui.com/manhua/${this.mangaId}/${this.chapterId}.html` console.log(`fetching ${pageUrl}`) fetch(pageUrl, { headers: { 'User-Agent': userAgent } }).then(res => ...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
prev(callback: (chapter?: ChapterInfo) => void) { if (!this.prevChapter) return callback() this.chapterId = this.prevChapter this.current(callback) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
next(callback: (chapter?: ChapterInfo) => void) { if (!this.nextChapter) return callback() this.chapterId = this.nextChapter this.current(callback) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
more(callback: (result: MangaMeta[]) => void) { if (this.currentPage != 0 && this.currentPage * 36 >= this.totalResults) return callback([]) this.currentPage += 1 let searchUrl = `https://www.manhuadui.com/search/?keywords=${this.queryStr}&page=${this.currentPage}` fetch(s...
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
getFavorite(entries: MangaMeta[]) { return entries }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
addFavorite(entries: MangaMeta[], entry: MangaMeta) { if (entries.find(item => item.id == entry.id)) return entries return entries.concat([entry]) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
removeFavorite(entries: MangaMeta[], entry: MangaMeta) { return entries.filter(item => item.id != entry.id) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
getManga(meta: MangaMeta, callback: (info: MangaInfo) => void) { let mangaUrl = `https://www.manhuadui.com/manhua/${meta.id}/` fetch(mangaUrl, { headers: { 'User-Agent': userAgent } }) .then(res => res.text().then(html => callback(parseMangaHTML(html, meta, mangaUrl)))) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
search(str: string, callback: (feeder: SearchResultFeeder) => void) { callback(new ManhuaduiSearchResultFeeder(str)) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
MethodDeclaration
getChapterFeeder(chapter: ChapterMeta, callback: (feeder: ChapterFeeder) => void) { callback(new ManhuaduiChapterFeeder(chapter)) }
AbikoWarakawa/Akigumo
src/sources/Manhuadui.ts
TypeScript
ArrowFunction
config => { store.commit(SHOW_LOADING, true, { root: true }); return config; }
spartan73rmy/FitoReportWeb
fitoreportweb/src/main.ts
TypeScript