type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(_data, onSuccess) => setTimeout(onSuccess, 500) | kelvah/app-services-ui-components | src/Kafka/CreateKafkaInstanceWithSizes/Stories/FormProcessing.stories.tsx | TypeScript |
ArrowFunction |
() => {
// Doing nothing to showcase the loading
} | kelvah/app-services-ui-components | src/Kafka/CreateKafkaInstanceWithSizes/Stories/FormProcessing.stories.tsx | TypeScript |
FunctionDeclaration |
function run(reg: IRegistry): IInterfaceDefinition | undefined {
const intf = getABAPObjects(reg)[0] as Interface;
const s = new SyntaxLogic(reg, intf).run().spaghetti;
const scope = s.getTop().getFirstChild();
return scope?.findInterfaceDefinition(intf.getName());
} | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
it("test, positive", () => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" METHODS method1.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const cdef = run(reg);
expect(cdef).to.not.equal(undefined);
const ... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" METHODS method1.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const cdef = run(reg);
expect(cdef).to.not.equal(undefined);
const def = cdef!.getMethodDefinition... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", "parser error")).parse();
const def = run(reg);
expect(def).to.equal(undefined);
} | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
it("test, positive", () => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" METHODS method1 IMPORTING foo TYPE i.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const cdef = run(reg);
const def = cdef!.getMethod... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" METHODS method1 IMPORTING foo TYPE i.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const cdef = run(reg);
const def = cdef!.getMethodDefinitions().getByName("method... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" METHODS method1 RETURNING VALUE(rv_foo) TYPE i.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const cdef = run(reg);
const def = cdef!.getMethodDefinitions().getByNa... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
it("test, positive", () => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" DATA moo TYPE i.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const def = run(reg);
const instance = def!.getAttributes()!.getInstanc... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
ArrowFunction |
() => {
const abap = "INTERFACE zif_foobar PUBLIC.\n" +
" DATA moo TYPE i.\n" +
"ENDINTERFACE.";
const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
const def = run(reg);
const instance = def!.getAttributes()!.getInstance();
expect(instance.length... | FreHu/abaplint | packages/core/test/abap/types/interface_definition.ts | TypeScript |
FunctionDeclaration |
export function createDeserializationError(
message: string,
response: Response
): DeserializationError {
return {
name: 'DeserializationError',
message,
response,
};
} | clinia/clinia-client-javascript | packages/transporter/src/errors/createDeserializationError.ts | TypeScript |
FunctionDeclaration |
export function useItemsDB() {
return usePromised(itemsDatabaseV3);
} | jokester/momocra | frontend/src/components/hooks/use-items-db.ts | TypeScript |
ClassDeclaration | /**
* <p>Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of... | Autoskaler/aws-sdk-js-v3 | deno/client-frauddetector/commands/UpdateModelVersionCommand.ts | TypeScript |
InterfaceDeclaration |
export interface UpdateModelVersionCommandInput extends UpdateModelVersionRequest {} | Autoskaler/aws-sdk-js-v3 | deno/client-frauddetector/commands/UpdateModelVersionCommand.ts | TypeScript |
InterfaceDeclaration |
export interface UpdateModelVersionCommandOutput extends UpdateModelVersionResult, __MetadataBearer {} | Autoskaler/aws-sdk-js-v3 | deno/client-frauddetector/commands/UpdateModelVersionCommand.ts | TypeScript |
MethodDeclaration | /**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: FraudDetectorClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UpdateModelVersionCommandInput, UpdateModelVersionCommandOutput> {
this.middlewareStack.use(getSe... | Autoskaler/aws-sdk-js-v3 | deno/client-frauddetector/commands/UpdateModelVersionCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: UpdateModelVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1UpdateModelVersionCommand(input, context);
} | Autoskaler/aws-sdk-js-v3 | deno/client-frauddetector/commands/UpdateModelVersionCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateModelVersionCommandOutput> {
return deserializeAws_json1_1UpdateModelVersionCommand(output, context);
} | Autoskaler/aws-sdk-js-v3 | deno/client-frauddetector/commands/UpdateModelVersionCommand.ts | TypeScript |
ArrowFunction |
({
post,
displayFull = false,
asLink = true,
showLike = true,
showComment = true,
showTimer = true,
showShare = true,
showMore = false,
}: Props) => {
return (
<article className={`${displayFull ? "w-full h-full flex flex-col" : ""}`} | its-bananas/yours-sincerely | app/lib/post/ui/PostContent.tsx | TypeScript |
TypeAliasDeclaration |
type Props = {
post: Post;
displayFull?: boolean;
asLink?: boolean;
showLike?: boolean;
showComment?: boolean;
showTimer?: boolean;
showShare?: boolean;
showMore?: boolean;
}; | its-bananas/yours-sincerely | app/lib/post/ui/PostContent.tsx | TypeScript |
MethodDeclaration |
asLink ? (
<Link
className="block text-slate-900 hover:no-underline dark:text-slate-50"
to={`/posts/${post.id}` | its-bananas/yours-sincerely | app/lib/post/ui/PostContent.tsx | TypeScript |
ArrowFunction |
(marble: string | null, frameTimeFactor: number = 1, maxFrame = 1000) => {
if (!marble) {
return new SubscriptionLog(Number.POSITIVE_INFINITY);
}
const marbleTokenArray = Array.from(marble).filter((token) => token !== ObservableMarbleToken.NOOP);
const value = marbleTokenArray.reduce(subscriptionTokenPars... | selangley-wa/rx-sandbox | src/marbles/parseSubscriptionMarble.ts | TypeScript |
ArrowFunction |
(token) => token !== ObservableMarbleToken.NOOP | selangley-wa/rx-sandbox | src/marbles/parseSubscriptionMarble.ts | TypeScript |
ArrowFunction |
async (request, response: any) => {
const secret = request.headers.authorization as string | undefined;
if (secret !== adminConfig.napoancom.auth) {
return response.status(401).json({
message: 'Invalid token',
});
}
if (request.method == 'GET') {
const maxAge = parseInt(admi... | aelyone/napoancom-next | functions/src/contentful/getAllPostsForPerson.ts | TypeScript |
ClassDeclaration | /**
* Class used to create a 2D stack panel container
*/
export declare class StackPanel extends Container {
name?: string | undefined;
private _isVertical;
private _manualWidth;
private _manualHeight;
private _doNotTrackManualChanges;
/**
* Gets or sets a boolean indicating that layou wa... | codingwatching/Galactica-Source | node_modules/@babylonjs/gui/2D/controls/stackPanel.d.ts | TypeScript |
MethodDeclaration |
protected _getTypeName(): string; | codingwatching/Galactica-Source | node_modules/@babylonjs/gui/2D/controls/stackPanel.d.ts | TypeScript |
MethodDeclaration | /** @hidden */
protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void; | codingwatching/Galactica-Source | node_modules/@babylonjs/gui/2D/controls/stackPanel.d.ts | TypeScript |
MethodDeclaration |
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void; | codingwatching/Galactica-Source | node_modules/@babylonjs/gui/2D/controls/stackPanel.d.ts | TypeScript |
MethodDeclaration |
protected _postMeasure(): void; | codingwatching/Galactica-Source | node_modules/@babylonjs/gui/2D/controls/stackPanel.d.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [ RouterModule.forChild(routes) ],
exports: [ RouterModule ]
})
export class LibRoutingModule {} | praveenpv1/ecaps-Fe | projects/sales/src/lib/lib-routing.module.ts | TypeScript |
FunctionDeclaration |
export function fieldsToLabware(
fields: ProcessedLabwareFields
): LabwareDefinition2 {
// NOTE Ian 2019-07-27: only the 15-50-esque tube rack has multiple grids,
// and it is not supported in labware creator. So all are regular.
const isRegularLabware = true
const { displayName } = fields
const displayCat... | Corey-ONeal/opentrons-app_ws-remote | labware-library/src/labware-creator/fieldsToLabware.ts | TypeScript |
ArrowFunction |
(args: {
aluminumBlockChildType: string | null | undefined
labwareType: string
}): LabwareDisplayCategory | null => {
const { aluminumBlockChildType, labwareType } = args
if (labwareType === 'tubeRack') {
return 'tubeRack'
} else if (labwareType === 'aluminumBlock') {
const childIsWellPlate = aluminu... | Corey-ONeal/opentrons-app_ws-remote | labware-library/src/labware-creator/fieldsToLabware.ts | TypeScript |
FunctionDeclaration | /** if `marked` exists, use it; else, return safe html */
export function defaultConvertor(footnote: string, text: string): string {
if (!text) return null
return markdownToHTML(text)
} | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
ArrowFunction |
(text: string) => {
text = text.replace(/&/g, '&').replace(/</g, '<').replace(/ /g, ' ')
return "<pre>" + text + "</pre>"
} | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
ArrowFunction | /* ON */
() => { lineDiv.addEventListener("mouseenter", evhandler, true) } | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
ArrowFunction | /* OFF */
() => { lineDiv.removeEventListener("mouseenter", evhandler, true); this.hideInfo() } | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
ClassDeclaration | //#endregion
/********************************************************************************** */
//#region Addon Class
export class Hover implements Addon.Addon, Options /* if needed */ {
xOffset: number;
convertor: Convertor;
enabled: boolean;
constructor(public cm: cm_t) {
// options will be initializ... | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
InterfaceDeclaration | /********************************************************************************** */
//#region Addon Options
export interface Options extends Addon.AddonOptions {
/** Enable Hover features or not. */ // TODO: write doc here
enabled: boolean
xOffset: number
/**
* function to decide the tooltip's content.
... | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
InterfaceDeclaration |
interface EditorConfiguration {
/**
* Options for Hover.
*
* You may also provide a `false` to disable it;
* a `true` to enable it with defaultOption (except `enabled`);
* or a Convertor to decide the content of tooltip.
*
* @see Convertor
*/
hmdHover... | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
InterfaceDeclaration |
interface HelperCollection { Hover?: Hover } | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
TypeAliasDeclaration | /********************************************************************************** */
/** convert footnote text into HTML. Note that `markdown` may be empty and you may return `null` to supress the tooltip */
export type Convertor = (footnote: string, markdown: string) => string | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
TypeAliasDeclaration |
export type OptionValueType = Partial<Options> | boolean | Convertor; | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
MethodDeclaration |
mouseenter(ev: MouseEvent) {
var cm = this.cm, target = ev.target as HTMLElement
var className = target.className
if (target == this.tooltipDiv || (target.compareDocumentPosition && (target.compareDocumentPosition(this.tooltipDiv) & 8) == 8)) {
return
}
var mat: RegExpMatchArray
if (targ... | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
MethodDeclaration |
showInfo(html: string, relatedTo: HTMLElement) {
const b1 = relatedTo.getBoundingClientRect()
const b2 = this.lineDiv.getBoundingClientRect()
const tdiv = this.tooltipDiv
var xOffset = this.xOffset
this.tooltipContentDiv.innerHTML = html
tdiv.style.left = (b1.left - b2.left - xOffset) + 'px'
... | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
MethodDeclaration |
hideInfo() {
if (this.tooltipDiv.parentElement == this.lineDiv) {
this.lineDiv.removeChild(this.tooltipDiv)
}
} | GGICE/HyperMD | src/addon/hover.ts | TypeScript |
ArrowFunction |
async ({ context: sequelize }: UmzugContext) => {
logMigrationStart('up', migrationName);
await sequelize.getQueryInterface().bulkInsert(tableName, config);
logMigrationEnd('up', migrationName);
} | paolocattani/Calcetto | server/database/migrations/scripts/04_insert_config.migration.ts | TypeScript |
ArrowFunction |
async ({ context: sequelize }: UmzugContext) => {
logMigrationStart('down', migrationName);
await sequelize.getQueryInterface().bulkDelete(tableName, { key: config.map((c) => c.key!) });
logMigrationEnd('down', migrationName);
} | paolocattani/Calcetto | server/database/migrations/scripts/04_insert_config.migration.ts | TypeScript |
ArrowFunction |
(c) => c.key! | paolocattani/Calcetto | server/database/migrations/scripts/04_insert_config.migration.ts | TypeScript |
ArrowFunction |
() => {
let driver: AppiumDriver;
let screen: Screen;
before(async () => {
driver = await createDriver();
screen = new Screen(driver);
});
roots.forEach(root => {
describe(`${root} modal frame background scenarios:`, () => {
before(async () => {
... | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
driver = await createDriver();
screen = new Screen(driver);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
root => {
describe(`${root} modal frame background scenarios:`, () => {
before(async () => {
await screen[root]();
});
beforeEach(async function () {
await screen.loadModalFrame();
});
afterEach(async function () {
... | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
() => {
before(async () => {
await screen[root]();
});
beforeEach(async function () {
await screen.loadModalFrame();
});
afterEach(async function () {
if (this.currentTest.state === "failed") {
... | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await screen[root]();
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await screen.closeModal();
await screen.loadedHome();
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await testDialogBackground(driver, screen);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await modalFrameBackground(driver, screen);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await testSecondPageBackground(driver, screen);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await testNestedModalFrameBackground(driver, screen);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await testNestedModalPageBackground(driver, screen);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
ArrowFunction |
async () => {
await testSecondPageClose(driver, screen);
} | DarkFox119/sa | e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts | TypeScript |
FunctionDeclaration |
function getSveltePlugin() {
// Only provide our version of the svelte plugin if the user doesn't have one in
// the workspace already. If we did it, Prettier would - for some reason - use
// the workspace version for parsing and the extension version for printing,
// wh... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
FunctionDeclaration |
function returnObjectIfHasKeys<T>(obj: T | undefined): T | undefined {
if (Object.keys(obj || {}).length > 0) {
return obj;
}
} | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
ArrowFunction |
(l) => l.name === 'svelte' | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
ClassDeclaration |
export class SveltePlugin
implements
DiagnosticsProvider,
FormattingProvider,
CompletionsProvider,
HoverProvider,
CodeActionsProvider,
SelectionRangeProvider
{
private docManager = new Map<Document, SvelteDocument>();
constructor(private configManager: LSCon... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async getDiagnostics(document: Document): Promise<Diagnostic[]> {
if (!this.featureEnabled('diagnostics')) {
return [];
}
return getDiagnostics(
document,
await this.getSvelteDoc(document),
this.configManager.getConfig().svelte.compilerWarnings
... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async getCompiledResult(document: Document): Promise<SvelteCompileResult | null> {
try {
const svelteDoc = await this.getSvelteDoc(document);
return svelteDoc.getCompiledWith({ generate: 'dom' });
} catch (error) {
return null;
}
} | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async formatDocument(document: Document, options: FormattingOptions): Promise<TextEdit[]> {
if (!this.featureEnabled('format')) {
return [];
}
const filePath = document.getFilePath()!;
const prettier = importPrettier(filePath);
// Try resolving the config through pr... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async getCompletions(document: Document, position: Position): Promise<CompletionList | null> {
if (!this.featureEnabled('completions')) {
return null;
}
return getCompletions(await this.getSvelteDoc(document), position);
} | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async doHover(document: Document, position: Position): Promise<Hover | null> {
if (!this.featureEnabled('hover')) {
return null;
}
return getHoverInfo(await this.getSvelteDoc(document), position);
} | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async getCodeActions(
document: Document,
range: Range,
context: CodeActionContext
): Promise<CodeAction[]> {
if (!this.featureEnabled('codeActions')) {
return [];
}
const svelteDoc = await this.getSvelteDoc(document);
try {
return ge... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async executeCommand(
document: Document,
command: string,
args?: any[]
): Promise<WorkspaceEdit | string | null> {
if (!this.featureEnabled('codeActions')) {
return null;
}
const svelteDoc = await this.getSvelteDoc(document);
try {
r... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
async getSelectionRange(
document: Document,
position: Position
): Promise<SelectionRange | null> {
if (!this.featureEnabled('selectionRange')) {
return null;
}
const svelteDoc = await this.getSvelteDoc(document);
return getSelectionRange(svelteDoc, pos... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
private featureEnabled(feature: keyof LSSvelteConfig) {
return (
this.configManager.enabled('svelte.enable') &&
this.configManager.enabled(`svelte.${feature}.enable`)
);
} | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
MethodDeclaration |
private async getSvelteDoc(document: Document) {
let svelteDoc = this.docManager.get(document);
if (!svelteDoc || svelteDoc.version !== document.version) {
svelteDoc?.destroyTranspiled();
svelteDoc = new SvelteDocument(document);
this.docManager.set(document, svelteD... | dogagenc/language-tools | packages/language-server/src/plugins/svelte/SveltePlugin.ts | TypeScript |
ArrowFunction |
() => console.log('done') | YoeriVD/stryker | integrationTest/test/use-stryker-programmatically/usingStryker.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class SampleRoutingModule { } | cvisb/cvisb_data | sample-viewer/src/app/sample/sample-routing.module.ts | TypeScript |
FunctionDeclaration |
export default function binaryToDecimal(binary: string): number {
const binaryDigits = String(binary)
.split('')
.map(digit => Number(digit))
let convertedDecimal = 0
for (let i = 0; i < binaryDigits.length; i += 1) {
const digit = binaryDigits[i]
convertedDecimal += digit * 2 ** (binaryDigits... | igooralm192/bin2dec | src/utils/binaryToDecimal.ts | TypeScript |
ArrowFunction |
digit => Number(digit) | igooralm192/bin2dec | src/utils/binaryToDecimal.ts | TypeScript |
ArrowFunction |
({theme}) => theme.fonts.regular | emffor/gofinances | src/components/Form/Input/styles.ts | TypeScript |
ArrowFunction |
({theme}) => theme.colors.text_dark | emffor/gofinances | src/components/Form/Input/styles.ts | TypeScript |
ArrowFunction |
({theme}) => theme.colors.shape | emffor/gofinances | src/components/Form/Input/styles.ts | TypeScript |
ClassDeclaration |
export class Item {
itemId: number;
itemName: string;
itemSize: string;
itemCost: number;
itemModifier: string[];
itemExtras: Item[]
itemIsExtra: boolean;
itemLocation: number;
constructor(
itemId:number,
itemName: string,
itemSize: string,
itemCost:... | Barfly-Systems/Mobile-App | src/app/models/item.model.ts | TypeScript |
ArrowFunction |
() => {
it('transformArguments', () => {
const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm', 'WITHDIST'];
expectedReply.preserve = ['WITHDIST'];
assert.deepEqual(
transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),... | 10088/node-redis | packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.spec.ts | TypeScript |
ArrowFunction |
() => {
const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm', 'WITHDIST'];
expectedReply.preserve = ['WITHDIST'];
assert.deepEqual(
transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
expectedReply
);... | 10088/node-redis | packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.spec.ts | TypeScript |
ArrowFunction |
async client => {
assert.deepEqual(
await client.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
[]
);
} | 10088/node-redis | packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.spec.ts | TypeScript |
ArrowFunction |
async cluster => {
assert.deepEqual(
await cluster.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
[]
);
} | 10088/node-redis | packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.spec.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
const path = __dirname + "/test-output.csv";
const fileStream = fs.createWriteStream(path, "utf8");
const writeStream = (new csv.Writer()).stream([
["One", "Two", "Three"],
["Four", "Five", "Six"],
["Seven", "Eight", "Nine"],
])... | pineapplemachine/4180 | test/canary-test.ts | TypeScript |
ArrowFunction |
() => {
fileStream.end();
const data = fs.readFileSync(path, "utf8");
assert.equal(data, (
"One,Two,Three\r\n" +
"Four,Five,Six\r\n" +
"Seven,Eight,Nine\r\n"
));
resolve();
} | pineapplemachine/4180 | test/canary-test.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
const path = __dirname + "/../../test/test.csv";
const fileStream = fs.createReadStream(path, "utf8");
fileStream.on("error", reject);
fileStream.on("readable", () => {
const rows = (new csv.Parser()).parse(fileStream).rows();
assert.deepEq... | pineapplemachine/4180 | test/canary-test.ts | TypeScript |
ArrowFunction |
() => {
const rows = (new csv.Parser()).parse(fileStream).rows();
assert.deepEqual(rows, [
["One", "Two", "Three"],
["Four", "Five", "Six"],
["Seven", "Eight", "Nine"],
]);
resolve();
} | pineapplemachine/4180 | test/canary-test.ts | TypeScript |
ArrowFunction |
async (tokens, executeShellCommand) => {
const out = await executeShellCommand("php please list --format=json");
const subcommands = [];
try {
const commandDefinition = JSON.parse(out);
commandDefinition.commands.map((command) => {
subcommands.push({
name: command.name,
... | 6ui11em/autocomplete | src/php/please.ts | TypeScript |
ArrowFunction |
(command) => {
subcommands.push({
name: command.name,
description: command.description,
args: Object.values(command.definition.arguments).map(
(argument: Argument) => {
return {
name: argument.name,
description: argument.d... | 6ui11em/autocomplete | src/php/please.ts | TypeScript |
ArrowFunction |
(argument: Argument) => {
return {
name: argument.name,
description: argument.description,
isOptional: !argument.is_required,
};
} | 6ui11em/autocomplete | src/php/please.ts | TypeScript |
ArrowFunction |
(option: Option) => {
const names = [option.name];
if (option.shortcut !== "") {
names.push(option.shortcut);
}
return {
name: names,
description: option.description,
};
} | 6ui11em/autocomplete | src/php/please.ts | TypeScript |
InterfaceDeclaration |
interface Argument {
name: string;
is_required: boolean;
is_array: boolean;
description: string;
default: string;
} | 6ui11em/autocomplete | src/php/please.ts | TypeScript |
InterfaceDeclaration |
interface Option {
name: string;
shortcut: string;
accept_value: boolean;
is_value_required: boolean;
is_multiple: false;
description: string;
default: string;
} | 6ui11em/autocomplete | src/php/please.ts | TypeScript |
FunctionDeclaration |
declare function expect(val: any): ExpectWithIs; | DanielRosenwasser/immutable-js | __tests__/Set.ts | TypeScript |
ArrowFunction |
() => {
var s = Set([1,2,3]);
expect(s.has(1)).toBe(true);
expect(s.has(2)).toBe(true);
expect(s.has(3)).toBe(true);
expect(s.has(4)).toBe(false);
} | DanielRosenwasser/immutable-js | __tests__/Set.ts | TypeScript |
ArrowFunction |
() => {
var s = Set({ 'length': 3, '1': 2 });
expect(s.size).toBe(2)
expect(s.has(undefined)).toBe(true);
expect(s.has(2)).toBe(true);
expect(s.has(1)).toBe(false);
} | DanielRosenwasser/immutable-js | __tests__/Set.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.