type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
EnumDeclaration
enum HTTP_RES_DATA_TYPE { JSON = 0, RAW_DATA = 1 }
sunwenteng/bgserver
src/lib/util/game_util.ts
TypeScript
MethodDeclaration
run() { if (this._isForceQuit || this.terminateCallBack()) { return; } setTimeout(() => { this._isRunning = true; this.promise.apply(this.promiseScope) .then(() => { this._isRunning = false; this.run(); }) .catch((e) => { Log.sError(e); if (!this.bOnExceptionQuit) { this._isRunning = false; this.run(); } }); }, this.interval); }
sunwenteng/bgserver
src/lib/util/game_util.ts
TypeScript
MethodDeclaration
async stop() { this._isForceQuit = true; return new Promise<void>(((resolve) => { if (this._isRunning) { setTimeout(() => { this.stop().then(resolve); }, 100); } else { resolve(); } })); }
sunwenteng/bgserver
src/lib/util/game_util.ts
TypeScript
ClassDeclaration
@Component({ moduleId: module.id, selector: "schema-type", templateUrl: "schema-type.component.html" }) export class SchemaTypeComponent { @Input() type: SimplifiedType; public displayType(): string { if (ObjectUtils.isNullOrUndefined(this.type) || ObjectUtils.isNullOrUndefined(this.type.type)) { return "No Type"; } if (this.type.isArray()) { if (this.type.of && this.type.of.as) { return "Array of: " + this.type.of.type + " as " + this.type.of.as; } if (this.type.of && this.type.of.isSimpleType()) { return "Array of: " + this.type.of.type; } if (this.type.of && this.type.of.isRef()) { return "Array of: " + this.type.of.type.substr(this.type.of.type.lastIndexOf('/') + 1); } } if (this.type.isSimpleType()) { if (this.type.as) { return this.type.type + " as " + this.type.as; } else { return this.type.type; } } if (this.type.isRef()) { return this.type.type.substr(this.type.type.lastIndexOf('/') + 1); } return "Unknown Type"; } public hasType(): boolean { return !ObjectUtils.isNullOrUndefined(this.type.type); } }
gigaga/apicurio-studio
front-end/studio/src/app/pages/apis/{apiId}/editor/_components/common/schema-type.component.ts
TypeScript
MethodDeclaration
public displayType(): string { if (ObjectUtils.isNullOrUndefined(this.type) || ObjectUtils.isNullOrUndefined(this.type.type)) { return "No Type"; } if (this.type.isArray()) { if (this.type.of && this.type.of.as) { return "Array of: " + this.type.of.type + " as " + this.type.of.as; } if (this.type.of && this.type.of.isSimpleType()) { return "Array of: " + this.type.of.type; } if (this.type.of && this.type.of.isRef()) { return "Array of: " + this.type.of.type.substr(this.type.of.type.lastIndexOf('/') + 1); } } if (this.type.isSimpleType()) { if (this.type.as) { return this.type.type + " as " + this.type.as; } else { return this.type.type; } } if (this.type.isRef()) { return this.type.type.substr(this.type.type.lastIndexOf('/') + 1); } return "Unknown Type"; }
gigaga/apicurio-studio
front-end/studio/src/app/pages/apis/{apiId}/editor/_components/common/schema-type.component.ts
TypeScript
MethodDeclaration
public hasType(): boolean { return !ObjectUtils.isNullOrUndefined(this.type.type); }
gigaga/apicurio-studio
front-end/studio/src/app/pages/apis/{apiId}/editor/_components/common/schema-type.component.ts
TypeScript
FunctionDeclaration
export function bytesToHuman (bytes: number): string { if (bytes === 0) { return '0 kB'; } const i = Math.floor(Math.log(bytes) / Math.log(1000)); // @ts-ignore return `${(bytes / Math.pow(1000, i)).toFixed(2) * 1} ${['Bytes', 'kB', 'MB', 'GB', 'TB'][i]}`; }
BirkhoffLee/panel
resources/scripts/helpers.ts
TypeScript
ArrowFunction
(bytes: number) => Math.floor(bytes / 1000 / 1000)
BirkhoffLee/panel
resources/scripts/helpers.ts
TypeScript
ClassDeclaration
@Injectable() export class StudentMobileNoValidatorPipe implements PipeTransform { private logger: Logger = new Logger(StudentMobileNoValidatorPipe.name); transform(value: any, metadata: ArgumentMetadata) { const regex = new RegExp(/^0\d{9}$/); if (!regex.test(value.mobile_no)) { this.logger.error( `${value.mobile_no} is not a correct mobile number type`, ); throw new BadRequestException( `${value.mobile_no} is not a correct mobile number type`, ); } return value; } }
pavitran10/ramp-graphql-service
src/student/pipes/student-mobile-no-validator.pipe.ts
TypeScript
MethodDeclaration
transform(value: any, metadata: ArgumentMetadata) { const regex = new RegExp(/^0\d{9}$/); if (!regex.test(value.mobile_no)) { this.logger.error( `${value.mobile_no} is not a correct mobile number type`, ); throw new BadRequestException( `${value.mobile_no} is not a correct mobile number type`, ); } return value; }
pavitran10/ramp-graphql-service
src/student/pipes/student-mobile-no-validator.pipe.ts
TypeScript
ClassDeclaration
export declare class Producer extends EnhancedEventEmitter { private readonly _internal; private readonly _data; private readonly _channel; private readonly _payloadChannel; private _closed; private readonly _appData?; private _paused; private _score; private readonly _observer; /** * @private * @emits transportclose * @emits score - (score: ProducerScore[]) * @emits videoorientationchange - (videoOrientation: ProducerVideoOrientation) * @emits trace - (trace: ProducerTraceEventData) * @emits @close */ constructor({ internal, data, channel, payloadChannel, appData, paused }: { internal: any; data: any; channel: Channel; payloadChannel: PayloadChannel; appData?: any; paused: boolean; }); /** * Producer id. */ get id(): string; /** * Whether the Producer is closed. */ get closed(): boolean; /** * Media kind. */ get kind(): MediaKind; /** * RTP parameters. */ get rtpParameters(): RtpParameters; /** * Producer type. */ get type(): ProducerType; /** * Consumable RTP parameters. * * @private */ get consumableRtpParameters(): RtpParameters; /** * Whether the Producer is paused. */ get paused(): boolean; /** * Producer score list. */ get score(): ProducerScore[]; /** * App custom data. */ get appData(): any; /** * Invalid setter. */ set appData(appData: any); /** * Observer. * * @emits close * @emits pause * @emits resume * @emits score - (score: ProducerScore[]) * @emits videoorientationchange - (videoOrientation: ProducerVideoOrientation) * @emits trace - (trace: ProducerTraceEventData) */ get observer(): EnhancedEventEmitter; /** * Close the Producer. */ close(): void; /** * Transport was closed. * * @private */ transportClosed(): void; /** * Dump Producer. */ dump(): Promise<any>; /** * Get Producer stats. */ getStats(): Promise<ProducerStat[]>; /** * Pause the Producer. */ pause(): Promise<void>; /** * Resume the Producer. */ resume(): Promise<void>; /** * Enable 'trace' event. */ enableTraceEvent(types?: ProducerTraceEventType[]): Promise<void>; /** * Send RTP packet (just valid for Producers created on a DirectTransport). */ send(rtpPacket: Buffer): void; private _handleWorkerNotifications; }
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
export declare type ProducerOptions = { /** * Producer id (just for Router.pipeToRouter() method). */ id?: string; /** * Media kind ('audio' or 'video'). */ kind: MediaKind; /** * RTP parameters defining what the endpoint is sending. */ rtpParameters: RtpParameters; /** * Whether the producer must start in paused mode. Default false. */ paused?: boolean; /** * Just for video. Time (in ms) before asking the sender for a new key frame * after having asked a previous one. Default 0. */ keyFrameRequestDelay?: number; /** * Custom application data. */ appData?: any; };
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
/** * Valid types for 'trace' event. */ export declare type ProducerTraceEventType = 'rtp' | 'keyframe' | 'nack' | 'pli' | 'fir';
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
/** * 'trace' event data. */ export declare type ProducerTraceEventData = { /** * Trace type. */ type: ProducerTraceEventType; /** * Event timestamp. */ timestamp: number; /** * Event direction. */ direction: 'in' | 'out'; /** * Per type information. */ info: any; };
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
export declare type ProducerScore = { /** * SSRC of the RTP stream. */ ssrc: number; /** * RID of the RTP stream. */ rid?: string; /** * The score of the RTP stream. */ score: number; };
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
export declare type ProducerVideoOrientation = { /** * Whether the source is a video camera. */ camera: boolean; /** * Whether the video source is flipped. */ flip: boolean; /** * Rotation degrees (0, 90, 180 or 270). */ rotation: number; };
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
export declare type ProducerStat = { type: string; timestamp: number; ssrc: number; rtxSsrc?: number; rid?: string; kind: string; mimeType: string; packetsLost: number; fractionLost: number; packetsDiscarded: number; packetsRetransmitted: number; packetsRepaired: number; nackCount: number; nackPacketCount: number; pliCount: number; firCount: number; score: number; packetCount: number; byteCount: number; bitrate: number; roundTripTime?: number; rtxPacketsDiscarded?: number; jitter: number; bitrateByLayer?: any; };
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
TypeAliasDeclaration
/** * Producer type. */ export declare type ProducerType = 'simple' | 'simulcast' | 'svc';
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Close the Producer. */ close(): void;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Transport was closed. * * @private */ transportClosed(): void;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Dump Producer. */ dump(): Promise<any>;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Get Producer stats. */ getStats(): Promise<ProducerStat[]>;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Pause the Producer. */ pause(): Promise<void>;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Resume the Producer. */ resume(): Promise<void>;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Enable 'trace' event. */ enableTraceEvent(types?: ProducerTraceEventType[]): Promise<void>;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
MethodDeclaration
/** * Send RTP packet (just valid for Producers created on a DirectTransport). */ send(rtpPacket: Buffer): void;
aidanaden/nus-clubhouse
voice-backend/node_modules/mediasoup/lib/Producer.d.ts
TypeScript
FunctionDeclaration
export function initStore() { const anyWindow = window as any const composeEnhancers = isDevelopment && anyWindow.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? anyWindow.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ stateSanitizer: (state: RootState) => { const { tile, proximity, ...sanitized } = { ...state } return sanitized } }) : compose const rootReducer = storageReducerWrapper(createRootReducer(history)) const sagasMiddleware = createSagasMiddleware() const loggerMiddleware = createLogger({ collapsed: () => true, predicate: (_: any, action) => isDevelopment || action.type.includes('Failure') }) const transactionMiddleware = createTransactionMiddleware() const { storageMiddleware, loadStorageMiddleware } = createStorageMiddleware({ storageKey: 'marketplace-v2', // this is the key used to save the state in localStorage (required) paths: [ ['ui', 'archivedBidIds'], ['ui', 'preview', 'isTryingOn'], ['identity', 'data'] ], // array of paths from state to be persisted (optional) actions: [ CLEAR_TRANSACTIONS, ARCHIVE_BID, UNARCHIVE_BID, GENERATE_IDENTITY_SUCCESS, SET_IS_TRYING_ON ], // array of actions types that will trigger a SAVE (optional) migrations: {} // migration object that will migrate your localstorage (optional) }) const analyticsMiddleware = createAnalyticsMiddleware( process.env.REACT_APP_SEGMENT_API_KEY || '' ) const middleware = applyMiddleware( sagasMiddleware, routerMiddleware(history), loggerMiddleware, transactionMiddleware, storageMiddleware, analyticsMiddleware ) const enhancer = composeEnhancers(middleware) const store = createStore(rootReducer, enhancer) sagasMiddleware.run(rootSaga) loadStorageMiddleware(store) if (isDevelopment) { const _window = window as any _window.getState = store.getState } // fetch tiles store.dispatch(fetchTilesRequest()) return store }
Axodus/Marketplace
webapp/src/modules/store.ts
TypeScript
ArrowFunction
(state: RootState) => { const { tile, proximity, ...sanitized } = { ...state } return sanitized }
Axodus/Marketplace
webapp/src/modules/store.ts
TypeScript
ArrowFunction
(_: any, action) => isDevelopment || action.type.includes('Failure')
Axodus/Marketplace
webapp/src/modules/store.ts
TypeScript
ArrowFunction
({ rowData }: ExtraParamsType) => rowData?.props?.event.sortableTime + rowData?.props?.event.message
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
ArrowFunction
(severity: Event['severity']) => { switch (severity) { case 'info': return 'blue'; case 'warning': return 'orange'; case 'error': return 'red'; case 'critical': return 'purple'; } }
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
ArrowFunction
(severity: Event['severity']) => { switch (severity) { case 'info': return <InfoCircleIcon />; case 'warning': return <WarningTriangleIcon />; case 'error': case 'critical': return <ExclamationCircleIcon />; } }
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
ArrowFunction
({ events }) => { if (events.length === 0) { return ( <EmptyState icon={SearchIcon} title="No events found" content="There are no events found." />
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
ArrowFunction
(event) => ({ ...event, sortableTime: new Date(event.eventTime).getTime(), })
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
ArrowFunction
// Descending order (a, b) => b.sortableTime - a.sortableTime
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
ArrowFunction
(event) => ({ cells: [ { title: <strong>{getHumanizedDateTime(event.eventTime)
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
TypeAliasDeclaration
export type EventsListProps = { events: EventList; };
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
MethodDeclaration
getHumanizedDateTime(event
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
MethodDeclaration
getLabelIcon(event
irosenzw/assisted-ui-lib
src/components/ui/EventsList.tsx
TypeScript
FunctionDeclaration
/** * Checks for a label with a colon, e.g. * "label:", " label:" or "init.label_1:". * But not ".label:". * Capture groups: * 1 = preceding spaces * 2 = the label itself e.g. "init.label_1 * Used by findLabelsWithNoReference, provideCodeLenses. */ export function regexLabelColon(): RegExp { return /(^\s*)\b([a-z_][\w\.]*):/i; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Checks for a label without a colon, i.e. a * label used by sjasmplus. * E.g. "label" or "init.label_1". * But not ".label". * Capture groups: * 1 = '' * 2 = the label itself e.g. "init.label_1 * Used by findLabelsWithNoReference, provideCodeLenses. */ export function regexLabelWithoutColon(): RegExp { return /^()([a-z_][\w\.]*)(?:\s|$)/i; //return /^()([a-z_][\w\.]*)\b(?![:\.])/i; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Checks for a label followed by MACRO or EQU. * E.g. "label: MACRO" or "label2: equ" or "label equ". * Capture groups: * None. * Used by findLabelsWithNoReference. */ export function regexLabelEquOrMacro(): RegExp { return /^[\w\.]+:?\s*\b(equ|macro)/i; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Checks for an INCLUDE directive. * E.g. 'include "something"' or ' include "something"'. * Capture groups: * 1 = what is included, i.e. what is inside the "" * Used by DefinitionProvider, RenameProvider. */ export function regexInclude(): RegExp { return /\s*INCLUDE\s+"(.*)"/i; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Checks for a MODULE or STRUCT directive. * Used by getModule. */ export function regexModuleStruct(): RegExp { return /^\s+(MODULE|STRUCT)\s+([\w\.]+)/i; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Checks for a ENDMODULE or ENDS directive. * Used by getModule. */ export function regexEndModuleStruct(): RegExp { return /^\s+(ENDMODULE|ENDS)\b/i; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for labels that contain the given word. * Checks for a label with a colon. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by DefinitionProvider. */ export function regexLabelColonForWord(searchWord: string): RegExp { return new RegExp('^(\\s*)([^0-9\\s][\\w\\.]*)?\\b' + searchWord + ':'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for labels that contains the given word. * Checks for a label without a colon. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by DefinitionProvider. */ export function regexLabelWithoutColonForWord(searchWord: string): RegExp { return new RegExp('^()([^0-9\\s][\\w\\.]*)?\\b' + searchWord + '\\b(?![:\\.])'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for a (sjasmplus) MODULE that contains the given word. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by DefinitionProvider. */ export function regexModuleForWord(searchWord: string): RegExp { return new RegExp('^(\\s+(module|MODULE)\\s+)' + searchWord + '\\b'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for a (sjasmplus) MACRO that contains the given word. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by DefinitionProvider. */ export function regexMacroForWord(searchWord: string): RegExp { return new RegExp('^(\\s+(macro|MACRO)\\s+)' + searchWord + '\\b'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for a (sjasmplus) STRUCT that contains the given word. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by DefinitionProvider. */ export function regexStructForWord(searchWord: string): RegExp { return new RegExp('^(\\s+(struct|STRUCT)\\s+)' + searchWord + '\\b'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches any reference for a given word (label). * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by resolveCodeLens. */ export function regexAnyReferenceForWord(searchWord: string): RegExp { return new RegExp('^([^"]*)\\b' + searchWord + '\\b'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches any reference for a given word (label). * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by RenameProvider. */ export function regexAnyReferenceForWordGlobal(searchWord: string): RegExp { return new RegExp('(.*?)\\b' + searchWord + '\\b', 'g'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Prepares a string for fuzzy search. * I.e. allows to input a string like "snd" and it will find * with a regular expression also "sound", "sounds", "snd" etc. * but not e.g. "sn". * Used by CompletionProposalsProvider. */ export function regexPrepareFuzzy(searchWord: string): string { const replaced = searchWord.replace(/(.)/g,'\\w*$1'); return replaced; }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for labels that contains the given word. * Checks for a label with a colon. * The label can be everywhere. I.e. it can be a middle part of a dot * notated label. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by CompletionProposalsProvider. */ export function regexEveryLabelColonForWord(searchWord: string): RegExp { return new RegExp('^(\\s*[\\w\\.]*)\\b' + searchWord + '[\\w\\.]*:', 'i'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for labels that contains the given word. * Checks for a label without a colon. * The label can be everywhere. I.e. it can be a middle part of a dot * notated label. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by CompletionProposalsProvider. */ export function regexEveryLabelWithoutColonForWord(searchWord: string): RegExp { //searchWord=searchWord.replace(/\./g, '\\.'); return new RegExp('^(([^0-9 ][\\w\\.]*)?)\\b' + searchWord + '[\\w\\.]*\\b(?![:\\w\\.])', 'i'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for a (sjasmplus) MODULE that contains the given word. * The label can be everywhere. I.e. it can be a middle part of a dot * notated label. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by CompletionProposalsProvider. */ export function regexEveryModuleForWord(searchWord: string): RegExp { return new RegExp('^(\\s+(MODULE)\\s+)' + searchWord + '[\\w\\.]*', 'i'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
FunctionDeclaration
/** * Searches for a (sjasmplus) MACRO that contains the given word. * The label can be everywhere. I.e. it can be a middle part of a dot * notated label. * Capture groups: * 1 = preceding characters before 'searchWord'. * Used by CompletionProposalsProvider. */ export function regexEveryMacroForWord(searchWord: string): RegExp { return new RegExp('^(\\s+(MACRO)\\s+)' + searchWord + '[\\w\\.]*', 'i'); }
vchirikov/asm-code-lens
src/regexes.ts
TypeScript
ArrowFunction
() => { it('should show spinner when loading required data', () => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, ); const title = screen.queryByText('Se over svarene dine før du sender inn'); expect(title).not.toBeInTheDocument(); const contentLoader = screen.getByText('Loading...'); expect(contentLoader).toBeInTheDocument(); }); it('should present confirm information when necessary data is present', () => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, { preloadedState: getInitialStateMock({ attachments: { attachments: {} }, }), }, ); const title = screen.getByText('Se over svarene dine før du sender inn'); expect(title).toBeInTheDocument(); const contentLoader = screen.queryByText('Loading...'); expect(contentLoader).not.toBeInTheDocument(); }); it('should present pdf as part of previously submitted data', () => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, { preloadedState: getInitialStateMock({ attachments: { attachments: {} }, }), }, ); const pdf = screen.getByText('mockApp.pdf'); expect(pdf).toBeInTheDocument(); const contentLoader = screen.queryByText('Loading...'); expect(contentLoader).not.toBeInTheDocument(); }); it('should show loading when clicking submit', async () => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, { preloadedState: getInitialStateMock({ attachments: { attachments: {} }, }), }, ); const submitBtnText = /send inn/i; const loadingText = /laster innhold/i; const submitBtn = screen.getByText(submitBtnText); expect(screen.queryByText(loadingText)).not.toBeInTheDocument(); expect(submitBtn).toBeInTheDocument(); await userEvent.click(submitBtn); expect(screen.queryByText(submitBtnText)).not.toBeInTheDocument(); expect(screen.getByText(loadingText)).toBeInTheDocument(); }); describe('returnConfirmSummaryObject', () => { it('should return sender with ssn prefix when ssn is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', } as IParty, }); expect(result).toEqual({ 'confirm.sender': '01017512345-Ola Privatperson', }); }); it('should return sender with ssn prefix when both ssn and orgNumber is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', orgNumber: 987654321, } as IParty, }); expect(result).toEqual({ 'confirm.sender': '01017512345-Ola Privatperson', }); }); it('should return sender with orgNumber prefix when orgNumber is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Bedrift', orgNumber: 987654321, } as IParty, }); expect(result).toEqual({ 'confirm.sender': '987654321-Ola Bedrift', }); }); it('should return sender as empty string when neither ssn or orgNumber is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Bedrift', } as IParty, }); expect(result).toEqual({ 'confirm.sender': '', }); }); it('should return sender as empty string when instanceOwnerParty is not present', () => { const result = returnConfirmSummaryObject({ languageData: {}, }); expect(result).toEqual({ 'confirm.sender': '', }); }); it('should return custom value for confirm.sender if key is supplied in text resources', () => { const result = returnConfirmSummaryObject({ languageData: {}, textResources: [{ id: 'confirm.sender', value: 'Some custom value'}], instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', } as IParty, }); expect(result).toEqual({ 'Some custom value': '01017512345-Ola Privatperson', }); }); }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, ); const title = screen.queryByText('Se over svarene dine før du sender inn'); expect(title).not.toBeInTheDocument(); const contentLoader = screen.getByText('Loading...'); expect(contentLoader).toBeInTheDocument(); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, { preloadedState: getInitialStateMock({ attachments: { attachments: {} }, }), }, ); const title = screen.getByText('Se over svarene dine før du sender inn'); expect(title).toBeInTheDocument(); const contentLoader = screen.queryByText('Loading...'); expect(contentLoader).not.toBeInTheDocument(); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, { preloadedState: getInitialStateMock({ attachments: { attachments: {} }, }), }, ); const pdf = screen.getByText('mockApp.pdf'); expect(pdf).toBeInTheDocument(); const contentLoader = screen.queryByText('Loading...'); expect(contentLoader).not.toBeInTheDocument(); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
async () => { renderWithProviders( <MemoryRouter> <Confirm /> </MemoryRouter>, { preloadedState: getInitialStateMock({ attachments: { attachments: {} }, }), }, ); const submitBtnText = /send inn/i; const loadingText = /laster innhold/i; const submitBtn = screen.getByText(submitBtnText); expect(screen.queryByText(loadingText)).not.toBeInTheDocument(); expect(submitBtn).toBeInTheDocument(); await userEvent.click(submitBtn); expect(screen.queryByText(submitBtnText)).not.toBeInTheDocument(); expect(screen.getByText(loadingText)).toBeInTheDocument(); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { it('should return sender with ssn prefix when ssn is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', } as IParty, }); expect(result).toEqual({ 'confirm.sender': '01017512345-Ola Privatperson', }); }); it('should return sender with ssn prefix when both ssn and orgNumber is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', orgNumber: 987654321, } as IParty, }); expect(result).toEqual({ 'confirm.sender': '01017512345-Ola Privatperson', }); }); it('should return sender with orgNumber prefix when orgNumber is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Bedrift', orgNumber: 987654321, } as IParty, }); expect(result).toEqual({ 'confirm.sender': '987654321-Ola Bedrift', }); }); it('should return sender as empty string when neither ssn or orgNumber is present', () => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Bedrift', } as IParty, }); expect(result).toEqual({ 'confirm.sender': '', }); }); it('should return sender as empty string when instanceOwnerParty is not present', () => { const result = returnConfirmSummaryObject({ languageData: {}, }); expect(result).toEqual({ 'confirm.sender': '', }); }); it('should return custom value for confirm.sender if key is supplied in text resources', () => { const result = returnConfirmSummaryObject({ languageData: {}, textResources: [{ id: 'confirm.sender', value: 'Some custom value'}], instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', } as IParty, }); expect(result).toEqual({ 'Some custom value': '01017512345-Ola Privatperson', }); }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', } as IParty, }); expect(result).toEqual({ 'confirm.sender': '01017512345-Ola Privatperson', }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', orgNumber: 987654321, } as IParty, }); expect(result).toEqual({ 'confirm.sender': '01017512345-Ola Privatperson', }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Bedrift', orgNumber: 987654321, } as IParty, }); expect(result).toEqual({ 'confirm.sender': '987654321-Ola Bedrift', }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { const result = returnConfirmSummaryObject({ languageData: {}, instanceOwnerParty: { partyId: '50001', name: 'Ola Bedrift', } as IParty, }); expect(result).toEqual({ 'confirm.sender': '', }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { const result = returnConfirmSummaryObject({ languageData: {}, }); expect(result).toEqual({ 'confirm.sender': '', }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
ArrowFunction
() => { const result = returnConfirmSummaryObject({ languageData: {}, textResources: [{ id: 'confirm.sender', value: 'Some custom value'}], instanceOwnerParty: { partyId: '50001', name: 'Ola Privatperson', ssn: '01017512345', } as IParty, }); expect(result).toEqual({ 'Some custom value': '01017512345-Ola Privatperson', }); }
Altinn/app-frontend-react
src/altinn-app-frontend/src/features/confirm/containers/Confirm.test.tsx
TypeScript
FunctionDeclaration
export function ProjectExplorerContextMenu(props: ProjectExplorerContextMenuProps) { const options = []; switch (props.node.type) { case ProjectExplorerNodeType.ProjectNode: options.push(<div>Refresh</div>); break; case ProjectExplorerNodeType.AssetFolder: options.push(<div>Import assets</div>); options.push(<div>Refresh</div>); break; case ProjectExplorerNodeType.AnimationFolder: options.push(<div>New animation</div>); break; case ProjectExplorerNodeType.SchemaFolder: options.push(<div>New Schema</div>); break; case ProjectExplorerNodeType.TileMapFolder: options.push(<div>New Tilemap</div>); break; case ProjectExplorerNodeType.TileSet: options.push(<div>New Tileset</div>); break; case ProjectExplorerNodeType.CodeFolder: options.push( <div onClick={() => { newNode(props, 'New File', ProjectExplorerNodeType.Code); }}
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
FunctionDeclaration
function newFolder() { props.node.open.update(true); const newNode: ProjectExplorerNode = { children: new ArrayDataSource(), permissions: { rename: true }, name: new DataSource('New folder'), open: new DataSource(false), type: props.node.type, parent: new DataSource(props.node) }; props.node.children.push(newNode); setTimeout(async () => { const name = await props.onRename(newNode); currentProject.value.addFolder(props.node, name); }); }
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
FunctionDeclaration
function newNode(props: ProjectExplorerContextMenuProps, defaultName: string, newNodeType: ProjectExplorerNodeType, defaultContent: string = '') { props.node.open.update(true); const newNode: ProjectExplorerNode = { children: new ArrayDataSource(), permissions: { rename: true }, name: new DataSource(defaultName), open: new DataSource(false), type: newNodeType, parent: new DataSource(props.node) }; props.node.children.push(newNode); setTimeout(async () => { const name = await props.onRename(newNode); currentProject.value.addFile(props.node, name, defaultContent); }); }
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
ArrowFunction
async () => { const name = await props.onRename(newNode); currentProject.value.addFolder(props.node, name); }
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
ArrowFunction
async () => { const name = await props.onRename(newNode); currentProject.value.addFile(props.node, name, defaultContent); }
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
InterfaceDeclaration
export interface ProjectExplorerContextMenuProps { node: ProjectExplorerNode; onRename(node: ProjectExplorerNode): Promise<string>; }
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
newNode(props, 'New File', ProjectExplorerNodeType
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
newNode(props, 'New Scene', ProjectExplorerNodeType
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
newNode(props, 'New Globals', ProjectExplorerNodeType
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
newNode(props, 'New Stylesheet', ProjectExplorerNodeType
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
newNode( props, 'New Entity template', ProjectExplorerNodeType
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
newFolder();
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
MethodDeclaration
if (props
CyberPhoenix90/aurum
packages/aurum-game-engine-editor/src/components/project_explorer/project_explorer_context_menu.tsx
TypeScript
ArrowFunction
() => PgDatabase
Ginden/typeorm-information-schema
src/postgres/10/pg_catalog/pg_locks.entity.ts
TypeScript
ClassDeclaration
/** * Comments in this file were automatically generated from Postgres files */ @ViewEntity({ schema: 'pg_catalog', name: 'pg_locks', synchronize: false, }) export class PgLocks { @ViewColumn({ name: 'locktype' }) public readonly locktype!: string | null /* text */; @ViewColumn({ name: 'database' }) public readonly database!: number | null /* oid */; @ViewColumn({ name: 'relation' }) public readonly relation!: number | null /* oid */; @ViewColumn({ name: 'page' }) public readonly page!: number | null /* int4 */; @ViewColumn({ name: 'tuple' }) public readonly tuple!: number | null /* int2 */; @ViewColumn({ name: 'virtualxid' }) public readonly virtualxid!: string | null /* text */; @ViewColumn({ name: 'transactionid' }) public readonly transactionid!: unknown | null /* xid */; @ViewColumn({ name: 'classid' }) public readonly classid!: number | null /* oid */; @ViewColumn({ name: 'objid' }) public readonly objid!: number | null /* oid */; @ViewColumn({ name: 'objsubid' }) public readonly objsubid!: number | null /* int2 */; @ViewColumn({ name: 'virtualtransaction' }) public readonly virtualtransaction!: string | null /* text */; @ViewColumn({ name: 'pid' }) public readonly pid!: number | null /* int4 */; @ViewColumn({ name: 'mode' }) public readonly mode!: string | null /* text */; @ViewColumn({ name: 'granted' }) public readonly granted!: boolean | null /* bool */; @ViewColumn({ name: 'fastpath' }) public readonly fastpath!: boolean | null /* bool */; @ManyToOne(() => PgDatabase) @JoinColumn({ name: 'database', referencedColumnName: 'oid', }) readonly databaseEntity?: PgDatabase; }
Ginden/typeorm-information-schema
src/postgres/10/pg_catalog/pg_locks.entity.ts
TypeScript
FunctionDeclaration
function SvgPanoramaEnlarge( props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement> ) { return ( <svg width="1.5em" height="1.5em" strokeWidth={1.5} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" ref={svgRef} {...props} > <path d="M12 5c2.995 0 7.235.692 8.576.925a.581.581 0 01.48.503c.13 1.028.444 3.691.444 5.572 0 1.88-.313 4.544-.444 5.572a.581.581 0 01-.48.503c-1.34.233-5.58.925-8.576.925-2.995 0-7.235-.692-8.576-.925a.582.582 0 01-.48-.503C2.814 16.544 2.5 13.881 2.5 12c0-1.88.313-4.544.444-5.572a.582.582 0 01.48-.503C4.764 5.692 9.004 5 12 5z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" /> </svg> ); }
Bloc67/iconoir
packages/iconoir-react/src/PanoramaEnlarge.tsx
TypeScript
TypeAliasDeclaration
/** * The network traffic is allowed or denied. */ export type Access = (typeof Access)[keyof typeof Access];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. */ export type ClusterUpgradeCadence = (typeof ClusterUpgradeCadence)[keyof typeof ClusterUpgradeCadence];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * Network security rule direction. */ export type Direction = (typeof Direction)[keyof typeof Direction];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The compensating action to perform when a Monitored upgrade encounters monitoring policy or health policy violations. Invalid indicates the failure action is invalid. Rollback specifies that the upgrade will start rolling back automatically. Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. */ export type FailureAction = (typeof FailureAction)[keyof typeof FailureAction];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The type of managed identity for the resource. */ export type ManagedIdentityType = (typeof ManagedIdentityType)[keyof typeof ManagedIdentityType];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * Specifies the move cost for the service. */ export type MoveCost = (typeof MoveCost)[keyof typeof MoveCost];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * Network protocol this rule applies to. */ export type NsgProtocol = (typeof NsgProtocol)[keyof typeof NsgProtocol];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * Specifies how the service is partitioned. */ export type PartitionScheme = (typeof PartitionScheme)[keyof typeof PartitionScheme];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * the reference to the load balancer probe used by the load balancing rule. */ export type ProbeProtocol = (typeof ProbeProtocol)[keyof typeof ProbeProtocol];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The reference to the transport protocol used by the load balancing rule. */ export type Protocol = (typeof Protocol)[keyof typeof Protocol];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The mode used to monitor health during a rolling upgrade. The values are Monitored, and UnmonitoredAuto. */ export type RollingUpgradeMode = (typeof RollingUpgradeMode)[keyof typeof RollingUpgradeMode];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. */ export type ServiceCorrelationScheme = (typeof ServiceCorrelationScheme)[keyof typeof ServiceCorrelationScheme];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The kind of service (Stateless or Stateful). */ export type ServiceKind = (typeof ServiceKind)[keyof typeof ServiceKind];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The service load metric relative weight, compared to other metrics configured for this service, as a number. */ export type ServiceLoadMetricWeight = (typeof ServiceLoadMetricWeight)[keyof typeof ServiceLoadMetricWeight];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript
TypeAliasDeclaration
/** * The activation Mode of the service package */ export type ServicePackageActivationMode = (typeof ServicePackageActivationMode)[keyof typeof ServicePackageActivationMode];
polivbr/pulumi-azure-native
sdk/nodejs/types/enums/servicefabric/v20210101preview/index.ts
TypeScript