type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(e: Types.SyntheticEvent) => { this._isMouseOver = false; this._onHoverEnd(e); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
ArrowFunction
(e: Types.SyntheticEvent) => { if (!this._isHoverStarted && this._isMouseOver) { this._isHoverStarted = true; if (this.props.onHoverStart) { this.props.onHoverStart(e); } } }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
ArrowFunction
(e: Types.SyntheticEvent) => { if (this._isHoverStarted && !this._isMouseOver) { this._isHoverStarted = false; if (this.props.onHoverEnd) { this.props.onHoverEnd(e); } } }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
ArrowFunction
() => { if (!this._isMounted || !this._buttonElement) { return; } this._buttonElement.setNativeProps({ style: [{ backgroundColor: _underlayInactive }, this.props.style] }); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
InterfaceDeclaration
export interface ButtonContext { hasRxButtonAscendant?: boolean; focusArbitrator?: FocusArbitratorProvider; }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
protected _render(internalProps: RN.ViewProps, onMount: (btn: any) => void): JSX.Element { return ( <RN.Animated.View { ...internalProps } ref={ onMount }> { this.props.children } </RN.Animated.View> ); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
render() { // Accessibility props. const importantForAccessibility = AccessibilityUtil.importantForAccessibilityToString(this.props.importantForAccessibility, _defaultImportantForAccessibility); const accessibilityTrait = AccessibilityUtil.accessibilityTraitToString(this.props.acces...
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
componentDidMount() { this._mixin_componentDidMount(); this._isMounted = true; if (this.props.autoFocus) { this.requestFocus(); } }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
componentWillUnmount() { this._mixin_componentWillUnmount(); this._isMounted = false; }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
componentWillReceiveProps(nextProps: Types.ButtonProps) { if (!isEqual(this.props, nextProps)) { // If opacity got updated as a part of props update, we need to reflect that in the opacity animation value this._setOpacityStyles(nextProps, this.props); } }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
getChildContext(): ButtonContext { return { hasRxButtonAscendant: true }; }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
setNativeProps(nativeProps: RN.ViewProps) { if (this._buttonElement) { this._buttonElement.setNativeProps(nativeProps); } }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
requestFocus() { FocusArbitratorProvider.requestFocus( this, () => this.focus(), () => this._isMounted ); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
blur() { // native mobile platforms doesn't have the notion of blur for buttons, so ignore. }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
focus() { if (this._isMounted) { AccessibilityUtil.setAccessibilityFocus(this); } }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _setOpacityStyles(props: Types.ButtonProps, prevProps?: Types.ButtonProps) { const opacityValueFromProps = this._getDefaultOpacityValue(props); if (this._defaultOpacityValue !== opacityValueFromProps || (prevProps && props.disabled !== prevProps.disabled)) { this._defaultOpacityValu...
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _isTouchFeedbackApplicable() { return this._isMounted && this._hasPressHandler() && this._buttonElement; }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _opacityActive(duration: number) { this.setOpacityTo(this.props.activeOpacity || _defaultActiveOpacity, duration); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _opacityInactive(duration: number) { this.setOpacityTo(this._defaultOpacityValue!!!, duration); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _getDefaultOpacityValue(props: Types.ButtonProps): number { let flattenedStyles: { [key: string]: any }|undefined; if (props && props.style) { flattenedStyles = RN.StyleSheet.flatten(props.style as RN.StyleProp<RN.ViewProps>); } return flattenedStyles && (flattenedS...
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
/** * Animate the touchable to a new opacity. */ setOpacityTo(value: number, duration: number) { Animated.timing( this._opacityAnimatedValue!!!, { toValue: value, duration: duration, easing: Animated.Easing.InOut() } ...
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _hasPressHandler() { return !!( this.props.onPress || this.props.onPressIn || this.props.onPressOut || this.props.onLongPress ); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
MethodDeclaration
private _showUnderlay() { if (!this._buttonElement) { return; } this._buttonElement.setNativeProps({ style: { backgroundColor: this.props.underlayColor } }); }
AzureMentor/reactxp
src/native-common/Button.tsx
TypeScript
ClassDeclaration
/** * Groups Migration API * * Groups Migration Api. * * @example * const google = require('googleapis'); * const groupsmigration = google.groupsmigration('v1'); * * @namespace groupsmigration * @type {Function} * @version v1 * @variation v1 * @param {object=} options Options for ...
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
ClassDeclaration
export class Resource$Archive { root: Groupsmigration; constructor(root: Groupsmigration) { this.root = root; this.getRoot.bind(this); } getRoot() { return this.root; } /** * groupsmigration.archive.insert * @desc Inserts a new mail into the archive of the Google ...
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
InterfaceDeclaration
/** * JSON response template for groups migration API. */ export interface Schema$Groups { /** * The kind of insert resource this is. */ kind: string; /** * The status of the insert request. */ responseCode: string; }
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
MethodDeclaration
getRoot() { return this.root; }
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
MethodDeclaration
/** * groupsmigration.archive.insert * @desc Inserts a new mail into the archive of the Google group. * @alias groupsmigration.archive.insert * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.groupId The group ID * @param {object} params.m...
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
MethodDeclaration
insert( params?: any, options?: MethodOptions|BodyResponseCallback<Schema$Groups>, callback?: BodyResponseCallback<Schema$Groups>): void;
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
MethodDeclaration
insert( params?: any, options?: MethodOptions|BodyResponseCallback<Schema$Groups>, callback?: BodyResponseCallback<Schema$Groups>): void|AxiosPromise<Schema$Groups> { if (typeof options === 'function') { callback = options; options = {}; } if (typeof pa...
theWindSweptDev/google-api-nodejs-client
src/apis/groupsmigration/v1.ts
TypeScript
ClassDeclaration
export default class RunWithJsonOutput extends RunnerOptionsDecorator{ constructor(builder: RunnerOptionsBuilder, private readonly commandOptions: string | undefined) { super(builder); } async build(): Promise<RunnerOptions> { const options = await this.builder.build(); con...
AzureDevCloud/azure-pipelines-tasks-terraform
tasks/terraform-cli/src/runners/builders/run-with-json-output.ts
TypeScript
InterfaceDeclaration
interface RunnerOptionsBuilder { withJsonOutput(this: RunnerOptionsBuilder, commandOptions: string | undefined): RunnerOptionsBuilder; }
AzureDevCloud/azure-pipelines-tasks-terraform
tasks/terraform-cli/src/runners/builders/run-with-json-output.ts
TypeScript
MethodDeclaration
async build(): Promise<RunnerOptions> { const options = await this.builder.build(); const jsonOutputOption = "-json"; // is not defined already as an arg and not provided in command options input if((!options.args || (options.args && options.args.indexOf(jsonOutputOption) === -1)...
AzureDevCloud/azure-pipelines-tasks-terraform
tasks/terraform-cli/src/runners/builders/run-with-json-output.ts
TypeScript
ArrowFunction
data=> { if(data.result){ this.isNoResult = false; this.apiResponse = data.data; console.log(data); }else{ this.isNoResult = true; } this.isSearching = false; this.cd.markForCheck(); }
dreweird/RAS
projects/angular-ngrx-material-starter/src/app/features/search/search.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'anms-search', templateUrl: './search.component.html', styleUrls: ['./search.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class SearchComponent implements OnInit { // @ViewChild('docSearchInput', { static: true }) movieSearchInput: ElementRef; apiRespo...
dreweird/RAS
projects/angular-ngrx-material-starter/src/app/features/search/search.component.ts
TypeScript
MethodDeclaration
onNewSearchChange(newSearch: string) { this.newSearch = newSearch; }
dreweird/RAS
projects/angular-ngrx-material-starter/src/app/features/search/search.component.ts
TypeScript
MethodDeclaration
onSearch(){ this.isSearching = true; this.apiResponse = []; this.recordService.searchDoc(this.newSearch).subscribe(data=> { if(data.result){ this.isNoResult = false; this.apiResponse = data.data; console.log(data); }else{ this.isNoResult = true; } th...
dreweird/RAS
projects/angular-ngrx-material-starter/src/app/features/search/search.component.ts
TypeScript
InterfaceDeclaration
export interface IUserRepository extends Repository<EduUserEntity> { }
antonio-marasescu/EduBlock
edunode/app/common/repositories/university/user.interface.repository.ts
TypeScript
FunctionDeclaration
// Type predicate to assert that a 'T[]' is a 'NonEmptyArray<T>' export function isNonEmpty<T>(arr: T[]): arr is NonEmptyArray<T> { return arr.length > 0; }
GRarer/Aurora
src/util/Arrays.ts
TypeScript
FunctionDeclaration
// creates a list of the desired length, filling it with values produced by the given function export function generate<T>(length: number, func: (i: number) => T): T[] { const result: T[] = new Array(length); for (let i = 0; i < length; i++) { result[i] = func(i); } return re...
GRarer/Aurora
src/util/Arrays.ts
TypeScript
FunctionDeclaration
// create a 1-dimensional array containing all of the elements from a 2-dimensional array export function flatten<T>(arr: T[][]): T[] { return arr.reduce((acc, x) => acc.concat(x), []); }
GRarer/Aurora
src/util/Arrays.ts
TypeScript
FunctionDeclaration
export function isRectangle<T>(matrix: T[][]): boolean { return matrix.every(row => row.length === matrix[0].length); }
GRarer/Aurora
src/util/Arrays.ts
TypeScript
ArrowFunction
(acc, x) => acc.concat(x)
GRarer/Aurora
src/util/Arrays.ts
TypeScript
ArrowFunction
row => row.length === matrix[0].length
GRarer/Aurora
src/util/Arrays.ts
TypeScript
TypeAliasDeclaration
// enforces compile-tile check that an array have at least one element export type NonEmptyArray<T> = [T, ...T[]];
GRarer/Aurora
src/util/Arrays.ts
TypeScript
InterfaceDeclaration
/** * The set of arguments for constructing a AndroidMAMPolicyByName resource. */ export interface AndroidMAMPolicyByNameArgs { readonly accessRecheckOfflineTimeout?: pulumi.Input<string>; readonly accessRecheckOnlineTimeout?: pulumi.Input<string>; readonly appSharingFromLevel?: pulumi.Input<string>; ...
sebtelko/pulumi-azure-native
sdk/nodejs/intune/v20150114privatepreview/androidMAMPolicyByName.ts
TypeScript
MethodDeclaration
/** * Get an existing AndroidMAMPolicyByName resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param opts Opti...
sebtelko/pulumi-azure-native
sdk/nodejs/intune/v20150114privatepreview/androidMAMPolicyByName.ts
TypeScript
MethodDeclaration
/** * Returns true if the given object is an instance of AndroidMAMPolicyByName. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is AndroidMAMPolicyByName { if (obj === undefined || obj === ...
sebtelko/pulumi-azure-native
sdk/nodejs/intune/v20150114privatepreview/androidMAMPolicyByName.ts
TypeScript
ArrowFunction
(res: Array<Order>) => { this.orderData = res; this.loader.stop(); this.isLoaded = true; }
StephenDevenney/PizzaExpress
Pizza-UI/src/app/modules/orders/orders-page/orders.component.ts
TypeScript
ArrowFunction
(err: HttpErrorResponse) => { this.loader.stop(); }
StephenDevenney/PizzaExpress
Pizza-UI/src/app/modules/orders/orders-page/orders.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'orders', templateUrl: './orders.component.html' }) export class OrdersComponent extends BaseComponent implements OnInit { public isLoaded: boolean = false; public orderData: Array<Order> = new Array<Order>(); constructor(private injector: Injector, private ordersServ...
StephenDevenney/PizzaExpress
Pizza-UI/src/app/modules/orders/orders-page/orders.component.ts
TypeScript
MethodDeclaration
async ngOnInit(): Promise<void> { await this.loadOrders(); }
StephenDevenney/PizzaExpress
Pizza-UI/src/app/modules/orders/orders-page/orders.component.ts
TypeScript
MethodDeclaration
public async loadOrders() { this.loader.start(); await this.ordersService.getOrders().then((res: Array<Order>) => { this.orderData = res; this.loader.stop(); this.isLoaded = true; }).catch((err: HttpErrorResponse) => { this.loader.stop(); }); }
StephenDevenney/PizzaExpress
Pizza-UI/src/app/modules/orders/orders-page/orders.component.ts
TypeScript
ArrowFunction
() => { return ( <div className="main-container"> <Dialogs/> <Messages/> </div>
monastyrskyi/telegram-clone-client
src/components/view/main/Main.tsx
TypeScript
ClassDeclaration
@InputType() export class DoctorInput { @Field() readonly name: string; @Field() readonly address: string; @Field() readonly hospital_id: number; }
rezaple/patient-record
src/doctors/dto/doctor-input.dto.ts
TypeScript
ArrowFunction
() => { it('Selection', () => { assert.deepStrictEqual(Select.Selection(Select.SelectText, Select.defaultSelectSettings), { strategy: { _tag: 'SelectText' }, settings: { depth: O.none } }) }) it('SelectOne', () => { assert.deepStrictEqual(Select.SelectOne('a', RA.empty), ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { assert.deepStrictEqual(Select.Selection(Select.SelectText, Select.defaultSelectSettings), { strategy: { _tag: 'SelectText' }, settings: { depth: O.none } }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { assert.deepStrictEqual(Select.SelectOne('a', RA.empty), { _tag: 'SelectOne', tag: 'a', predicates: RA.empty }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { assert.deepStrictEqual(Select.SelectAny(RA.empty), { _tag: 'SelectAny', predicates: RA.empty }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { assert.deepStrictEqual(Select.SelectText, { _tag: 'SelectText' }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { assert.deepStrictEqual(Select.SelectSettings(O.some(5)), { depth: O.some(5) }) assert.deepStrictEqual(Select.defaultSelectSettings, { depth: O.none }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { assert.deepStrictEqual(Select.SelectContext(0, false), { position: 0, inChroot: false }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('foldStrategy', () => { const fold = Select.foldStrategy({ SelectOne: () => 'SelectOne', SelectAny: () => 'SelectAny', SelectText: () => 'SelectText' }) assert.deepStrictEqual(fold(Select.SelectOne('a', RA.empty)), 'SelectOne') assert.deepStrictEqual(fold...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { const fold = Select.foldStrategy({ SelectOne: () => 'SelectOne', SelectAny: () => 'SelectAny', SelectText: () => 'SelectText' }) assert.deepStrictEqual(fold(Select.SelectOne('a', RA.empty)), 'SelectOne') assert.deepStrictEqual(fold(Select.SelectAny(RA.empty)), '...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => 'SelectOne'
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => 'SelectAny'
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => 'SelectText'
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { // @ts-expect-error valid SelectStrategy required fold({}) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should select the specified tag', () => { scrapeTest('<a>1</a>', E.right('1'), Scrape.text(Select.tag('a'))) }) it('should allow lowercase selectors to match any case tag', () => { scrapeTest('<a>foo</a><A>bar</A>', E.right(['foo', 'bar']), Scrape.texts(Select.tag('a'))) ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest('<a>1</a>', E.right('1'), Scrape.text(Select.tag('a'))) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest('<a>foo</a><A>bar</A>', E.right(['foo', 'bar']), Scrape.texts(Select.tag('a'))) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest('<a>foo</a><A>bar</A>', E.right(['foo', 'bar']), Scrape.texts(Select.tag('A'))) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should select any node', () => { scrapeTest('<a>1</a>', E.right('1'), Scrape.text(Select.any)) }) it('should match the root node', () => { scrapeTest('<a>1<b>2<c>3</c>4</b>5</a>', E.right('12345'), Scrape.text(Select.any)) }) it('should select text nodes', ()...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest('<a>1</a>', E.right('1'), Scrape.text(Select.any)) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest('<a>1<b>2<c>3</c>4</b>5</a>', E.right('12345'), Scrape.text(Select.any)) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '1<a>2</a>3<b>4<c>5</c>6</b>7', E.right(['1', '2', '3', '456', '7']), Scrape.texts(pipe(Select.any, Select.atDepth(0))) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should select a text node', () => { scrapeTest('<a>1</a>', E.right('1'), Scrape.text(Select.text)) }) it('should select each text node', () => { scrapeTest( '1<a>2</a>3<b>4<c>5</c>6</b>7', E.right(['1', '2', '3', '4', '5', '6', '7']), Scrape....
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest('<a>1</a>', E.right('1'), Scrape.text(Select.text)) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '1<a>2</a>3<b>4<c>5</c>6</b>7', E.right(['1', '2', '3', '4', '5', '6', '7']), Scrape.texts(Select.text) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should obey attribute predicates', () => { scrapeTest( '<a>foo</a><a key="value">bar</a>', E.right(['<a key="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.attribute('key', 'value')])) ) }) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a>foo</a><a key="value">bar</a>', E.right(['<a key="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.attribute('key', 'value')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should match any tag with the corresponding attributes', () => { scrapeTest( '<a foo="value">foo</a><b bar="value">bar</b>', E.right(['<a foo="value">foo</a>', '<b bar="value">bar</b>']), Scrape.htmls(Select.anyWithAttributes([Select.anyAttribute('value')])) ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a foo="value">foo</a><b bar="value">bar</b>', E.right(['<a foo="value">foo</a>', '<b bar="value">bar</b>']), Scrape.htmls(Select.anyWithAttributes([Select.anyAttribute('value')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a foo="other">foo</a><b bar="value">bar</b>', E.right(['<b bar="value">bar</b>']), Scrape.htmls(Select.anyWithAttributes([Select.anyAttribute('value')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should perform case-insensitive matching on attribute keys', () => { scrapeTest( '<a B=C>foo</a>', E.right(['foo']), Scrape.texts(Select.withAttributes('A', [Select.attribute('b', 'C')])) ) }) it('should perform case-sensitive matching on att...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a B=C>foo</a>', E.right(['foo']), Scrape.texts(Select.withAttributes('A', [Select.attribute('b', 'C')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a B=C>foo</a>', E.right([]), Scrape.texts(Select.withAttributes('A', [Select.attribute('b', 'c')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a>foo</a><a B=C>bar</a><a B=D>baz</a>', E.right(['foo', 'baz']), Scrape.texts(Select.withAttributes('a', [Select.notP(Select.attribute('b', 'C'))])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should match any attribute key', () => { scrapeTest( '<a foo="value">foo</a><a bar="value">bar</a>', E.right(['<a foo="value">foo</a>', '<a bar="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.anyAttribute('value')])) ) }) ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a foo="value">foo</a><a bar="value">bar</a>', E.right(['<a foo="value">foo</a>', '<a bar="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.anyAttribute('value')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a foo="other">foo</a><a bar="value">bar</a>', E.right(['<a bar="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.anyAttribute('value')])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should match an attribute value using a regular expression', () => { scrapeTest( '<a key="value">foo</a>', E.right(['<a key="value">foo</a>']), Scrape.htmls( Select.withAttributes('a', [Select.attributeRegex('key', /va(foo|bar|lu)e/)]) ) ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a key="value">foo</a>', E.right(['<a key="value">foo</a>']), Scrape.htmls( Select.withAttributes('a', [Select.attributeRegex('key', /va(foo|bar|lu)e/)]) ) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should match any attribute key', () => { scrapeTest( '<a foo="value">foo</a><a bar="value">bar</a>', E.right(['<a foo="value">foo</a>', '<a bar="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.anyAttributeRegex(/va(foo|bar|lu)e/)])) ) ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a foo="value">foo</a><a bar="value">bar</a>', E.right(['<a foo="value">foo</a>', '<a bar="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.anyAttributeRegex(/va(foo|bar|lu)e/)])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a foo="other">foo</a><a bar="value">bar</a>', E.right(['<a bar="value">bar</a>']), Scrape.htmls(Select.withAttributes('a', [Select.anyAttributeRegex(/va(foo|bar|lu)e/)])) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { it('should select children at the specified depth', () => { scrapeTest( '<a><b>1</b><c><b>2</b></c></a>', E.right(['2']), Scrape.texts( pipe(Select.tag('a'), Select.nested(pipe(Select.tag('b'), Select.atDepth(2)))) ) ) scrapeTes...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a><b>1</b><c><b>2</b></c></a>', E.right(['2']), Scrape.texts( pipe(Select.tag('a'), Select.nested(pipe(Select.tag('b'), Select.atDepth(2)))) ) ) scrapeTest( '<a><b>1</b><c><b>2</b></c></a>', E.right([...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( '<a><b>1</b><c><b>2</b></c></a>', E.right(['12']), Scrape.texts(pipe(Select.tag('a'), Select.nested(pipe(RA.empty, Select.atDepth(2))))) ) }
IMax153/scalpel-ts
test/Select.test.ts
TypeScript
ArrowFunction
() => { scrapeTest( "<a><b class='foo'>1</b><c><b class='foo'>2</b></c></a>", E.right(['2']), Scrape.texts( pipe( Select.tag('a'), Select.nested( pipe(Select.withAttributes('b', [Select.hasClass('foo')]), Select.atDepth(2)) ...
IMax153/scalpel-ts
test/Select.test.ts
TypeScript