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 def = cdef!.getMethodDefinitions().getByName("method1"); expect(def).to.not.equal(undefined); expect(def!.getName()).to.equal("method1"); expect(def!.getVisibility()).to.equal(Visibility.Public); }); it("test, parser error", () => { 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
() => { 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!.getMethodDefinitions().getByName("method1"); expect(def).to.not.equal(undefined); expect(def!.getName()).to.equal("method1"); expect(def!.getVisibility()).to.equal(Visibility.Public); }
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!.getMethodDefinitions().getByName("method1"); expect(def).to.not.equal(undefined); expect(def!.getParameters().getImporting().length).to.equal(1); expect(def!.getParameters().getImporting()[0].getName()).to.equal("foo"); }); it("test, returning", () => { 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().getByName("method1"); expect(def).to.not.equal(undefined); const returning = def!.getParameters().getReturning(); expect(returning).to.not.equal(undefined); if (returning) { expect(returning.getName()).to.equal("rv_foo"); } }); }
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("method1"); expect(def).to.not.equal(undefined); expect(def!.getParameters().getImporting().length).to.equal(1); expect(def!.getParameters().getImporting()[0].getName()).to.equal("foo"); }
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().getByName("method1"); expect(def).to.not.equal(undefined); const returning = def!.getParameters().getReturning(); expect(returning).to.not.equal(undefined); if (returning) { expect(returning.getName()).to.equal("rv_foo"); } }
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()!.getInstance(); expect(instance.length).to.equal(1); expect(instance[0].getName()).to.equal("moo"); expect(instance[0].getVisibility()).to.equal(Visibility.Public); }); }
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).to.equal(1); expect(instance[0].getName()).to.equal("moo"); expect(instance[0].getVisibility()).to.equal(Visibility.Public); }
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 the model, for example version 1.01, 1.02, 1.03.</p> * @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { FraudDetectorClient, UpdateModelVersionCommand } from "../../client-frauddetector/mod.ts"; * // const { FraudDetectorClient, UpdateModelVersionCommand } = require("@aws-sdk/client-frauddetector"); // CommonJS import * const client = new FraudDetectorClient(config); * const command = new UpdateModelVersionCommand(input); * const response = await client.send(command); * ``` * * @see {@link UpdateModelVersionCommandInput} for command's `input` shape. * @see {@link UpdateModelVersionCommandOutput} for command's `response` shape. * @see {@link FraudDetectorClientResolvedConfig | config} for command's `input` shape. * */ export class UpdateModelVersionCommand extends $Command< UpdateModelVersionCommandInput, UpdateModelVersionCommandOutput, FraudDetectorClientResolvedConfig > { // Start section: command_properties // End section: command_properties constructor(readonly input: UpdateModelVersionCommandInput) { // Start section: command_constructor super(); // End section: command_constructor } /** * @internal */ resolveMiddleware( clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: FraudDetectorClientResolvedConfig, options?: __HttpHandlerOptions ): Handler<UpdateModelVersionCommandInput, UpdateModelVersionCommandOutput> { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "FraudDetectorClient"; const commandName = "UpdateModelVersionCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: UpdateModelVersionRequest.filterSensitiveLog, outputFilterSensitiveLog: UpdateModelVersionResult.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); } private serialize(input: UpdateModelVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> { return serializeAws_json1_1UpdateModelVersionCommand(input, context); } private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateModelVersionCommandOutput> { return deserializeAws_json1_1UpdateModelVersionCommand(output, context); } // Start section: command_body_extra // End section: command_body_extra }
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(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "FraudDetectorClient"; const commandName = "UpdateModelVersionCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: UpdateModelVersionRequest.filterSensitiveLog, outputFilterSensitiveLog: UpdateModelVersionResult.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); }
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(subscriptionTokenParseReducer(frameTimeFactor, maxFrame), { currentTimeFrame: 0, subscriptionFrame: Number.POSITIVE_INFINITY, unsubscriptionFrame: Number.POSITIVE_INFINITY, simultaneousGrouped: false, expandingTokenCount: 0, expandingValue: [], }); return value.unsubscriptionFrame === Number.POSITIVE_INFINITY ? new SubscriptionLog(value.subscriptionFrame) : new SubscriptionLog(value.subscriptionFrame, value.unsubscriptionFrame); }
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(adminConfig.contentful.maxage ?? '3000'); response.setHeader('Cache-Control', `public, s-maxage=${maxAge}, stale-while-revalidate=86400`); const limitQuery = request.query.limit as string | undefined; const limit = parseInt(limitQuery ?? TOTAL_LIMIT.toString()); const previewQuery = request.query.preview as string | undefined; let preview = false; if (previewQuery === 'true') { preview = true; } else { preview = false; } const slug = request.query.slug as string | undefined; if (slug == undefined || slug == '') { return response.status(500).json({ error: 'Invalid slug', }); } else { const entries = await fetchGraphQL( `query { personCollection(limit: 1, where: {slug: "${slug}"}, order: sys_firstPublishedAt_DESC) { items { displayName linkedFrom { blogPostCollection(limit:${limit ?? TOTAL_LIMIT}) { items { ${POSTFORLIST_GRAPHQL_FIELDS} } } } } } }`, preview, ); try { const result = extracter.extractPostForListsFromPerson(entries); if (result) { functions.logger.info(`Successfully fetched ${result.length} entries.`); return response.status(200).json(result); } else { return response.status(404).json({ error: 'Not found' }); } } catch (e) { return response.status(500).send(e); } } } else { return response.status(405).json({ error: 'Please use GET method', }); } }
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 warnings should be ignored */ ignoreLayoutWarnings: boolean; /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/ get isVertical(): boolean; set isVertical(value: boolean); /** * Gets or sets panel width. * This value should not be set when in horizontal mode as it will be computed automatically */ set width(value: string | number); get width(): string | number; /** * Gets or sets panel height. * This value should not be set when in vertical mode as it will be computed automatically */ set height(value: string | number); get height(): string | number; /** * Creates a new StackPanel * @param name defines control name */ constructor(name?: string | undefined); protected _getTypeName(): string; /** @hidden */ protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void; protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void; protected _postMeasure(): void; }
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 displayCategory = fields.labwareType if (isRegularLabware) { const totalLiquidVolume = fields.wellVolume const commonWellProperties = { depth: fields.wellDepth, totalLiquidVolume, } const wellProperties: LabwareWellProperties = fields.wellShape === 'circular' ? { ...commonWellProperties, shape: 'circular', diameter: fields.wellDiameter, } : { ...commonWellProperties, shape: 'rectangular', xDimension: fields.wellXDimension, yDimension: fields.wellYDimension, } // NOTE Ian 2019-07-29: Cannot use fields.labwareType, must be "96Standard", "384Standard", "trough", "irregular", or "trash". // Also note that 'irregular' in `format` just means "not 96/384 standard, not trough, and not trash", // it doesn't imply anything about having multiple grids or not. const format = 'irregular' let quirks: string[] = [] const heightOrDiameter = fields.wellShape === 'circular' ? fields.wellDiameter : fields.wellYDimension if (fields.gridRows === 1 && heightOrDiameter >= MULTI_CHANNEL_WIDTH_MM) { quirks = [...quirks, 'centerMultichannelOnWells', 'touchTipDisabled'] // Legacy API (v1) uses `lw_format == 'trough'` instead of centerMultichannelOnWells quirk. // HOWEVER, setting format to 'trough' also makes the well size zero, so you can't // position the tip to the edges of the labware. // Optimizing for the APIv1 labware test protocol (which is always with a single-channel) // over APIv1 protocol use, we'll AVOID setting the format to 'trough' here // // format = 'trough' // Uncomment to break test protocol but allow multichannel use in APIv1 } const brand = { brand: fields.brand, brandId: fields.brandId, // links: [] } const groupMetadataDisplayCategory = _getGroupMetadataDisplayCategory({ aluminumBlockChildType: fields.aluminumBlockChildType, labwareType: fields.labwareType, }) const def = createRegularLabware({ strict: false, metadata: { displayName, displayCategory, displayVolumeUnits: DISPLAY_VOLUME_UNITS, tags: [], // specifying tags is not yet supported }, parameters: { format, quirks, isTiprack: fields.labwareType === 'tipRack', // tipLength?: number, // Currently, assume labware is not magnetic module compatible. We don't have the information here. isMagneticModuleCompatible: false, // magneticModuleEngageHeight?: number, }, dimensions: { xDimension: fields.footprintXDimension, yDimension: fields.footprintYDimension, zDimension: fields.labwareZDimension, }, brand, version: 1, offset: { x: fields.gridOffsetX, y: fields.gridOffsetY, // NOTE: must give wells a z offset b/c `well.z = offset.z - wellDepth`. // We include well lip as part of Z dimension in Labware Creator's fields, // so labware's offset.z is the SAME as labwareZDimension. z: fields.labwareZDimension, }, grid: { column: fields.gridColumns, row: fields.gridRows, }, spacing: { column: fields.gridSpacingX, row: fields.gridSpacingY, }, well: wellProperties, // NOTE(IL, 2020-06-22): as per #5801, `group` should not include brand or displayName // unless the "wells" are different than the overall labware (eg NEST tubes in an opentrons rack/block). // Since LC doesn't allow the user to specify any of these 3 fields for wells themselves, we'll omit them // from the definition. group: { metadata: { wellBottomShape: fields.wellBottomShape, ...(groupMetadataDisplayCategory ? { displayCategory: groupMetadataDisplayCategory } : null), }, }, }) // overwrite loadName from createRegularLabware with ours def.parameters.loadName = fields.loadName return def } else { throw new Error('use of createIrregularLabware not yet implemented') // return createIrregularLabware({ TODO }) } }
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 = aluminumBlockChildType === 'pcrPlate' return childIsWellPlate ? 'wellPlate' : 'tubeRack' } return null }
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, '&amp;').replace(/</g, '&lt;').replace(/ /g, ' &nbsp;') 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 initialized to defaultOption when constructor is finished new FlipFlop( /* ON */() => { lineDiv.addEventListener("mouseenter", evhandler, true) }, /* OFF */() => { lineDiv.removeEventListener("mouseenter", evhandler, true); this.hideInfo() } ).bind(this, "enabled", true) var lineDiv = cm.display.lineDiv as HTMLDivElement this.lineDiv = lineDiv var tooltip = document.createElement("div"), tooltipContent = document.createElement("div"), tooltipIndicator = document.createElement("div") tooltip.setAttribute("style", "position:absolute;z-index:99") tooltip.setAttribute("class", "HyperMD-hover") tooltip.setAttribute("cm-ignore-events", "true") tooltipContent.setAttribute("class", "HyperMD-hover-content") tooltip.appendChild(tooltipContent) tooltipIndicator.setAttribute("class", "HyperMD-hover-indicator") tooltip.appendChild(tooltipIndicator) this.tooltipDiv = tooltip this.tooltipContentDiv = tooltipContent this.tooltipIndicator = tooltipIndicator const evhandler = this.mouseenter.bind(this) } private lineDiv: HTMLDivElement // CodeMirror's line container public tooltipDiv: HTMLDivElement public tooltipContentDiv: HTMLDivElement public tooltipIndicator: HTMLDivElement 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 (target.nodeName !== "SPAN" || !(mat = className.match(/(?:^|\s)cm-(hmd-barelink2?|hmd-footref2)(?:\s|$)/))) { this.hideInfo() return } var pos = cm.coordsChar({ left: ev.clientX, top: ev.clientY }, "window") let footnoteName = null var footnote: Link = null const hover_type = mat[1] // hmd-barelink|hmd-link-url-s var range = expandRange(cm, pos, hover_type) if (range) { footnoteName = cm.getRange(range.from, range.to) footnoteName = footnoteName.slice(1, -1) if (footnoteName) footnote = cm.hmdReadLink(footnoteName, pos.line) || null } var convertor = this.convertor || defaultConvertor var html = convertor(footnoteName, footnote && footnote.content || null) if (!html) { this.hideInfo() return } this.showInfo(html, target) } 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' this.lineDiv.appendChild(tdiv) var b3 = tdiv.getBoundingClientRect() if (b3.right > b2.right) { xOffset = b3.right - b2.right tdiv.style.left = (b1.left - b2.left - xOffset) + 'px' } tdiv.style.top = (b1.top - b2.top - b3.height) + 'px' this.tooltipIndicator.style.marginLeft = xOffset + 'px' } hideInfo() { if (this.tooltipDiv.parentElement == this.lineDiv) { this.lineDiv.removeChild(this.tooltipDiv) } } }
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. * * First parameter is the name of footnote (without square brackets), * and the second is footnote Markdown content (might be `null`, if not found). * This function shall returns HTML string or `null`. * * @see Convertor * @see defaultConvertor */ convertor: Convertor }
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?: OptionValueType }
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 (target.nodeName !== "SPAN" || !(mat = className.match(/(?:^|\s)cm-(hmd-barelink2?|hmd-footref2)(?:\s|$)/))) { this.hideInfo() return } var pos = cm.coordsChar({ left: ev.clientX, top: ev.clientY }, "window") let footnoteName = null var footnote: Link = null const hover_type = mat[1] // hmd-barelink|hmd-link-url-s var range = expandRange(cm, pos, hover_type) if (range) { footnoteName = cm.getRange(range.from, range.to) footnoteName = footnoteName.slice(1, -1) if (footnoteName) footnote = cm.hmdReadLink(footnoteName, pos.line) || null } var convertor = this.convertor || defaultConvertor var html = convertor(footnoteName, footnote && footnote.content || null) if (!html) { this.hideInfo() return } this.showInfo(html, target) }
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' this.lineDiv.appendChild(tdiv) var b3 = tdiv.getBoundingClientRect() if (b3.right > b2.right) { xOffset = b3.right - b2.right tdiv.style.left = (b1.left - b2.left - xOffset) + 'px' } tdiv.style.top = (b1.top - b2.top - b3.height) + 'px' this.tooltipIndicator.style.marginLeft = 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 () => { await screen[root](); }); beforeEach(async function () { await screen.loadModalFrame(); }); afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); await driver.resetApp(); await screen[root](); } }); after(async () => { await screen.closeModal(); await screen.loadedHome(); }); it("should show dialog confirm, run in background", async () => { await testDialogBackground(driver, screen); }); it("should run modal page with frame in background", async () => { await modalFrameBackground(driver, screen); }); it("should navigate to second page, run in background, go back", async () => { await testSecondPageBackground(driver, screen); }); it("should show nested modal page with frame, run in background, close", async () => { await testNestedModalFrameBackground(driver, screen); }); it("should show nested modal page, run in background, close", async () => { await testNestedModalPageBackground(driver, screen); }); it("should navigate to second page, close", async () => { await testSecondPageClose(driver, screen); }); it("should navigate to second page, run in background, go back", async () => { await testSecondPageBackground(driver, screen); }); }); }); }
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 () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); await driver.resetApp(); await screen[root](); } }); after(async () => { await screen.closeModal(); await screen.loadedHome(); }); it("should show dialog confirm, run in background", async () => { await testDialogBackground(driver, screen); }); it("should run modal page with frame in background", async () => { await modalFrameBackground(driver, screen); }); it("should navigate to second page, run in background, go back", async () => { await testSecondPageBackground(driver, screen); }); it("should show nested modal page with frame, run in background, close", async () => { await testNestedModalFrameBackground(driver, screen); }); it("should show nested modal page, run in background, close", async () => { await testNestedModalPageBackground(driver, screen); }); it("should navigate to second page, close", async () => { await testSecondPageClose(driver, screen); }); it("should navigate to second page, run in background, go back", async () => { await testSecondPageBackground(driver, screen); }); }); }
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") { await driver.logTestArtifacts(this.currentTest.title); await driver.resetApp(); await screen[root](); } }); after(async () => { await screen.closeModal(); await screen.loadedHome(); }); it("should show dialog confirm, run in background", async () => { await testDialogBackground(driver, screen); }); it("should run modal page with frame in background", async () => { await modalFrameBackground(driver, screen); }); it("should navigate to second page, run in background, go back", async () => { await testSecondPageBackground(driver, screen); }); it("should show nested modal page with frame, run in background, close", async () => { await testNestedModalFrameBackground(driver, screen); }); it("should show nested modal page, run in background, close", async () => { await testNestedModalPageBackground(driver, screen); }); it("should navigate to second page, close", async () => { await testSecondPageClose(driver, screen); }); it("should navigate to second page, run in background, go back", async () => { await testSecondPageBackground(driver, screen); }); }
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, // which could crash if the contract of the parser output changed. const hasPluginLoadedAlready = prettier .getSupportInfo() .languages.some((l) => l.name === 'svelte'); return hasPluginLoadedAlready ? [] : [require.resolve('prettier-plugin-svelte')]; }
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: LSConfigManager) {} async getDiagnostics(document: Document): Promise<Diagnostic[]> { if (!this.featureEnabled('diagnostics')) { return []; } return getDiagnostics( document, await this.getSvelteDoc(document), this.configManager.getConfig().svelte.compilerWarnings ); } async getCompiledResult(document: Document): Promise<SvelteCompileResult | null> { try { const svelteDoc = await this.getSvelteDoc(document); return svelteDoc.getCompiledWith({ generate: 'dom' }); } catch (error) { return null; } } 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 prettier and fall back to possible editor config const config = returnObjectIfHasKeys(await prettier.resolveConfig(filePath, { editorconfig: true })) || merge( {}, // merge into empty obj to not manipulate own config this.configManager.get('svelte.format.config'), returnObjectIfHasKeys(this.configManager.getPrettierConfig()) || // Be defensive here because IDEs other than VSCode might not have these settings (options && { tabWidth: options.tabSize, useTabs: !options.insertSpaces }) || {} ); // If user has prettier-plugin-svelte 1.x, then remove `options` from the sort // order or else it will throw a config error (`options` was not present back then). if ( config?.svelteSortOrder && getPackageInfo('prettier-plugin-svelte', filePath)?.version.major < 2 ) { config.svelteSortOrder = config.svelteSortOrder .replace('-options', '') .replace('options-', ''); } // Take .prettierignore into account const fileInfo = await prettier.getFileInfo(filePath, { ignorePath: this.configManager.getPrettierConfig()?.ignorePath ?? '.prettierignore', // Sapper places stuff within src/node_modules, we want to format that, too withNodeModules: true }); if (fileInfo.ignored) { Logger.log('File is ignored, formatting skipped'); return []; } const formattedCode = prettier.format(document.getText(), { ...config, plugins: getSveltePlugin(), parser: 'svelte' as any }); return [ TextEdit.replace( Range.create(document.positionAt(0), document.positionAt(document.getTextLength())), formattedCode ) ]; 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, // which could crash if the contract of the parser output changed. const hasPluginLoadedAlready = prettier .getSupportInfo() .languages.some((l) => l.name === 'svelte'); return hasPluginLoadedAlready ? [] : [require.resolve('prettier-plugin-svelte')]; } function returnObjectIfHasKeys<T>(obj: T | undefined): T | undefined { if (Object.keys(obj || {}).length > 0) { return obj; } } } async getCompletions(document: Document, position: Position): Promise<CompletionList | null> { if (!this.featureEnabled('completions')) { return null; } return getCompletions(await this.getSvelteDoc(document), position); } async doHover(document: Document, position: Position): Promise<Hover | null> { if (!this.featureEnabled('hover')) { return null; } return getHoverInfo(await this.getSvelteDoc(document), position); } async getCodeActions( document: Document, range: Range, context: CodeActionContext ): Promise<CodeAction[]> { if (!this.featureEnabled('codeActions')) { return []; } const svelteDoc = await this.getSvelteDoc(document); try { return getCodeActions(svelteDoc, range, context); } catch (error) { return []; } } 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 { return executeCommand(svelteDoc, command, args); } catch (error) { return null; } } async getSelectionRange( document: Document, position: Position ): Promise<SelectionRange | null> { if (!this.featureEnabled('selectionRange')) { return null; } const svelteDoc = await this.getSvelteDoc(document); return getSelectionRange(svelteDoc, position); } private featureEnabled(feature: keyof LSSvelteConfig) { return ( this.configManager.enabled('svelte.enable') && this.configManager.enabled(`svelte.${feature}.enable`) ); } 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, svelteDoc); } return svelteDoc; } }
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 prettier and fall back to possible editor config const config = returnObjectIfHasKeys(await prettier.resolveConfig(filePath, { editorconfig: true })) || merge( {}, // merge into empty obj to not manipulate own config this.configManager.get('svelte.format.config'), returnObjectIfHasKeys(this.configManager.getPrettierConfig()) || // Be defensive here because IDEs other than VSCode might not have these settings (options && { tabWidth: options.tabSize, useTabs: !options.insertSpaces }) || {} ); // If user has prettier-plugin-svelte 1.x, then remove `options` from the sort // order or else it will throw a config error (`options` was not present back then). if ( config?.svelteSortOrder && getPackageInfo('prettier-plugin-svelte', filePath)?.version.major < 2 ) { config.svelteSortOrder = config.svelteSortOrder .replace('-options', '') .replace('options-', ''); } // Take .prettierignore into account const fileInfo = await prettier.getFileInfo(filePath, { ignorePath: this.configManager.getPrettierConfig()?.ignorePath ?? '.prettierignore', // Sapper places stuff within src/node_modules, we want to format that, too withNodeModules: true }); if (fileInfo.ignored) { Logger.log('File is ignored, formatting skipped'); return []; } const formattedCode = prettier.format(document.getText(), { ...config, plugins: getSveltePlugin(), parser: 'svelte' as any }); return [ TextEdit.replace( Range.create(document.positionAt(0), document.positionAt(document.getTextLength())), formattedCode ) ]; 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, // which could crash if the contract of the parser output changed. const hasPluginLoadedAlready = prettier .getSupportInfo() .languages.some((l) => l.name === 'svelte'); return hasPluginLoadedAlready ? [] : [require.resolve('prettier-plugin-svelte')]; } 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
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 getCodeActions(svelteDoc, range, context); } catch (error) { return []; } }
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 { return executeCommand(svelteDoc, command, args); } catch (error) { return null; } }
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, position); }
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, svelteDoc); } return svelteDoc; }
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.length - i - 1) } return convertedDecimal }
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: number, itemModifier: string[], itemExtras: Item[], itemIsExtra: boolean, itemLocation: number ) { this.itemId = itemId; this.itemName = itemName; this.itemSize = itemSize; this.itemCost = itemCost; this.itemModifier = itemModifier; this.itemExtras = itemExtras; this.itemIsExtra = itemIsExtra; this.itemLocation = itemLocation; } }
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]), expectedReply ); }); testUtils.testWithClient('client.geoRadiusByMemberRoWith', async client => { assert.deepEqual( await client.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusByMemberRoWith', async cluster => { assert.deepEqual( await cluster.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.CLUSTERS.OPEN); }
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"], ]); writeStream.pipe(fileStream); writeStream.on("error", reject); fileStream.on("error", reject); fileStream.on("finish", () => { 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
() => { 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.deepEqual(rows, [ ["One", "Two", "Three"], ["Four", "Five", "Six"], ["Seven", "Eight", "Nine"], ]); resolve(); }); }
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, description: command.description, args: Object.values(command.definition.arguments).map( (argument: Argument) => { return { name: argument.name, description: argument.description, isOptional: !argument.is_required, }; } ), options: Object.values(command.definition.options).map( (option: Option) => { const names = [option.name]; if (option.shortcut !== "") { names.push(option.shortcut); } return { name: names, description: option.description, }; } ), }); }); } catch (err) { console.error(err); } return { name: "please", debounce: true, subcommands, }; }
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.description, isOptional: !argument.is_required, }; } ), options: Object.values(command.definition.options).map( (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
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