type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
public async getBuildMessages(timestamp: number): Promise<string[]> { const client: any = await this.createAndInitClient(); const userId: string = await this.getUserId(); return new Promise<string[]>((resolve, reject) => { client.methodCall("IDEPluginNotificator.getBuildMessages", [userId, timestamp.toString()], (err, data) => { if (err) { Logger.logError("IDEPluginNotificator.getBuildMessages: return an error: " + Utils.formatErrorMessage(err)); return reject(err); } resolve(data); }); }); }
JetBrains/teamcity-vscode-extension
src/dal/remotebuildserver.ts
TypeScript
MethodDeclaration
/** * @param suitableConfigurations - array of build configurations. Extension requests all related projects to collect full information * about build configurations (including projectNames and buildConfigurationName). The information is required to create label for BuildConfig. * @return - array of buildXml */ public async getRelatedBuilds(suitableConfigurations: string[]): Promise<string[]> { const client: any = await this.createAndInitClient(); return new Promise<string[]>((resolve, reject) => { client.methodCall("RemoteBuildServer2.getRelatedProjects", [suitableConfigurations], (err, buildXmlArray) => { if (err) { Logger.logError("RemoteBuildServer2.getRelatedProjects failed with error: " + Utils.formatErrorMessage(err)); return reject(err); } else if (!buildXmlArray) { Logger.logError("RemoteBuildServer2.getRelatedBuilds: buildXmlArray is unexpectedly empty " + new Error().stack); return reject("Build array is unexpectedly empty"); } resolve(buildXmlArray); }); }); }
JetBrains/teamcity-vscode-extension
src/dal/remotebuildserver.ts
TypeScript
ClassDeclaration
export default class ChartProps<FormDataType extends CamelCaseFormData | SnakeCaseFormData = CamelCaseFormData> { static createSelector: () => ChartPropsSelector; annotationData: AnnotationData; datasource: CamelCaseDatasource; rawDatasource: SnakeCaseDatasource; initialValues: InitialValues; formData: CamelCaseFormData; rawFormData: SnakeCaseFormData | CamelCaseFormData; height: number; hooks: Hooks; queryData: QueryData; width: number; constructor(config?: ChartPropsConfig); }
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
InterfaceDeclaration
/** * Preferred format for ChartProps config */ export interface ChartPropsConfig { annotationData?: AnnotationData; /** Datasource metadata */ datasource?: SnakeCaseDatasource; /** * Formerly called "filters", which was misleading because it is actually * initial values of the filter_box and table vis */ initialValues?: InitialValues; /** Main configuration of the chart */ formData?: SnakeCaseFormData; /** Chart height */ height?: number; /** Programmatic overrides such as event handlers, renderers */ hooks?: Hooks; /** Formerly called "payload" */ queryData?: QueryData; /** Chart width */ width?: number; }
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
declare type AnnotationData = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
declare type CamelCaseDatasource = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
declare type SnakeCaseDatasource = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
declare type CamelCaseFormData = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
declare type SnakeCaseFormData = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
export declare type QueryData = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
/** Initial values for the visualizations, currently used by only filter_box and table */ declare type InitialValues = PlainObject;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
declare type ChartPropsSelector = (c: ChartPropsConfig) => ChartProps;
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
/** Optional field for event handlers, renderers */ declare type Hooks = { /** handle adding filters */ onAddFilter?: HandlerFunction; /** handle errors */ onError?: HandlerFunction; /** use the vis as control to update state */ setControlValue?: HandlerFunction; /** handle tooltip */ setTooltip?: HandlerFunction; [key: string]: any; };
kumarss20/superset-neo4j
superset/assets/node_modules/@superset-ui/chart/lib/models/ChartProps.d.ts
TypeScript
TypeAliasDeclaration
/* eslint-disable camelcase */ export type SubredditType = { id: number; name: string; commentNum: string; };
ashwin003/Reddit-Wherever
src/components/types.ts
TypeScript
TypeAliasDeclaration
export type DataType = { data: { score: number; title: string; permalink: string; created_utc: number; author: string; subreddit: string; num_comments: number; id: string; parent_id: string; children: string[]; count: number; body_html: string; likes: boolean; name: string; replies: { kind: string; data: { children: DataType[]; }; }; }; kind: string; length: number; };
ashwin003/Reddit-Wherever
src/components/types.ts
TypeScript
FunctionDeclaration
export default function HeaderContainer({ mode, scenes, layout, insets, state, getPreviousRoute, onContentHeightChange, gestureDirection, styleInterpolator, style, }: Props) { const focusedRoute = state.routes[state.index]; return ( <View pointerEvents="box-none" style={style}> {scenes.slice(-3).map((scene, i, self) => { if ((mode === 'screen' && i !== self.length - 1) || !scene) { return null; } const { options } = scene.descriptor; const isFocused = focusedRoute.key === scene.route.key; const previousRoute = getPreviousRoute({ route: scene.route }); let previous; if (previousRoute) { // The previous scene will be shortly before the current scene in the array // So loop back from current index to avoid looping over the full array for (let j = i - 1; j >= 0; j--) { const s = self[j]; if (s && s.route.key === previousRoute.key) { previous = s; break; } } } // If the screen is next to a headerless screen, we need to make the header appear static // This makes the header look like it's moving with the screen const previousScene = self[i - 1]; const nextScene = self[i + 1]; const isHeaderStatic = (previousScene && previousScene.descriptor.options.headerShown === false && // We still need to animate when coming back from next scene // A hacky way to check this is if the next scene exists !nextScene) || (nextScene && nextScene.descriptor.options.headerShown === false); const props = { mode, layout, insets, scene, previous, navigation: scene.descriptor.navigation as StackNavigationProp< ParamListBase >, styleInterpolator: mode === 'float' ? isHeaderStatic ? gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? forSlideUp : forSlideLeft : styleInterpolator : forNoAnimation, }; return ( <NavigationContext.Provider key={scene.route.key} value={scene.descriptor.navigation} > <View onLayout={ onContentHeightChange ? e => onContentHeightChange({ route: scene.route, height: e.nativeEvent.layout.height, }) : undefined } pointerEvents={isFocused ? 'box-none' : 'none'} accessibilityElementsHidden={!isFocused} importantForAccessibility={ isFocused ? 'auto' : 'no-hide-descendants' } style={ mode === 'float' || options.headerTransparent ? styles.header : null } > {options.headerShown !== false ? ( options.header !== undefined ? ( options.header(props) ) : ( <Header {...props} /> ) ) : null} </View> </NavigationContext.Provider> ); }
jamesallain/starter
packages/stack/src/views/Header/HeaderContainer.tsx
TypeScript
ArrowFunction
(scene, i, self) => { if ((mode === 'screen' && i !== self.length - 1) || !scene) { return null; } const { options } = scene.descriptor; const isFocused = focusedRoute.key === scene.route.key; const previousRoute = getPreviousRoute({ route: scene.route }); let previous; if (previousRoute) { // The previous scene will be shortly before the current scene in the array // So loop back from current index to avoid looping over the full array for (let j = i - 1; j >= 0; j--) { const s = self[j]; if (s && s.route.key === previousRoute.key) { previous = s; break; } } } // If the screen is next to a headerless screen, we need to make the header appear static // This makes the header look like it's moving with the screen const previousScene = self[i - 1]; const nextScene = self[i + 1]; const isHeaderStatic = (previousScene && previousScene.descriptor.options.headerShown === false && // We still need to animate when coming back from next scene // A hacky way to check this is if the next scene exists !nextScene) || (nextScene && nextScene.descriptor.options.headerShown === false); const props = { mode, layout, insets, scene, previous, navigation: scene.descriptor.navigation as StackNavigationProp< ParamListBase >, styleInterpolator: mode === 'float' ? isHeaderStatic ? gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? forSlideUp : forSlideLeft : styleInterpolator : forNoAnimation, }; return ( <NavigationContext.Provider key={scene.route.key} value={scene.descriptor.navigation} > <View onLayout={ onContentHeightChange ? e => onContentHeightChange({ route: scene.route, height: e.nativeEvent.layout.height, }) : undefined } pointerEvents={isFocused ? 'box-none' : 'none'} accessibilityElementsHidden={!isFocused}
jamesallain/starter
packages/stack/src/views/Header/HeaderContainer.tsx
TypeScript
ArrowFunction
e => onContentHeightChange({ route: scene.route, height: e.nativeEvent.layout.height, })
jamesallain/starter
packages/stack/src/views/Header/HeaderContainer.tsx
TypeScript
TypeAliasDeclaration
export type Props = { mode: 'float' | 'screen'; layout: Layout; insets: EdgeInsets; scenes: (Scene<Route<string>> | undefined)[]; state: StackNavigationState; getPreviousRoute: (props: { route: Route<string>; }) => Route<string> | undefined; onContentHeightChange?: (props: { route: Route<string>; height: number; }) => void; styleInterpolator: StackHeaderStyleInterpolator; gestureDirection: GestureDirection; style?: StyleProp<ViewStyle>; };
jamesallain/starter
packages/stack/src/views/Header/HeaderContainer.tsx
TypeScript
ClassDeclaration
export class Auth extends BaseEntity<string, IAuth> implements IAuth { get userId(): string { return this.data.userId; } set userId(val: string) { if (!isUUID(val)) throw new SystemError(MessageError.PARAM_INVALID, { t: 'user' }); this.data.userId = val; } get type(): AuthType { return this.data.type; } set type(val: AuthType) { this.data.type = val; } get username(): string { return this.data.username; } set username(val: string) { val = val.trim(); if (val.length < 6) throw new SystemError(MessageError.PARAM_LEN_GREATER_OR_EQUAL, { t: 'username' }, 6); if (val.length > 120) throw new SystemError(MessageError.PARAM_LEN_LESS_OR_EQUAL, { t: 'username' }, 120); this.data.username = val; } get password(): string { return this.data.password; } set password(val: string) { const regExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&*()-_=+[{\]}\\|;:'",<.>/?]).{8,20}$/; if (!regExp.test(val)) throw new SystemError(MessageError.PARAM_LEN_AT_LEAST_AND_MAX_SPECIAL, { t: 'password' }, 6, 20); this.data.password = this._hashPassword(val); } get forgotKey(): string | null { return this.data.forgotKey; } set forgotKey(val: string | null) { if (val && val.length !== 64) throw new SystemError(MessageError.PARAM_LEN_EQUAL, { t: 'forgot_key' }, 64); this.data.forgotKey = val; } get forgotExpire(): Date | null { return this.data.forgotExpire; } set forgotExpire(val: Date | null) { this.data.forgotExpire = val; } /* Relationship */ get user(): User | null { return this.data.user ? new User(this.data.user) : null; } /* Handlers */ private _hashPassword(password: string): string { return hashMD5(password, '$$'); } comparePassword(password: string): boolean { return this.password === this._hashPassword(password); } }
felixle236/node-core
src/core/domain/entities/auth/Auth.ts
TypeScript
MethodDeclaration
/* Handlers */ private _hashPassword(password: string): string { return hashMD5(password, '$$'); }
felixle236/node-core
src/core/domain/entities/auth/Auth.ts
TypeScript
MethodDeclaration
comparePassword(password: string): boolean { return this.password === this._hashPassword(password); }
felixle236/node-core
src/core/domain/entities/auth/Auth.ts
TypeScript
InterfaceDeclaration
export interface GlobalComponents { Counter: typeof import('./src/components/Counter.vue')['default'] Footer: typeof import('./src/components/Footer.vue')['default'] MineBlock: typeof import('./src/components/MineBlock.vue')['default'] }
TwoKe945/vue-minesweeper
components.d.ts
TypeScript
ClassDeclaration
@Module({ imports: [TypeOrmModule.forFeature([Effect])], providers: [EffectService], controllers: [EffectController], }) export class EffectModule {}
Nicklason/tf2-schema-service
src/effect/effect.module.ts
TypeScript
FunctionDeclaration
function Searchbar({ onSearch }: ISearchbarProps) { return ( <Input size="large" className="searchbar" placeholder="Search a product..." onChange={(e) => onSearch(e.target.value)}
WalkingPizza/velasca_challenge
src/SearchBar/SearchBar.tsx
TypeScript
ArrowFunction
() => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getTitleText()).toEqual('Welcome to emojifier!'); }); }
Brihadeeshrk/mlh-emojifier-final
e2e/src/app.e2e-spec.ts
TypeScript
ArrowFunction
() => { page.navigateTo(); expect(page.getTitleText()).toEqual('Welcome to emojifier!'); }
Brihadeeshrk/mlh-emojifier-final
e2e/src/app.e2e-spec.ts
TypeScript
ArrowFunction
() => { let testContext: Context; beforeEach(() => { testContext = {} as Context; }); describe('with keypair version RSA-2048 (A)', () => { beforeEach(() => { testContext.plainUserKeyPairContainer = { privateKeyContainer: plainPrivateKey2048 as PrivateKeyContainer, publicKeyContainer: publicKey2048 as PublicKeyContainer }; testContext.password = 'Qwer1234!'; }); test('should return a UserKeyPairContainer with the correct properties', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(Object.keys(userKeyPairContainer)).toContain('privateKeyContainer'); expect(Object.keys(userKeyPairContainer)).toContain('publicKeyContainer'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('privateKey'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('publicKey'); }); test('should return a UserKeyPairContainer with the correct crypto version', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.version).toBe(UserKeyPairVersion.RSA2048); expect(userKeyPairContainer.publicKeyContainer.version).toBe(UserKeyPairVersion.RSA2048); }); test('should return a UserKeyPairContainer with keys in PEM format', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----BEGIN ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----END ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----BEGIN PUBLIC KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----END PUBLIC KEY-----'); }); test('should return a UserKeyPairContainer with identical public key', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.publicKeyContainer.publicKey).toBe( testContext.plainUserKeyPairContainer.publicKeyContainer.publicKey ); }); }); describe('with keypair version RSA-4096', () => { beforeEach(() => { testContext.plainUserKeyPairContainer = { privateKeyContainer: plainPrivateKey4096 as PrivateKeyContainer, publicKeyContainer: publicKey4096 as PublicKeyContainer }; testContext.password = 'Qwer1234!'; }); test('should return a UserKeyPairContainer with the correct properties', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(Object.keys(userKeyPairContainer)).toContain('privateKeyContainer'); expect(Object.keys(userKeyPairContainer)).toContain('publicKeyContainer'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('privateKey'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('publicKey'); }); test('should return a UserKeyPairContainer with the correct crypto version', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.version).toBe(UserKeyPairVersion.RSA4096); expect(userKeyPairContainer.publicKeyContainer.version).toBe(UserKeyPairVersion.RSA4096); }); test('should return a UserKeyPairContainer with keys in PEM format', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----BEGIN ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----END ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----BEGIN PUBLIC KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----END PUBLIC KEY-----'); }); test('should return a UserKeyPairContainer with identical public key', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.publicKeyContainer.publicKey).toBe( testContext.plainUserKeyPairContainer.publicKeyContainer.publicKey ); }); }); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { testContext = {} as Context; }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { beforeEach(() => { testContext.plainUserKeyPairContainer = { privateKeyContainer: plainPrivateKey2048 as PrivateKeyContainer, publicKeyContainer: publicKey2048 as PublicKeyContainer }; testContext.password = 'Qwer1234!'; }); test('should return a UserKeyPairContainer with the correct properties', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(Object.keys(userKeyPairContainer)).toContain('privateKeyContainer'); expect(Object.keys(userKeyPairContainer)).toContain('publicKeyContainer'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('privateKey'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('publicKey'); }); test('should return a UserKeyPairContainer with the correct crypto version', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.version).toBe(UserKeyPairVersion.RSA2048); expect(userKeyPairContainer.publicKeyContainer.version).toBe(UserKeyPairVersion.RSA2048); }); test('should return a UserKeyPairContainer with keys in PEM format', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----BEGIN ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----END ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----BEGIN PUBLIC KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----END PUBLIC KEY-----'); }); test('should return a UserKeyPairContainer with identical public key', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.publicKeyContainer.publicKey).toBe( testContext.plainUserKeyPairContainer.publicKeyContainer.publicKey ); }); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { testContext.plainUserKeyPairContainer = { privateKeyContainer: plainPrivateKey2048 as PrivateKeyContainer, publicKeyContainer: publicKey2048 as PublicKeyContainer }; testContext.password = 'Qwer1234!'; }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(Object.keys(userKeyPairContainer)).toContain('privateKeyContainer'); expect(Object.keys(userKeyPairContainer)).toContain('publicKeyContainer'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('privateKey'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('publicKey'); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.version).toBe(UserKeyPairVersion.RSA2048); expect(userKeyPairContainer.publicKeyContainer.version).toBe(UserKeyPairVersion.RSA2048); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----BEGIN ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----END ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----BEGIN PUBLIC KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----END PUBLIC KEY-----'); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.publicKeyContainer.publicKey).toBe( testContext.plainUserKeyPairContainer.publicKeyContainer.publicKey ); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { beforeEach(() => { testContext.plainUserKeyPairContainer = { privateKeyContainer: plainPrivateKey4096 as PrivateKeyContainer, publicKeyContainer: publicKey4096 as PublicKeyContainer }; testContext.password = 'Qwer1234!'; }); test('should return a UserKeyPairContainer with the correct properties', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(Object.keys(userKeyPairContainer)).toContain('privateKeyContainer'); expect(Object.keys(userKeyPairContainer)).toContain('publicKeyContainer'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.privateKeyContainer)).toContain('privateKey'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('version'); expect(Object.keys(userKeyPairContainer.publicKeyContainer)).toContain('publicKey'); }); test('should return a UserKeyPairContainer with the correct crypto version', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.version).toBe(UserKeyPairVersion.RSA4096); expect(userKeyPairContainer.publicKeyContainer.version).toBe(UserKeyPairVersion.RSA4096); }); test('should return a UserKeyPairContainer with keys in PEM format', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----BEGIN ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.privateKeyContainer.privateKey).toContain('-----END ENCRYPTED PRIVATE KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----BEGIN PUBLIC KEY-----'); expect(userKeyPairContainer.publicKeyContainer.publicKey).toContain('-----END PUBLIC KEY-----'); }); test('should return a UserKeyPairContainer with identical public key', () => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.publicKeyContainer.publicKey).toBe( testContext.plainUserKeyPairContainer.publicKeyContainer.publicKey ); }); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { testContext.plainUserKeyPairContainer = { privateKeyContainer: plainPrivateKey4096 as PrivateKeyContainer, publicKeyContainer: publicKey4096 as PublicKeyContainer }; testContext.password = 'Qwer1234!'; }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => { const userKeyPairContainer: UserKeyPairContainer = Crypto.encryptPrivateKey( testContext.plainUserKeyPairContainer, testContext.password ); expect(userKeyPairContainer.privateKeyContainer.version).toBe(UserKeyPairVersion.RSA4096); expect(userKeyPairContainer.publicKeyContainer.version).toBe(UserKeyPairVersion.RSA4096); }
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
TypeAliasDeclaration
type Context = { plainUserKeyPairContainer: PlainUserKeyPairContainer; password: string; };
dracoon/dracoon-javascript-crypto-sdk
test/spec/encryptPrivateKey.spec.ts
TypeScript
ArrowFunction
() => ({ createContextFactory: jest.fn().mockImplementation(() => ({})) })
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => ({ TodoStore: jest.fn() })
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => ({ OptionStore: jest.fn() })
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => ({ configure: jest.fn() })
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { beforeEach(() => { // @ts-ignore Currently the easiest way to reset private singleton variable RootStore.me = undefined; }); describe("configure", () => { it("should call configure to always force actions", () => { expect(mobx.configure).toHaveBeenCalledWith(expect.objectContaining({ enforceActions: "always" })); }); }); describe("RootStore", () => { describe("context", () => { it("should cache context factory result", () => { RootStore.get.context; RootStore.get.context; expect(createContextFactory).toHaveBeenCalledTimes(1); }); }); describe("constructor", () => { it("should act as singleton", () => { RootStore.get; RootStore.get; expect(TodoStore).toHaveBeenCalledTimes(1); }); it("should initiate multiple stores", () => { RootStore.get; expect(TodoStore).toHaveBeenCalledWith(expect.any(Object)); expect(OptionStore).toHaveBeenCalledWith(expect.any(Object)); }); }); describe("StoreProvider", () => { it("should obtain StoreProvider from factory", () => { jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: jest.fn(), useStores: null }); const actual = RootStore.StoreProvider; expect(actual).toBeDefined(); }); }); }); describe("useStores", () => { it("should get StoreContext from factory result", () => { const mockUseStores = jest.fn(); jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: null, useStores: mockUseStores }); useStores(); expect(mockUseStores).toHaveBeenCalled(); }); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { // @ts-ignore Currently the easiest way to reset private singleton variable RootStore.me = undefined; }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { it("should call configure to always force actions", () => { expect(mobx.configure).toHaveBeenCalledWith(expect.objectContaining({ enforceActions: "always" })); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { expect(mobx.configure).toHaveBeenCalledWith(expect.objectContaining({ enforceActions: "always" })); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { describe("context", () => { it("should cache context factory result", () => { RootStore.get.context; RootStore.get.context; expect(createContextFactory).toHaveBeenCalledTimes(1); }); }); describe("constructor", () => { it("should act as singleton", () => { RootStore.get; RootStore.get; expect(TodoStore).toHaveBeenCalledTimes(1); }); it("should initiate multiple stores", () => { RootStore.get; expect(TodoStore).toHaveBeenCalledWith(expect.any(Object)); expect(OptionStore).toHaveBeenCalledWith(expect.any(Object)); }); }); describe("StoreProvider", () => { it("should obtain StoreProvider from factory", () => { jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: jest.fn(), useStores: null }); const actual = RootStore.StoreProvider; expect(actual).toBeDefined(); }); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { it("should cache context factory result", () => { RootStore.get.context; RootStore.get.context; expect(createContextFactory).toHaveBeenCalledTimes(1); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { RootStore.get.context; RootStore.get.context; expect(createContextFactory).toHaveBeenCalledTimes(1); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { it("should act as singleton", () => { RootStore.get; RootStore.get; expect(TodoStore).toHaveBeenCalledTimes(1); }); it("should initiate multiple stores", () => { RootStore.get; expect(TodoStore).toHaveBeenCalledWith(expect.any(Object)); expect(OptionStore).toHaveBeenCalledWith(expect.any(Object)); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { RootStore.get; RootStore.get; expect(TodoStore).toHaveBeenCalledTimes(1); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { RootStore.get; expect(TodoStore).toHaveBeenCalledWith(expect.any(Object)); expect(OptionStore).toHaveBeenCalledWith(expect.any(Object)); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { it("should obtain StoreProvider from factory", () => { jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: jest.fn(), useStores: null }); const actual = RootStore.StoreProvider; expect(actual).toBeDefined(); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: jest.fn(), useStores: null }); const actual = RootStore.StoreProvider; expect(actual).toBeDefined(); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { it("should get StoreContext from factory result", () => { const mockUseStores = jest.fn(); jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: null, useStores: mockUseStores }); useStores(); expect(mockUseStores).toHaveBeenCalled(); }); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ArrowFunction
() => { const mockUseStores = jest.fn(); jest.spyOn(RootStore.prototype, "context", "get").mockReturnValue({ StoreContext: null, StoreProvider: null, useStores: mockUseStores }); useStores(); expect(mockUseStores).toHaveBeenCalled(); }
wickykane/lyd-wp-plugins
plugins/lyd-plugin/test/jest/store/stores.test.tsx
TypeScript
ClassDeclaration
@Module({ imports: [TypeOrmModule.forFeature([Product, Brand, Category])], controllers: [ProductsController, CategoriesController, BrandsController], providers: [ProductsService, CategoriesService, BrandsService], }) export class ProductsModule {}
nicobytes/nestjs-02
src/products/products.module.ts
TypeScript
TypeAliasDeclaration
export type PublicFormAuthRedirectDto = { redirectURL: string }
ICTASL/FormSG
shared/types/form/form_auth.ts
TypeScript
TypeAliasDeclaration
export type PublicFormAuthValidateEsrvcIdDto = | { isValid: true } | { isValid: false; errorCode: string | null }
ICTASL/FormSG
shared/types/form/form_auth.ts
TypeScript
TypeAliasDeclaration
export type PublicFormAuthLogoutDto = { message: string }
ICTASL/FormSG
shared/types/form/form_auth.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-orden-gasto', templateUrl: './orden-gasto.component.html', styleUrls: ['./orden-gasto.component.scss'] }) export class OrdenGastoComponent implements OnInit { ordenGasto: OrdenGasto; ordenGastoOne: Array<OrdenGasto>;w constructor( private Servicios: Orde) { } ngOnInit() { } }
DJRICHARD15/FrontEnd
.history/src/app/orden-gasto/orden-gasto.component_20190318093451.ts
TypeScript
InterfaceDeclaration
export interface IInputs extends ServerlessProfile { props: IProperties; args: string; path: { configPath: string; // 配置路径 }; credentials?: ICredentials; argsObj: any; command: string; }
DevDengChao/fc
src/lib/interface/interface.ts
TypeScript
InterfaceDeclaration
export interface IProperties { region: string; service?: ServiceConfig; function?: FunctionConfig; triggers?: TriggerConfig[]; customDomains?: CustomDomainConfig[]; }
DevDengChao/fc
src/lib/interface/interface.ts
TypeScript
ClassDeclaration
export class Product { id: number; name: string; price: number; description: string; details: string; imgUrl: string; target: string; category: string; type: string; imagesUrl: string[]; }
dekapp/OnlineShop-FrontEnd
OnlineShop-FrontEnd/src/app/middle wrapper/shared/product.ts
TypeScript
ArrowFunction
t => { transformUnitTestProgram(t, 'union') .assertTypesEqual({ Union: { kind: Kind.union, types: [ { kind: Kind.literal, atom: Atom.string, value: 'a', }, { kind: Kind.literal, atom: Atom.string, value: 'b', }, ], }, Union2: { kind: Kind.union, types: [ { kind: Kind.literal, atom: Atom.string, value: 'a', }, { kind: Kind.literal, atom: Atom.string, value: 'b', }, { kind: Kind.literal, atom: Atom.string, value: 'c', }, ], }, }) .applyFastCheck(); }
hchauvin/reify-ts
packages/reify_ts/src/__tests__/union.test.ts
TypeScript
InterfaceDeclaration
export interface Friend extends Document { readonly name: string; readonly status: boolean; }
DiRaiks/football-planner-server-nestjs
src/players/interfaces/friend.interface.ts
TypeScript
ArrowFunction
(coverage) => { if (coverage != null) { if (coverage === 'Not Covered') { this.notCovered = true; this.dataService.Objects[this.dataService.currentObject].Coverage = 'Not Covered'; } else { const current = this.dataService.Objects[this.dataService.currentObject]; for (let i = 0; i < this.dataService.allObjects.length; i++) { if (current.LuggageClaimObject === this.dataService.allObjects[i].LuggageClaimObject && current.Brand === this.dataService.allObjects[i].Brand && current.Model === this.dataService.allObjects[i].Model) { this.dataService.listLuggageClaimObjectCalculatedCompensationAmount[this.dataService.currentObject].LuggageClaimObjectCurrentSalesValue = this.dataService.allObjects[i].ClaimObjectSalesValue.toString(); break; } } this.dataService.Objects[this.dataService.currentObject].Coverage = 'Covered'; this.router.navigate(['/object-compensation-details']); } } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ArrowFunction
(object) => { if (object.Brand === item.title) { this.modelList.push(object.Model); } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ArrowFunction
(object) => { if (object.Brand !== '' && this.brandList.find(b => b === object.Brand) == null && this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObject === object.LuggageClaimObject) { this.brandList.push(object.Brand); } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ArrowFunction
b => b === object.Brand
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ArrowFunction
p => p.Name === 'ValueListId'
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ArrowFunction
p => p.Name === 'PairId'
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ArrowFunction
(object) => { if (object.Brand !== '' && this.brandList.find(b => b === object.Brand) == null && this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObject === object.LuggageClaimObject) { this.brandList.push(object.Brand); } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'object-details', templateUrl: './object-details.component.html', providers: [AvolaClientService] }) export class ObjectDetailsComponent implements OnInit, OnDestroy, OnChanges { notCovered = false; objectLocation: ListData; handLuggage: PairData; completerDataServiceBrand: CompleterData; completerDataServiceModel: CompleterData; brandList: string[] = []; modelList: string[] = []; ngOnInit(): void { this.prepareValuePairsAndLists(); this.completerDataServiceBrand = this.completerService.local(this.brandList); } ngOnChanges(changes: any): void { } ngOnDestroy(): void { } constructor(private dataService: DataService, private router: Router, private avolaclient: AvolaClientService, private completerService: CompleterService) { } public checkCoverage() { this.avolaclient.checkObjectCoverage(this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject]).subscribe((coverage) => { if (coverage != null) { if (coverage === 'Not Covered') { this.notCovered = true; this.dataService.Objects[this.dataService.currentObject].Coverage = 'Not Covered'; } else { const current = this.dataService.Objects[this.dataService.currentObject]; for (let i = 0; i < this.dataService.allObjects.length; i++) { if (current.LuggageClaimObject === this.dataService.allObjects[i].LuggageClaimObject && current.Brand === this.dataService.allObjects[i].Brand && current.Model === this.dataService.allObjects[i].Model) { this.dataService.listLuggageClaimObjectCalculatedCompensationAmount[this.dataService.currentObject].LuggageClaimObjectCurrentSalesValue = this.dataService.allObjects[i].ClaimObjectSalesValue.toString(); break; } } this.dataService.Objects[this.dataService.currentObject].Coverage = 'Covered'; this.router.navigate(['/object-compensation-details']); } } }); } public onSelected(item: any): void { this.modelList = []; if (item != null) { this.dataService.allObjects.forEach((object) => { if (object.Brand === item.title) { this.modelList.push(object.Model); } }); this.completerDataServiceModel = this.completerService.local(this.modelList); } } public nextObject() { this.notCovered = false; if (this.dataService.Objects.length > this.dataService.currentObject + 1) { this.dataService.currentObject++; this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObjectinHandLuggage = this.handLuggage.ValueForFalse; this.brandList = []; this.dataService.allObjects.forEach((object) => { if (object.Brand !== '' && this.brandList.find(b => b === object.Brand) == null && this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObject === object.LuggageClaimObject) { this.brandList.push(object.Brand); } }); this.router.navigate(['/object-details']); } else { this.router.navigate(['/final-amount']); } } public prepareValuePairsAndLists(): void { const objectLocationId = this.dataService.mappedDatas[10].Properties.find(p => p.Name === 'ValueListId').Value; this.objectLocation = this.dataService.mappedLists[objectLocationId]; const handLuggageId = this.dataService.mappedDatas[9].Properties.find(p => p.Name === 'PairId').Value; this.handLuggage = this.dataService.mappedPairs[handLuggageId]; this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObjectinHandLuggage = this.handLuggage.ValueForFalse; this.dataService.allObjects.forEach((object) => { if (object.Brand !== '' && this.brandList.find(b => b === object.Brand) == null && this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObject === object.LuggageClaimObject) { this.brandList.push(object.Brand); } }); } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.prepareValuePairsAndLists(); this.completerDataServiceBrand = this.completerService.local(this.brandList); }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
ngOnChanges(changes: any): void { }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
ngOnDestroy(): void { }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
public checkCoverage() { this.avolaclient.checkObjectCoverage(this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject]).subscribe((coverage) => { if (coverage != null) { if (coverage === 'Not Covered') { this.notCovered = true; this.dataService.Objects[this.dataService.currentObject].Coverage = 'Not Covered'; } else { const current = this.dataService.Objects[this.dataService.currentObject]; for (let i = 0; i < this.dataService.allObjects.length; i++) { if (current.LuggageClaimObject === this.dataService.allObjects[i].LuggageClaimObject && current.Brand === this.dataService.allObjects[i].Brand && current.Model === this.dataService.allObjects[i].Model) { this.dataService.listLuggageClaimObjectCalculatedCompensationAmount[this.dataService.currentObject].LuggageClaimObjectCurrentSalesValue = this.dataService.allObjects[i].ClaimObjectSalesValue.toString(); break; } } this.dataService.Objects[this.dataService.currentObject].Coverage = 'Covered'; this.router.navigate(['/object-compensation-details']); } } }); }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
public onSelected(item: any): void { this.modelList = []; if (item != null) { this.dataService.allObjects.forEach((object) => { if (object.Brand === item.title) { this.modelList.push(object.Model); } }); this.completerDataServiceModel = this.completerService.local(this.modelList); } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
public nextObject() { this.notCovered = false; if (this.dataService.Objects.length > this.dataService.currentObject + 1) { this.dataService.currentObject++; this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObjectinHandLuggage = this.handLuggage.ValueForFalse; this.brandList = []; this.dataService.allObjects.forEach((object) => { if (object.Brand !== '' && this.brandList.find(b => b === object.Brand) == null && this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObject === object.LuggageClaimObject) { this.brandList.push(object.Brand); } }); this.router.navigate(['/object-details']); } else { this.router.navigate(['/final-amount']); } }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
MethodDeclaration
public prepareValuePairsAndLists(): void { const objectLocationId = this.dataService.mappedDatas[10].Properties.find(p => p.Name === 'ValueListId').Value; this.objectLocation = this.dataService.mappedLists[objectLocationId]; const handLuggageId = this.dataService.mappedDatas[9].Properties.find(p => p.Name === 'PairId').Value; this.handLuggage = this.dataService.mappedPairs[handLuggageId]; this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObjectinHandLuggage = this.handLuggage.ValueForFalse; this.dataService.allObjects.forEach((object) => { if (object.Brand !== '' && this.brandList.find(b => b === object.Brand) == null && this.dataService.listLuggageClaimObjectCoverage[this.dataService.currentObject].LuggageClaimObject === object.LuggageClaimObject) { this.brandList.push(object.Brand); } }); }
Avola/avola-rocks-angular
src/app/components/object-details/object-details.component.ts
TypeScript
ClassDeclaration
@customElement("ha-device-triggers-card") export class HaDeviceTriggersCard extends HaDeviceAutomationCard< DeviceTrigger > { protected type = "trigger"; protected headerKey = "ui.panel.config.devices.automation.triggers.caption"; constructor() { super(localizeDeviceAutomationTrigger); } }
Alex9779/home-assistant-polymer
src/panels/config/devices/device-detail/ha-device-triggers-card.ts
TypeScript
InterfaceDeclaration
interface HTMLElementTagNameMap { "ha-device-triggers-card": HaDeviceTriggersCard; }
Alex9779/home-assistant-polymer
src/panels/config/devices/device-detail/ha-device-triggers-card.ts
TypeScript
FunctionDeclaration
function MyApp({ Component, pageProps }: AppProps) { return ( <ChakraProvider resetCSS theme={theme}> <Header /> <Component {...pageProps} /> </ChakraProvider> ) }
alan-dx/ignite-worldtrip
src/pages/_app.tsx
TypeScript
FunctionDeclaration
function App() { let jsx: JSX.Element; switch (query.get('success')) { case 'once': jsx = <Once />; break; case 'monthly': jsx = <Monthly />; break; default: jsx = ( <> <Summary /> <Form amounts={[5, 10, 20, 50]} currency={{ symbol: '$' }} projects={initialState.projects} /> </> ); }
MaxDesiatov/fosspay
frontend/src/App.tsx
TypeScript
FunctionDeclaration
function RenderBarcode({ code, invalid }: PropTypes) { const svgRef = useCallback( (node) => { if (node !== null) { jsbarcode(node, code, { font: 'IBM Plex Sans', margin: 0, marginBottom: 5, }) } }, [code], ) return ( <svg className={cn(styles.barcodeSvg, { [styles.invalidBarcode]: invalid, })}
Fuglar-ehf/island.is
apps/gjafakort/web/screens/User/components/RenderBarcode/RenderBarcode.tsx
TypeScript
ArrowFunction
(node) => { if (node !== null) { jsbarcode(node, code, { font: 'IBM Plex Sans', margin: 0, marginBottom: 5, }) } }
Fuglar-ehf/island.is
apps/gjafakort/web/screens/User/components/RenderBarcode/RenderBarcode.tsx
TypeScript
InterfaceDeclaration
interface PropTypes { code: string invalid: boolean }
Fuglar-ehf/island.is
apps/gjafakort/web/screens/User/components/RenderBarcode/RenderBarcode.tsx
TypeScript
ArrowFunction
e => { try { return JSON.parse(e.message).message; } catch (_) { return e.message; } }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ArrowFunction
({ token, clientId }: ConnectedAccount): ReturnType<typeof paypal.core.PayPalHttpClient> => { const environment = config.env === 'production' ? new paypal.core.LiveEnvironment(clientId, token) : new paypal.core.SandboxEnvironment(clientId, token); return new paypal.core.PayPalHttpClient(environment); }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ArrowFunction
async ( connectedAccount: ConnectedAccount, request: PayoutRequestBody | Record<string, any>, ): Promise<any> => { try { const client = getPayPalClient(connectedAccount); const response = await client.execute(request); return response.result; } catch (e) { throw new Error(parseError(e)); } }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ArrowFunction
async ( connectedAccount: ConnectedAccount, requestBody: PayoutRequestBody, ): Promise<PayoutRequestResult> => { const request = new paypal.payouts.PayoutsPostRequest(); request.requestBody(requestBody); return executeRequest(connectedAccount, request); }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ArrowFunction
async ( connectedAccount: ConnectedAccount, batchId: string, ): Promise<PayoutBatchDetails> => { const request = new paypal.payouts.PayoutsGetRequest(batchId); request.page(1); request.pageSize(100); request.totalRequired(true); return executeRequest(connectedAccount, request); }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ArrowFunction
async ({ token, clientId }: ConnectedAccount): Promise<void> => { const client = getPayPalClient({ token, clientId }); await client.fetchAccessToken(); }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ArrowFunction
async ( { token, clientId, settings }: ConnectedAccount, req: any, ): Promise<void> => { const client = getPayPalClient({ token, clientId }); const request = { path: '/v1/notifications/verify-webhook-signature', verb: 'POST', body: { auth_algo: req.get('PAYPAL-AUTH-ALGO'), cert_url: req.get('PAYPAL-CERT-URL'), transmission_id: req.get('PAYPAL-TRANSMISSION-ID'), transmission_sig: req.get('PAYPAL-TRANSMISSION-SIG'), transmission_time: req.get('PAYPAL-TRANSMISSION-TIME'), webhook_id: settings.webhookId, webhook_event: req.body, }, headers: { 'Content-Type': 'application/json', }, }; try { const response = await client.execute(request); if (response?.result?.verification_status !== 'SUCCESS') { throw new Error('Invalid webhook request'); } } catch (e) { throw new Error(parseError(e)); } }
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
TypeAliasDeclaration
type ConnectedAccount = { token: string; clientId: string; settings?: { webhookId: string; }; };
Global19/opencollective-api
server/lib/paypal.ts
TypeScript
ClassDeclaration
// Copyright 2018 The Oppia Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Constants for shared services across Oppia. */ export class ServicesConstants { public static PAGE_CONTEXT = { COLLECTION_EDITOR: 'collection_editor', EXPLORATION_EDITOR: 'editor', EXPLORATION_PLAYER: 'learner', QUESTION_EDITOR: 'question_editor', QUESTION_PLAYER: 'question_player', SKILL_EDITOR: 'skill_editor', STORY_EDITOR: 'story_editor', TOPIC_EDITOR: 'topic_editor', TOPICS_AND_SKILLS_DASHBOARD: 'topics_and_skills_dashboard', OTHER: 'other' }; public static EXPLORATION_EDITOR_TAB_CONTEXT = { EDITOR: 'editor', PREVIEW: 'preview' }; public static EXPLORATION_FEATURES_URL = '/explorehandler/features/<exploration_id>'; public static FETCH_ISSUES_URL = '/issuesdatahandler/<exploration_id>'; public static FETCH_PLAYTHROUGH_URL = '/playthroughdatahandler/<exploration_id>/<playthrough_id>'; public static RESOLVE_ISSUE_URL = '/resolveissuehandler/<exploration_id>'; public static STORE_PLAYTHROUGH_URL = '/explorehandler/store_playthrough/<exploration_id>'; // Enables recording playthroughs from learner sessions. public static MIN_PLAYTHROUGH_DURATION_IN_SECS = 45; public static EARLY_QUIT_THRESHOLD_IN_SECS = 300; public static NUM_INCORRECT_ANSWERS_THRESHOLD = 3; public static NUM_REPEATED_CYCLES_THRESHOLD = 3; public static CURRENT_ACTION_SCHEMA_VERSION = 1; public static CURRENT_ISSUE_SCHEMA_VERSION = 1; // Whether to enable the promo bar functionality. This does not actually turn // on the promo bar, as that is gated by a config value (see config_domain). // This merely avoids checking for whether the promo bar is enabled for every // Oppia page visited. public static ENABLE_PROMO_BAR = true; public static SEARCH_DATA_URL = '/searchhandler/data'; public static STATE_ANSWER_STATS_URL = '/createhandler/state_answer_stats/<exploration_id>'; public static RTE_COMPONENT_SPECS = ( require('rich_text_components_definitions.ts')); }
AbhinavGopal/oppiabackup
core/templates/services/services.constants.ts
TypeScript
ArrowFunction
() => { this.destroyProvider(provider) }
Heat-Ledger-Ltd/heat-ui
app/src/services/AbstractDataProvider.ts
TypeScript
ArrowFunction
(p) => p != provider
Heat-Ledger-Ltd/heat-ui
app/src/services/AbstractDataProvider.ts
TypeScript