type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
expectFromHtml('<div [someProp]="v"></div>').toEqual([
['Element', '0:26', '0:20', '20:26'],
['BoundAttribute', '5:19', '17:18'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div [someProp]></div>').toEqual([
['Element', '0:22', '0:16', '16:22'],
['BoundAttribute', '5:15', '<empty>'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div bind-prop="v"></div>').toEqual([
['Element', '0:25', '0:19', '19:25'],
['BoundAttribute', '5:18', '16:17'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div prop="{{v}}"></div>').toEqual([
['Element', '0:24', '0:18', '18:24'],
['BoundAttribute', '5:17', '11:16'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
it('is correct for * directives', () => {
expectFromHtml('<div *ngIf></div>').toEqual([
['Template', '0:17', '0:11', '11:17'],
['TextAttribute', '6:10', '<empty>'], // ngIf
['Element', '0:17', '0:11', '11:17'],
]);
});
it('is correct for <ng-template>', () => {... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div *ngIf></div>').toEqual([
['Template', '0:17', '0:11', '11:17'],
['TextAttribute', '6:10', '<empty>'], // ngIf
['Element', '0:17', '0:11', '11:17'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template></ng-template>').toEqual([
['Template', '0:27', '0:13', '13:27'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template #a></ng-template>').toEqual([
['Template', '0:30', '0:16', '16:30'],
['Reference', '13:15', '<empty>'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template #a="b"></ng-template>').toEqual([
['Template', '0:34', '0:20', '20:34'],
['Reference', '13:19', '17:18'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template ref-a></ng-template>').toEqual([
['Template', '0:33', '0:19', '19:33'],
['Reference', '13:18', '<empty>'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template let-a="b"></ng-template>').toEqual([
['Template', '0:37', '0:23', '23:37'],
['Variable', '13:22', '20:21'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template k1="v1"></ng-template>').toEqual([
['Template', '0:35', '0:21', '21:35'],
['TextAttribute', '13:20', '17:19'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<ng-template [k1]="v1"></ng-template>').toEqual([
['Template', '0:37', '0:23', '23:37'],
['BoundAttribute', '13:22', '19:21'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
it('is correct for attribute and bound attributes', () => {
// Desugared form is
// <ng-template ngFor [ngForOf]="items" let-item>
// <div></div>
// </ng-template>
expectFromHtml('<div *ngFor="let item of items"></div>').toEqual([
['Template', '0:38', '0:32', '32:38'... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
// Desugared form is
// <ng-template ngFor [ngForOf]="items" let-item>
// <div></div>
// </ng-template>
expectFromHtml('<div *ngFor="let item of items"></div>').toEqual([
['Template', '0:38', '0:32', '32:38'],
['TextAttribute', '6:11', '<empty>'], // ngFor
... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div *ngIf="let a=b"></div>').toEqual([
['Template', '0:27', '0:21', '21:27'],
['TextAttribute', '6:10', '<empty>'], // ngIf
['Variable', '12:19', '18:19'], // let a=b -> b
['Element', '0:27', '0:21', '21:27'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div *ngIf="expr as local"></div>').toEqual([
['Template', '0:33', '0:27', '27:33'],
['BoundAttribute', '5:26', '12:16'], // ngIf="expr as local" -> expr
['Variable', '6:25', '6:10'], // ngIf="expr as local -> ngIf
['Element', '0:33', '0:27', '27:3... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
it('is correct for event names case sensitive', () => {
expectFromHtml('<div (someEvent)="v"></div>').toEqual([
['Element', '0:27', '0:21', '21:27'],
['BoundEvent', '5:20', '18:19'],
]);
});
it('is correct for bound events via on-', () => {
expectFromHtml('<div on... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div (someEvent)="v"></div>').toEqual([
['Element', '0:27', '0:21', '21:27'],
['BoundEvent', '5:20', '18:19'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div on-event="v"></div>').toEqual([
['Element', '0:24', '0:18', '18:24'],
['BoundEvent', '5:17', '15:16'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div [(prop)]="v"></div>').toEqual([
['Element', '0:24', '0:18', '18:24'],
['BoundAttribute', '5:17', '15:16'],
['BoundEvent', '5:17', '15:16'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div bindon-prop="v"></div>').toEqual([
['Element', '0:27', '0:21', '21:27'],
['BoundAttribute', '5:20', '18:19'],
['BoundEvent', '5:20', '18:19'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
it('is correct for references via #...', () => {
expectFromHtml('<div #a></div>').toEqual([
['Element', '0:14', '0:8', '8:14'],
['Reference', '5:7', '<empty>'],
]);
});
it('is correct for references with name', () => {
expectFromHtml('<div #a="b"></div>').toEqual(... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div #a></div>').toEqual([
['Element', '0:14', '0:8', '8:14'],
['Reference', '5:7', '<empty>'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div #a="b"></div>').toEqual([
['Element', '0:18', '0:12', '12:18'],
['Reference', '5:11', '9:10'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
() => {
expectFromHtml('<div ref-a></div>').toEqual([
['Element', '0:17', '0:11', '11:17'],
['Reference', '5:10', '<empty>'],
]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ClassDeclaration |
class R3AstSourceSpans implements t.Visitor<void> {
result: any[] = [];
visitElement(element: t.Element) {
this.result.push([
'Element', humanizeSpan(element.sourceSpan), humanizeSpan(element.startSourceSpan),
humanizeSpan(element.endSourceSpan)
]);
this.visitAll([
element.attributes... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitElement(element: t.Element) {
this.result.push([
'Element', humanizeSpan(element.sourceSpan), humanizeSpan(element.startSourceSpan),
humanizeSpan(element.endSourceSpan)
]);
this.visitAll([
element.attributes,
element.inputs,
element.outputs,
element.references,
... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitTemplate(template: t.Template) {
this.result.push([
'Template', humanizeSpan(template.sourceSpan), humanizeSpan(template.startSourceSpan),
humanizeSpan(template.endSourceSpan)
]);
this.visitAll([
template.attributes,
template.inputs,
template.outputs,
template.templ... | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitContent(content: t.Content) {
this.result.push(['Content', humanizeSpan(content.sourceSpan)]);
t.visitAll(this, content.attributes);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitVariable(variable: t.Variable) {
this.result.push(
['Variable', humanizeSpan(variable.sourceSpan), humanizeSpan(variable.valueSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitReference(reference: t.Reference) {
this.result.push(
['Reference', humanizeSpan(reference.sourceSpan), humanizeSpan(reference.valueSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitTextAttribute(attribute: t.TextAttribute) {
this.result.push(
['TextAttribute', humanizeSpan(attribute.sourceSpan), humanizeSpan(attribute.valueSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitBoundAttribute(attribute: t.BoundAttribute) {
this.result.push(
['BoundAttribute', humanizeSpan(attribute.sourceSpan), humanizeSpan(attribute.valueSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitBoundEvent(event: t.BoundEvent) {
this.result.push(
['BoundEvent', humanizeSpan(event.sourceSpan), humanizeSpan(event.handlerSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitText(text: t.Text) {
this.result.push(['Text', humanizeSpan(text.sourceSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitBoundText(text: t.BoundText) {
this.result.push(['BoundText', humanizeSpan(text.sourceSpan)]);
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
visitIcu(icu: t.Icu) {
return null;
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
MethodDeclaration |
private visitAll(nodes: t.Node[][]) {
nodes.forEach(node => t.visitAll(this, node));
} | VaeterchenFrost/angular | packages/compiler/test/render3/r3_ast_spans_spec.ts | TypeScript |
ArrowFunction |
(): void => {
const params = window.location.pathname.split('/');
const inAuth = this.checkAuth(params);
if (inAuth) {
window.location.href = this.inAuthRedirectTo;
}
else {
this.callback();
}
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
(currentRoute: string[], route: string[]): boolean => {
let result = false;
Object.keys(route).map((key: any) => {
const param: string = route[key];
if ((param.indexOf(':') >= 0) || (param === currentRoute[key])) {
result = true;
}
else {
... | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
(key: any) => {
const param: string = route[key];
if ((param.indexOf(':') >= 0) || (param === currentRoute[key])) {
result = true;
}
else {
result = false;
}
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
(params: string[]): number => {
return this.auth.filter(item => {
const splited = item.split('/');
if (splited.length === params.length) {
if (this.combineParams(params, splited)) {
return item;
}
}
}).length;
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
item => {
const splited = item.split('/');
if (splited.length === params.length) {
if (this.combineParams(params, splited)) {
return item;
}
}
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
(params: string[]): number => {
return this.global.filter(item => {
const splited = item.split('/');
if (splited.length === params.length) {
if (this.combineParams(params, splited)) {
return item;
}
}
}).length;
... | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
(): void => {
const params = window.location.pathname.split('/');
const inAuth = this.checkAuth(params);
const inGlobal = this.checkGlobal(params);
if (!inAuth && !inGlobal) {
window.location.href = this.inPrivateRedirectTo;
}
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
ArrowFunction |
(): boolean|void => {
if (this.token.length) {
this.routesInSession();
}
else {
this.routesWithoutSession();
}
return true;
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
ClassDeclaration | /**
* Valida o acesso de rotas
* O que não estiver em auth ou global, será considerado rota privada
*/
class RoutesValidator {
private global: string[] = [];
private auth: string[] = [];
/**
* Caso esteja em uma rota de autenticação e sem permissão, para onde deve ser redirecionado?
*/
priv... | geeknection/js-routes-validator | src/index.ts | TypeScript |
InterfaceDeclaration |
export interface RoutesData {
global: string[],
auth: string[],
inAuthRedirectTo: string
inPrivateRedirectTo: string
} | geeknection/js-routes-validator | src/index.ts | TypeScript |
TypeAliasDeclaration |
export type DndSetSnoozeResponse = WebAPICallResult & {
ok?: boolean;
error?: string;
snooze_enabled?: boolean;
snooze_endtime?: number;
snooze_remaining?: number;
needed?: string;
provided?: string;
}; | alexjamesmalcolm/node-slack-sdk | packages/web-api/src/response/DndSetSnoozeResponse.ts | TypeScript |
ArrowFunction |
() => {
const { data: votes } = useVotes()
return (
<>
<EmbassyHeader selected="logbook" />
<div className="p-4">
<div className="block">
The embassy logbook records historical proposals.
</div>
<div className="block">
{votes?.completed.map((v, i) => {
... | EmblemStudio/Aavenluutn | react/src/pages/EmbassyLogbook.tsx | TypeScript |
ArrowFunction |
(v, i) => {
return (
<Expander text={v.summary} key={i}>
<VoteBox vote={v} key={i} />
</Expander> | EmblemStudio/Aavenluutn | react/src/pages/EmbassyLogbook.tsx | TypeScript |
ArrowFunction |
(attribute) => attribute.name | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
(linkedAttachment) => {
if (credentialPreviewAttributeNames.includes(linkedAttachment.attributeName)) {
throw new AriesFrameworkError(
`linkedAttachment ${linkedAttachment.attributeName} already exists in the preview`
)
} else {
const credentialPreviewAttribute = new Crede... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
(credentialValues, attribute) => {
return {
[attribute.name]: {
raw: attribute.value,
encoded: CredentialUtils.encode(attribute.value),
},
...credentialValues,
}
} | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
(value: unknown) => isString(value) && value === '' | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
(a) => a.name | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
(x) => !schemaAttributes.includes(x) | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
(x) => !credAttributes.includes(x) | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ClassDeclaration |
export class CredentialUtils {
/**
* Adds attribute(s) to the credential preview that is linked to the given attachment(s)
*
* @param attachments a list of the attachments that need to be linked to a credential
* @param preview the credential previews where the new linked credential has to be appended to... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration | /**
* Adds attribute(s) to the credential preview that is linked to the given attachment(s)
*
* @param attachments a list of the attachments that need to be linked to a credential
* @param preview the credential previews where the new linked credential has to be appended to
*
* @returns a modified ver... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration | /**
* Converts int value to string
* Converts string value:
* - hash with sha256,
* - convert to byte array and reverse it
* - convert it to BigInteger and return as a string
* @param attributes
*
* @returns CredValues
*/
public static convertAttributesToValues(attributes: CredentialPreviewAt... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration | /**
* Check whether the values of two credentials match (using {@link assertValuesMatch})
*
* @returns a boolean whether the values are equal
*
*/
public static checkValuesMatch(firstValues: CredValues, secondValues: CredValues): boolean {
try {
this.assertValuesMatch(firstValues, secondValues)... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration | /**
* Assert two credential values objects match.
*
* @param firstValues The first values object
* @param secondValues The second values object
*
* @throws If not all values match
*/
public static assertValuesMatch(firstValues: CredValues, secondValues: CredValues) {
const firstValuesKeys = Obj... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration | /**
* Check whether the raw value matches the encoded version according to the encoding format described in Aries RFC 0037
* Use this method to ensure the received proof (over the encoded) value is the same as the raw value of the data.
*
* @param raw
* @param encoded
* @returns Whether raw and encode... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration | /**
* Encode value according to the encoding format described in Aries RFC 0036/0037
*
* @param value
* @returns Encoded version of value
*
* @see https://github.com/hyperledger/aries-cloudagent-python/blob/0000f924a50b6ac5e6342bff90e64864672ee935/aries_cloudagent/messaging/util.py#L106-L136
* @see... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration |
public static checkAttributesMatch(schema: Schema, credentialPreview: V1CredentialPreview | V2CredentialPreview) {
const schemaAttributes = schema.attrNames
const credAttributes = credentialPreview.attributes.map((a) => a.name)
const difference = credAttributes
.filter((x) => !schemaAttributes.inclu... | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
MethodDeclaration |
private static isInt32(number: number) {
const minI32 = -2147483648
const maxI32 = 2147483647
// Check if number is integer and in range of int32
return Number.isInteger(number) && number >= minI32 && number <= maxI32
} | cryptstax/aries-framework-javascript | packages/core/src/modules/credentials/CredentialUtils.ts | TypeScript |
ArrowFunction |
() => {
const originalModule = jest.requireActual('../../../../lists_plugin_deps');
return {
...originalModule,
useFindLists: () => ({
loading: false,
start: mockStart.mockReturnValue(mockResult),
result: mockResult,
error: undefined,
}),
};
} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => ({
loading: false,
start: mockStart.mockReturnValue(mockResult),
result: mockResult,
error: undefined,
}) | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
test('it renders fields disabled if "isLoading" is "true"', () => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: undefined, operator: isOperator, value: undefined }}
entryIndex={0}
indexPattern={{
id: '1234',
title: 'logstash-*',
f... | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: undefined, operator: isOperator, value: undefined }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isOperator, value: '1234' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isNotOperator, value: '1234' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isOneOfOperator, value: ['1234'] }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isNotOneOfOperator, value: ['1234'] }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isInListOperator, value: 'some-list-id' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isNotInListOperator, value: 'some-list-id' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: existsOperator, value: undefined }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: doesNotExistOperator, value: undefined }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const mockOnChange = jest.fn();
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isOperator, value: '1234' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const mockOnChange = jest.fn();
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isNotOperator, value: '1234' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const mockOnChange = jest.fn();
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isOneOfOperator, value: '1234' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ArrowFunction |
() => {
const mockOnChange = jest.fn();
const wrapper = mount(
<EntryItemComponent
entry={{ field: getField('ip'), operator: isNotInListOperator, value: '1234' }} | alexk307/kibana | x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.test.tsx | TypeScript |
ClassDeclaration |
@Schema()
export class User {
@Prop({ required: true })
id: string;
@Prop({ required: true })
name: string;
} | flohlen/lightcontrol-backend | src/modules/builder/schemas/user.schema.ts | TypeScript |
ArrowFunction |
userData => {
sessionStorage.setItem('currentUser', JSON.stringify(userData));
sessionStorage.setItem('token', 'Bearer ' + userData.token);
this.currentUserSubject.next(userData);
return userData;
} | Akazan83/easy-work | src/app/shared/services/authentication.service.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root'
})
export class AuthenticationService {
public currentUser: Observable<User>;
private baseUrl = APP_CONFIG.apiUrl + '/api/auth';
private currentUserSubject: BehaviorSubject<User>;
constructor(private httpClient: HttpClient) {
this.currentUserSubject = new BehaviorSubjec... | Akazan83/easy-work | src/app/shared/services/authentication.service.ts | TypeScript |
MethodDeclaration |
public register(firstName: string, lastName: string, email: string, password: string){
return this.httpClient.post(`${this.baseUrl}/signup`, {firstName, lastName, email, password});
} | Akazan83/easy-work | src/app/shared/services/authentication.service.ts | TypeScript |
MethodDeclaration |
public login(email: string, password: string) {
return this.httpClient.post<User>(`${this.baseUrl}/signin`, {email, password})
.pipe(
map(userData => {
sessionStorage.setItem('currentUser', JSON.stringify(userData));
sessionStorage.setItem('token', 'Bearer ' + userData.token);
... | Akazan83/easy-work | src/app/shared/services/authentication.service.ts | TypeScript |
MethodDeclaration |
public logout() {
// remove user from local storage to log user out
sessionStorage.removeItem('currentUser');
this.currentUserSubject.next(null);
} | Akazan83/easy-work | src/app/shared/services/authentication.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class SchedulesUsersService {
constructor(
@InjectModel(SchedulesUsersEntity.name)
private schedulesUsers: Model<SchedulesUsersEntity>,
) {}
async create(scheduleUser: CreateSchedulesUsers, idUser: string) {
const { from, to, totalHours, location, date } = scheduleUser;
cons... | wilmion/kuks-fresh-backend | src/users/services/schedules-users.service.ts | TypeScript |
MethodDeclaration |
async create(scheduleUser: CreateSchedulesUsers, idUser: string) {
const { from, to, totalHours, location, date } = scheduleUser;
const newScheduleUser: CreateSchedulesUsers = {
...scheduleUser,
identifiquerShop: `${idUser}${from}${to}${totalHours}${location.city}${location.country}${location.direc... | wilmion/kuks-fresh-backend | src/users/services/schedules-users.service.ts | TypeScript |
MethodDeclaration |
async getSchedule(id: string) {
const schedule = await this.schedulesUsers
.findOne({ _id: id })
.populate('products')
.exec();
return schedule;
} | wilmion/kuks-fresh-backend | src/users/services/schedules-users.service.ts | TypeScript |
MethodDeclaration |
async updateSchedule(id: string, changes: UpdateSchedulesUsersDto) {
this.schedulesUsers
.findByIdAndUpdate(id, { $set: changes, new: true })
.exec();
return `Schedule Updated`;
} | wilmion/kuks-fresh-backend | src/users/services/schedules-users.service.ts | TypeScript |
MethodDeclaration |
async delete(id: string) {
await this.schedulesUsers.findByIdAndRemove(id);
return 'Schedule Removed';
} | wilmion/kuks-fresh-backend | src/users/services/schedules-users.service.ts | TypeScript |
ArrowFunction |
(expected: string): util.TapCallback => builder => {
const [, requiredPath] = builder.getMainLuaCodeChunk().match(requireRegex) ?? [];
expect(requiredPath).toBe(expected);
} | chrisd08/TypeScriptToLua | test/unit/modules/resolution.spec.ts | TypeScript |
ArrowFunction |
builder => {
const [, requiredPath] = builder.getMainLuaCodeChunk().match(requireRegex) ?? [];
expect(requiredPath).toBe(expected);
} | chrisd08/TypeScriptToLua | test/unit/modules/resolution.spec.ts | TypeScript |
ArrowFunction |
({ filePath, usedPath, expected, options }) => {
util.testModule`
import * as module from "${usedPath}";
module;
`
.setMainFileName(filePath)
.addExtraFile(`${usedPath}.ts`, "")
.setOptions(options)
.tap(expectToRequire(expected));
} | chrisd08/TypeScriptToLua | test/unit/modules/resolution.spec.ts | TypeScript |
ArrowFunction |
() => {
util.testModule`
import * as module from "../module";
module;
`
.setMainFileName("src/main.ts")
.setOptions({ rootDir: "./src" })
.disableSemanticCheck()
.expectDiagnosticsToMatchSnapshot([couldNotResolveRequire.code]);
} | chrisd08/TypeScriptToLua | test/unit/modules/resolution.spec.ts | TypeScript |
ArrowFunction |
({ declarationStatement, mainCode, expectedPath }) => {
util.testModule(mainCode)
.setMainFileName("src/main.ts")
.addExtraFile("module.d.ts", declarationStatement)
.tap(expectToRequire(expectedPath));
} | chrisd08/TypeScriptToLua | test/unit/modules/resolution.spec.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.