type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(state = initialState.routing, action) => { switch (action.type) { case SET_ROUTE: return Object.assign({}, state, { route: action.route, subRoute: null, }); case SET_SUB_ROUTE: return Object.assign({}, state, { subRoute: action.subRoute, }); default: ...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.dialogs, action) => { switch (action.type) { case OPEN_DIALOG: case SET_DIALOG_DATA: return Object.assign({}, state, action.dialog); case SET_DIALOG_ERROR: { const dialog = state[action.payload.dialogName]; return Object.assign({}, state, { [action.payloa...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.feedback, action) => { switch (action.type) { case FETCH_PREVIOUS_FEEDBACK: return Object.assign({}, state, { fetching: true, fetchingError: null, }); case FETCH_PREVIOUS_FEEDBACK_FAILURE: return Object.assign({}, state, { fetching: false, ...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.videos, action) => { switch (action.type) { case FETCH_VIDEOS: return Object.assign({}, state, { fetching: true, fetchingError: null, list: [], }); case FETCH_VIDEOS_FAILURE: return Object.assign({}, state, { fetching: false, fe...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.blog, action) => { switch (action.type) { case FETCH_BLOG_LIST: return Object.assign({}, state, { fetching: true, fetchingError: null, list: [], obj: {}, }); case FETCH_BLOG_LIST_FAILURE: return Object.assign({}, state, { fetchi...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.opini, action) => { switch (action.type) { case FETCH_OPINI_LIST: return Object.assign({}, state, { fetching: true, fetchingError: null, list: [], obj: {}, }); case FETCH_OPINI_LIST_FAILURE: return Object.assign({}, state, { fet...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.speakers, action) => { switch (action.type) { case FETCH_SPEAKERS: return Object.assign({}, state, { fetching: true, fetchingError: null, list: [], obj: {}, }); case FETCH_SPEAKERS_FAILURE: return Object.assign({}, state, { fetc...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.sessions, action) => { switch (action.type) { case FETCH_SESSIONS: return Object.assign({}, state, { fetching: true, fetchingError: null, list: [], obj: {}, objBySpeaker: {}, }); case FETCH_SESSIONS_FAILURE: return Object.assign...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.schedule, action) => { switch (action.type) { case FETCH_SCHEDULE_SUCCESS: return action.data; default: return state; } }
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.gallery, action) => { switch (action.type) { case FETCH_GALLERY: return Object.assign({}, state, { fetching: true, fetchingError: null, list: [], }); case FETCH_GALLERY_FAILURE: return Object.assign({}, state, { fetching: false, ...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.user, action) => { switch (action.type) { case SIGN_IN: case SIGN_OUT: return action.user; default: return state; } }
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.pendaftaran, action) => { switch (action.type) { case DAFTAR_SUCCESS: return action.pendaftaran; case DAFTAR_FAILURE: return action.pendaftaran; default: return state; } }
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.toast, action) => { switch (action.type) { case SHOW_TOAST: return action.toast; case HIDE_TOAST: return initialState.toast; default: return state; } }
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.notifications, action) => { switch (action.type) { case UPDATE_NOTIFICATIONS_STATUS: return Object.assign({}, state, { status: action.status, token: action.token, }); default: return state; } }
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState.filters, action) => { switch (action.type) { case SET_FILTERS: return Object.assign({}, state, action.payload); default: return state; } }
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
(state = initialState, action) => { return { ui: uiReducer(state.ui, action), routing: routingReducer(state.routing, action), dialogs: dialogsReducer(state.dialogs, action), feedback: feedbackReducer(state.feedback, action), videos: videosReducer(state.videos, action), blog: blogReducer(state...
kurnhyalcantara/hmiasadiyah
src/redux/reducer.ts
TypeScript
ArrowFunction
({disabled, fieldName, labelText, listItems, refObject, validationRules}) => { const { control } = useFormContext(); return ( <FormField fieldName={fieldName}> <InputLabel htmlFor={fieldName} shrink={true}>{labelText}</InputLabel> <Controller as={ <Select disabled={disabled...
jaypalexa/roster
src/components/FormFields/ListFormField.tsx
TypeScript
ArrowFunction
(e, key) => { return <MenuItem key={key} value={e.value} disabled={disabled}>{e.name}</MenuItem>; }
jaypalexa/roster
src/components/FormFields/ListFormField.tsx
TypeScript
InterfaceDeclaration
interface ListFormFieldProps extends FormFieldProps { labelText?: string; listItems: NameValuePair[]; refObject?: any; }
jaypalexa/roster
src/components/FormFields/ListFormField.tsx
TypeScript
InterfaceDeclaration
export interface Item { id?: string; name: string; description?: string; itemNumber: number; }
prakash89/learn-nest
src/items/interface/item.interface.ts
TypeScript
InterfaceDeclaration
interface MyObject { total: number; type: boolean; }
AlexanderWert/kibana
src/fixtures/telemetry_collectors/schema_defined_with_spreads_collector.ts
TypeScript
InterfaceDeclaration
interface Usage { flat?: string; my_str?: string; my_objects: MyObject; }
AlexanderWert/kibana
src/fixtures/telemetry_collectors/schema_defined_with_spreads_collector.ts
TypeScript
MethodDeclaration
fetch() { const testString = '123'; return { flat: 'hello', my_str: testString, my_objects: { total: SOME_NUMBER, type: true, }, }; }
AlexanderWert/kibana
src/fixtures/telemetry_collectors/schema_defined_with_spreads_collector.ts
TypeScript
ClassDeclaration
export declare class Scene extends IdentifyByKey { static DEFAULT_SCENE_ID: string; container: Three.Scene | undefined; pickingContainer: Three.Scene; layers: Layer<any, any>[]; sortIsDirty: boolean; viewById: Map<string, View>; constructor(options: ISceneOptions); addLayer<T extends In...
mikaelharsjo/voidgl
src/voidgl/surface/scene.d.ts
TypeScript
InterfaceDeclaration
export interface ISceneOptions extends IdentifyByKeyOptions { views: IViewOptions[]; }
mikaelharsjo/voidgl
src/voidgl/surface/scene.d.ts
TypeScript
MethodDeclaration
addLayer<T extends Instance, U extends ILayerProps<T>>(layer: Layer<T, U>): void;
mikaelharsjo/voidgl
src/voidgl/surface/scene.d.ts
TypeScript
MethodDeclaration
addView(view: View): void;
mikaelharsjo/voidgl
src/voidgl/surface/scene.d.ts
TypeScript
MethodDeclaration
removeLayer(layer: Layer<any, any>): void;
mikaelharsjo/voidgl
src/voidgl/surface/scene.d.ts
TypeScript
MethodDeclaration
sortLayers(): void;
mikaelharsjo/voidgl
src/voidgl/surface/scene.d.ts
TypeScript
ArrowFunction
props => props.theme.code.fontSize
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ArrowFunction
props => props.theme.code.fontFamily
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ArrowFunction
props => transparentize(0.85, props.theme.colors.text)
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ArrowFunction
(scheme, idx) => { return ( <div key={scheme.id}> <a href={'#' + scheme.sectionId}>{scheme.id}</a> {scheme.scopes.length > 0 && ' ('} {scheme.scopes.map(scope => <ScopeName key={scope}>{scope}</ScopeName>)} {scheme.scopes.length > 0 && ') '} {idx < securi...
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ArrowFunction
scope => <ScopeName key
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ArrowFunction
props => props.theme.schemaView.defaultDetailsWidth
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ArrowFunction
(security, idx) => ( <SecurityRequirement key={idx}
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ClassDeclaration
export class SecurityRequirement extends React.PureComponent<SecurityRequirementProps> { render() { const security = this.props.security; return security.schemes.map((scheme, idx) => { return ( <div key={scheme.id}> <a href={'#' + scheme.sectionId}>{scheme.id}</a> {scheme.sc...
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
ClassDeclaration
export class SecurityRequirements extends React.PureComponent<SecurityRequirementsProps> { render() { const securities = this.props.securities; if (!securities.length) { return null; } return ( <Table> <tbody> <tr> <AuthHeaderColumn> <AuthHeader...
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
InterfaceDeclaration
export interface SecurityRequirementProps { security: SecurityRequirementModel; }
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
InterfaceDeclaration
export interface SecurityRequirementsProps { securities: SecurityRequirementModel[]; }
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
MethodDeclaration
render() { const security = this.props.security; return security.schemes.map((scheme, idx) => { return ( <div key={scheme.id}> <a href={'#' + scheme.sectionId}>{scheme.id}</a> {scheme.scopes.length > 0 && ' ('} {scheme.scopes.map(scope => <ScopeName key={scope}>{scop...
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
MethodDeclaration
idx < security
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
MethodDeclaration
render() { const securities = this.props.securities; if (!securities.length) { return null; } return ( <Table> <tbody> <tr> <AuthHeaderColumn> <AuthHeader>Authorizations: </AuthHeader> </AuthHeaderColumn> <SecuritiesColumn>...
pratikn06/ReDoc
src/components/SecurityRequirement/SecuirityRequirement.tsx
TypeScript
FunctionDeclaration
async function getTodos() { await axios .get<Array<Todo>>(`api/todos?account_id=${account_id}`) .then((res) => { if (isEmpty(res.data)) { setTodos([]); setCompletedTodos([]); } else { const notCompletedTodos = filter(res.data, (todo) => { ...
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
() => { const { showMessage } = useMessage(); const [loading, setLoading] = useState(false); const [todos, setTodos] = useState<Array<Todo>>([]); const [completedTodos, setCompletedTodos] = useState<Array<Todo>>([]); const getTodos = useCallback((loading: boolean, account_id: number) => { setLoading(lo...
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
(loading: boolean, account_id: number) => { setLoading(loading); async function getTodos() { await axios .get<Array<Todo>>(`api/todos?account_id=${account_id}`) .then((res) => { if (isEmpty(res.data)) { setTodos([]); setCompletedTodos([]); } els...
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
(res) => { if (isEmpty(res.data)) { setTodos([]); setCompletedTodos([]); } else { const notCompletedTodos = filter(res.data, (todo) => { return !todo.completed }); const completedTodos = filter(res.data, (todo) => { ...
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
(todo) => { return !todo.completed }
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
(todo) => { return todo.completed || false }
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
() => showMessage({ title: "todoの取得に失敗しました", status: "error" })
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
ArrowFunction
() => { setLoading(false); }
harauma/Laravel_App
resources/ts/hooks/Todo/useAllTodos.ts
TypeScript
EnumDeclaration
/* eslint-disable no-bitwise */ // The TransformerVersion and TransformerPlatform enums use bit flags to easily combine // values. For example, if a schema is only supported on JS and iOS, this can be represented // as (TransformerPlatform.js | TransformerPlatform.ios). Similarly, if a schema is supported // on all pla...
Booligoosh/amplify-cli
packages/amplify-graphql-schema-test-library/src/index.ts
TypeScript
EnumDeclaration
export const enum TransformerPlatform { none = 0, api = 1 << 0, dataStore = 1 << 1, js = 1 << 2, jsDataStore = 1 << 3, ios = 1 << 4, iosDataStore = 1 << 5, android = 1 << 6, androidDataStore = 1 << 7, flutter = 1 << 8, flutterDataStore = 1 << 9, all = ~0, }
Booligoosh/amplify-cli
packages/amplify-graphql-schema-test-library/src/index.ts
TypeScript
TypeAliasDeclaration
export type TransformerSchema = { description: string; transformerVersion: TransformerVersion; supportedPlatforms: TransformerPlatform; sdl: string; };
Booligoosh/amplify-cli
packages/amplify-graphql-schema-test-library/src/index.ts
TypeScript
ArrowFunction
(c): boolean => c.ID === this.Command.ID
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
ArrowFunction
(c): boolean => c.ID === header.commandIdentifier
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
ArrowFunction
(condition): boolean => { if (condition.type === 'statusEquals') { return entry.status !== condition.value; } else if (condition.type == 'statusNotEquals') { return entry.status === condition.value; } else if (condition.type == 'di...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
InterfaceDeclaration
interface ZclHeader { frameControl: FrameControl; manufacturerCode: number; transactionSequenceNumber: number; commandIdentifier: number; }
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
TypeAliasDeclaration
// eslint-disable-next-line type ZclPayload = any;
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
/** * Creating */ public static create( frameType: FrameType, direction: Direction, disableDefaultResponse: boolean, manufacturerCode: number, transactionSequenceNumber: number, commandKey: number | string, clusterID: number, payload: ZclPayload, reservedBits = 0 ): ZclFrame { ...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
public toBuffer(): Buffer { const buffalo = new BuffaloZcl(Buffer.alloc(250)); this.writeHeader(buffalo); if (this.Header.frameControl.frameType === FrameType.GLOBAL) { this.writePayloadGlobal(buffalo); } else if (this.Header.frameControl.frameType === FrameType.SPECIFIC) {...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private writeHeader(buffalo: BuffaloZcl): void { const frameControl = ( (this.Header.frameControl.frameType & 0x03) | (((this.Header.frameControl.manufacturerSpecific ? 1 : 0) << 2) & 0x04) | ((this.Header.frameControl.direction << 3) & 0x08) | (((this.Header.fra...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private writePayloadGlobal(buffalo: BuffaloZcl): void { const command = Object.values(Foundation).find((c): boolean => c.ID === this.Command.ID); if (command.parseStrategy === 'repetitive') { for (const entry of this.Payload) { for (const parameter of command.parameters) { ...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private writePayloadCluster(buffalo: BuffaloZcl): void { for (const parameter of this.Command.parameters) { if (!ZclFrame.conditionsValid(parameter, this.Payload, null)) { continue; } if (!this.Payload.hasOwnProperty(parameter.name)) { throw ...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
/** * Parsing */ public static fromBuffer(clusterID: number, buffer: Buffer): ZclFrame { if (buffer.length < MINIMAL_FRAME_LENGTH) { throw new Error("ZclFrame length is lower than minimal length"); } const buffalo = new BuffaloZcl(buffer); const header = this.parse...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private static parseHeader(buffalo: BuffaloZcl): ZclHeader { const frameControlValue = buffalo.readUInt8(); const frameControl = { frameType: frameControlValue & 0x03, manufacturerSpecific: ((frameControlValue >> 2) & 0x01) === 1, direction: (frameControlValue >> 3) ...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private static parsePayload(header: ZclHeader, cluster: TsType.Cluster, buffalo: BuffaloZcl): ZclPayload { if (header.frameControl.frameType === FrameType.GLOBAL) { return this.parsePayloadGlobal(header, buffalo); } else if (header.frameControl.frameType === FrameType.SPECIFIC) { ...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private static parsePayloadCluster(header: ZclHeader, cluster: TsType.Cluster, buffalo: BuffaloZcl): ZclPayload { const command = header.frameControl.direction === Direction.CLIENT_TO_SERVER ? cluster.getCommand(header.commandIdentifier) : cluster.getCommandResponse(header.commandIdentifier); ...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private static parsePayloadGlobal(header: ZclHeader, buffalo: BuffaloZcl): ZclPayload { const command = Object.values(Foundation).find((c): boolean => c.ID === header.commandIdentifier); if (command.parseStrategy === 'repetitive') { const payload = []; while (buffalo.getPositi...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
/** * Utils */ private static getDataTypeString(dataType: DataType | BuffaloZclDataType): string { return DataType[dataType] != null ? DataType[dataType] : BuffaloZclDataType[dataType]; }
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
private static conditionsValid( parameter: DefinitionTsType.ParameterDefinition, entry: ZclPayload, remainingBufferBytes: number ): boolean { if (parameter.conditions) { const failedCondition = parameter.conditions.find((condition): boolean => { if (condi...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
public isSpecific(): boolean { return this.Header.frameControl.frameType === FrameType.SPECIFIC; }
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
public isGlobal(): boolean { return this.Header.frameControl.frameType === FrameType.GLOBAL; }
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
// List of clusters is not completed, feel free to add more. public isCluster(clusterName: 'genTime' | 'genAnalogInput' | 'genBasic' | 'genGroups' | 'ssIasZone'): boolean { return this.Cluster.name === clusterName; }
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
// List of commands is not completed, feel free to add more. public isCommand( commandName: 'read' | 'report' | 'readRsp' | 'remove' | 'add' | 'write' | 'enrollReq' | 'configReport' ): boolean { return this.getCommand().name === commandName; }
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
MethodDeclaration
public getCommand(): TsType.Command { let command: TsType.Command = null; if (this.Header.frameControl.frameType === FrameType.GLOBAL) { command = Utils.getGlobalCommand(this.Header.commandIdentifier); } else { command = this.Header.frameControl.direction === Direction.C...
aesedepece/zigbee-herdsman
src/zcl/zclFrame.ts
TypeScript
FunctionDeclaration
export function rep<TKind, TResult>(p: Parser<TKind, TResult>): Parser<TKind, TResult[]> { const reprParser = repr(p); return { parse(token: Token<TKind>): ParserOutput<TKind, TResult[]> { const output = reprParser.parse(token); if (output.successful) { return { ...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
export function rep_sc<TKind, TResult>(p: Parser<TKind, TResult>): Parser<TKind, TResult[]> { return { parse(token: Token<TKind>): ParserOutput<TKind, TResult[]> { let error: ParseError | undefined; let result: ParseResult<TKind, TResult[]>[] = [{ nextToken: token, result: [] }]; ...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
export function repr<TKind, TResult>(p: Parser<TKind, TResult>): Parser<TKind, TResult[]> { return { parse(token: Token<TKind>): ParserOutput<TKind, TResult[]> { let error: ParseError | undefined; const result: ParseResult<TKind, TResult[]>[] = [{ nextToken: token, result: [] }]; ...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
function applyList<TResult, TSeparator>(value: [TResult, [TSeparator, TResult][]]): TResult[] { return [value[0]].concat(value[1].map((pair: [TSeparator, TResult]) => { return pair[1]; })); }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
export function list<TKind, TResult, TSeparator>(p: Parser<TKind, TResult>, s: Parser<TKind, TSeparator>): Parser<TKind, TResult[]> { return apply(seq(p, rep(seq(s, p))), applyList); }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
export function list_sc<TKind, TResult, TSeparator>(p: Parser<TKind, TResult>, s: Parser<TKind, TSeparator>): Parser<TKind, TResult[]> { return apply(seq(p, rep_sc(seq(s, p))), applyList); }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
function applyLrec<TResult, TFirst extends TResult, TSecond>(callback: (a: TResult, b: TSecond) => TResult): (value: [TFirst, TSecond[]]) => TResult { return (value: [TFirst, TSecond[]]): TResult => { let result: TResult = value[0]; for (const tail of value[1]) { result = callback(resul...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
export function lrec<TKind, TResult, TFirst extends TResult, TSecond>(p: Parser<TKind, TFirst>, q: Parser<TKind, TSecond>, callback: (a: TResult, b: TSecond) => TResult): Parser<TKind, TResult> { return apply(seq(p, rep(q)), applyLrec(callback)); }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
FunctionDeclaration
export function lrec_sc<TKind, TResult, TFirst extends TResult, TSecond>(p: Parser<TKind, TFirst>, q: Parser<TKind, TSecond>, callback: (a: TResult, b: TSecond) => TResult): Parser<TKind, TResult> { return apply(seq(p, rep_sc(q)), applyLrec(callback)); }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
ArrowFunction
(pair: [TSeparator, TResult]) => { return pair[1]; }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
ArrowFunction
(value: [TFirst, TSecond[]]): TResult => { let result: TResult = value[0]; for (const tail of value[1]) { result = callback(result, tail); } return result; }
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
MethodDeclaration
parse(token: Token<TKind>): ParserOutput<TKind, TResult[]> { const output = reprParser.parse(token); if (output.successful) { return { candidates: output.candidates.reverse(), successful: true, error: output.error ...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
MethodDeclaration
parse(token: Token<TKind>): ParserOutput<TKind, TResult[]> { let error: ParseError | undefined; let result: ParseResult<TKind, TResult[]>[] = [{ nextToken: token, result: [] }]; while (true) { const steps = result; result = []; for (c...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
MethodDeclaration
parse(token: Token<TKind>): ParserOutput<TKind, TResult[]> { let error: ParseError | undefined; const result: ParseResult<TKind, TResult[]>[] = [{ nextToken: token, result: [] }]; for (let i = 0; i < result.length; i++) { const step = result[i]; cons...
LionCoder4ever/react-native-tscodegen
packages/ts-parsec/src/Parsers/RepeativeParser.ts
TypeScript
ClassDeclaration
@Injectable() export class CommentService { constructor( @InjectRepository(CommentEntity) private readonly comment: Repository<CommentEntity>, @InjectRepository(ItemEntity) private readonly item: Repository<ItemEntity>, ) {} async register( owner: UserEntity, { itemId, content }: CommentRegi...
maaaaaaaaad/docker-pro-server
src/comment/comment.service.ts
TypeScript
MethodDeclaration
async register( owner: UserEntity, { itemId, content }: CommentRegisterInputDto, ) { try { const item = await this.item.findOne({ where: { pk: itemId, }, }) if (!item) { return { access: false, message: 'Not found item', } ...
maaaaaaaaad/docker-pro-server
src/comment/comment.service.ts
TypeScript
MethodDeclaration
async getAll({ itemId, size, page }: CommentsGetInputDto) { try { const item = await this.item.findOne({ where: { pk: itemId, }, }) if (!item) { return { access: false, message: 'Not found item', } } const [comments, commen...
maaaaaaaaad/docker-pro-server
src/comment/comment.service.ts
TypeScript
MethodDeclaration
async getMy(owner: UserEntity, { size, page }: CommentsMyInputDto) { try { const [comments, commentsCount] = await this.comment.findAndCount({ where: { owner: { pk: owner.pk, }, }, take: size, skip: (page - 1) * size, order: { ...
maaaaaaaaad/docker-pro-server
src/comment/comment.service.ts
TypeScript
FunctionDeclaration
async function main(url: string) { const res = await superagent .post(url) .send({ a: 'b' }) .set('Accept', '*/*') .timeout(3 * 1000) .agent(url.startsWith('https:') ? httpsAgent : httpAgent) .catch(error => { // ステータスエラーとかはそのままthrowされるとちょっと長い throw `name=${error.name} message=${error.message} statu...
mei23/newreq
src/superagent.ts
TypeScript
ArrowFunction
error => { // ステータスエラーとかはそのままthrowされるとちょっと長い throw `name=${error.name} message=${error.message} status=${error.status} code=${error.code}`; // name=Error message=Not Found status=404 statusCode=404 code='ECONNABORTED' // name=Error message=Timeout of 3000ms exceeded status=undefined code='ECONNABORTED' ...
mei23/newreq
src/superagent.ts
TypeScript
ArrowFunction
e => { console.log(inspect(e)); }
mei23/newreq
src/superagent.ts
TypeScript
ArrowFunction
()=>{ let completedAssignmentComponent: CompletedAssignmentComponent; let completedAssignmentFixture : ComponentFixture<CompletedAssignmentComponent>; beforeEach(()=>{ TestBed.configureTestingModule({ declarations: [CompletedAssignmentComponent], imports : [CommonModule, MaterialModule,...
CohesionForce/kohese-server
kohese-portal/client/src/components/dashboard/assignment-dashboard/completed-assignment/completed-assignment.component.spec.ts
TypeScript
ArrowFunction
()=>{ TestBed.configureTestingModule({ declarations: [CompletedAssignmentComponent], imports : [CommonModule, MaterialModule, BrowserAnimationsModule, PipesModule ], schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [ {provide: DialogService, useClass...
CohesionForce/kohese-server
kohese-portal/client/src/components/dashboard/assignment-dashboard/completed-assignment/completed-assignment.component.spec.ts
TypeScript
ArrowFunction
() => { completedAssignmentFixture.destroy(); TestBed.resetTestingModule(); }
CohesionForce/kohese-server
kohese-portal/client/src/components/dashboard/assignment-dashboard/completed-assignment/completed-assignment.component.spec.ts
TypeScript