type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
public findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public findServers(...args: any[]): any { if (!this._secureChannel) { setImmediate(() => { callback(new Error("Invalid Secure Channel")); }); return; } if (args.length === 1) { return this.findServers({}, args[0]); } ...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public findServersOnNetwork(options?: FindServersOnNetworkRequestLike): Promise<ServerOnNetwork[]>;
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public findServersOnNetwork(callback: ResponseCallback<ServerOnNetwork[]>): void;
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public findServersOnNetwork( options: FindServersOnNetworkRequestLike, callback: ResponseCallback<ServerOnNetwork[]>): void;
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public findServersOnNetwork(...args: any[]): any { if (args.length === 1) { return this.findServersOnNetwork({}, args[0]); } const options = args[0] as FindServersOnNetworkRequestOptions; const callback = args[1] as ResponseCallback<ServerOnNetwork[]>; if (!this._s...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public _removeSession(session: ClientSessionImpl) { const index = this._sessions.indexOf(session); if (index >= 0) { const s = this._sessions.splice(index, 1)[0]; assert(s === session); assert(!_.contains(this._sessions, session)); assert(session._clien...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public disconnect(): Promise<void>;
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public disconnect(callback: ErrorCallback): void;
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public disconnect(...args: any[]): any { const callback = args[0]; assert(_.isFunction(callback), "expecting a callback function here"); debugLog("ClientBaseImpl#disconnect", this.endpointUrl); if (this.isReconnecting) { debugLog("ClientBaseImpl#disconnect called while reco...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
// override me ! public _on_connection_reestablished(callback: ErrorCallback) { callback(); }
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
public toString(): string { let str = ""; str += " defaultSecureTokenLifetime.... " + this.defaultSecureTokenLifetime + "\n"; str += " securityMode.................. " + this.securityMode.toString() + "\n"; str += " securityPolicy................ " + this.securityPolicy.toString() +...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
protected _addSession(session: ClientSessionImpl) { assert(!session._client || session._client === this); assert(!_.contains(this._sessions, session), "session already added"); session._client = this; this._sessions.push(session); if (this.keepSessionAlive) { sessio...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
private fetchServerCertificate(endpointUrl: string, callback: (err?: Error) => void): void { const discoveryUrl = this.discoveryUrl.length > 0 ? this.discoveryUrl : endpointUrl; debugLog("OPCUAClientImpl : getting serverCertificate"); // we have not been given the serverCertificate but this ce...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
private _acculumate_statistics() { if (this._secureChannel) { // keep accumulated statistics this._byteWritten += this._secureChannel.bytesWritten; this._byteRead += this._secureChannel.bytesRead; this._transactionsPerformed += this._secureChannel.transactionsPer...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
private _destroy_secure_channel() { if (this._secureChannel) { if (doDebug) { debugLog(" DESTROYING SECURE CHANNEL (isTransactionInProgress ?", this._secureChannel.isTransactionInProgress(), ")"); } this._acculumate_statistics(); this._secureC...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
private _close_pending_sessions(callback: ErrorCallback) { assert(_.isFunction(callback)); const sessions = _.clone(this._sessions); async.map(sessions, (session: ClientSessionImpl, next: () => void) => { assert(session._client === this); // note: to prevent next to be...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
MethodDeclaration
private _install_secure_channel_event_handlers(secureChannel: ClientSecureChannelLayer) { assert(this instanceof ClientBaseImpl); secureChannel.on("send_chunk", (chunk: Buffer) => { /** * notify the observer that a message_chunk has been sent * @event send_chunk ...
goldim/node-opcua
packages/node-opcua-client/source/private/client_base_impl.ts
TypeScript
ClassDeclaration
// tslint:disable:no-stateless-class // Grandfathered in export class TemporaryFile { static async create(fileName: string): Promise<string> { let folderName = getRandomHexString(12); let filePath = path.join(os.tmpdir(), folderName, fileName); await fse.ensureFile(filePath); return ...
Bhaskers-Blu-Org2/vscode-azurestorage
src/utils/temporaryFile.ts
TypeScript
MethodDeclaration
static async create(fileName: string): Promise<string> { let folderName = getRandomHexString(12); let filePath = path.join(os.tmpdir(), folderName, fileName); await fse.ensureFile(filePath); return filePath; }
Bhaskers-Blu-Org2/vscode-azurestorage
src/utils/temporaryFile.ts
TypeScript
ArrowFunction
async () => { let info = await gateway.info() console.log('info=====', info) let session = await gateway.create() console.dir(session) let handle = await session.attach('janus.plugin.streaming') console.dir(handle) let streams = await handle.request({ request: 'list' ...
notedit/janus-ts
tests/test_janus.ts
TypeScript
ClassDeclaration
export class OptionViewModel { title: string; answer: boolean; }
saykat/client-preparations.xyz
src/app/ViewModels/option.view.model.ts
TypeScript
ClassDeclaration
/** Provides operations to manage the userFlowAttributes property of the microsoft.graph.identityContainer entity. */ export class IdentityUserFlowAttributeItemRequestBuilder { /** Path parameters for the request */ private readonly pathParameters: Record<string, unknown>; /** The request adapter to use to ...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
MethodDeclaration
/** * Delete navigation property userFlowAttributes for identity * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @returns a RequestInformation */ public createDeleteRequestInformation(requestConfiguration?: IdentityUserFlowAttr...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
MethodDeclaration
/** * Represents entry point for identity userflow attributes. * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @returns a RequestInformation */ public createGetRequestInformation(requestConfiguration?: IdentityUserFlowAttribute...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
MethodDeclaration
/** * Update the navigation property userFlowAttributes in identity * @param body * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @returns a RequestInformation */ public createPatchRequestInformation(body: IdentityUserFlo...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
MethodDeclaration
/** * Delete navigation property userFlowAttributes for identity * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @param responseHandler Response handler to use in place of the default response handling provided by the core service ...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
MethodDeclaration
/** * Represents entry point for identity userflow attributes. * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @param responseHandler Response handler to use in place of the default response handling provided by the core service ...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
MethodDeclaration
/** * Update the navigation property userFlowAttributes in identity * @param body * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @param responseHandler Response handler to use in place of the default response handling provide...
microsoftgraph/msgraph-sdk-typescript
src/identity/userFlowAttributes/item/identityUserFlowAttributeItemRequestBuilder.ts
TypeScript
ArrowFunction
(theme: Theme) => ({ ...styled(theme), expired: { color: theme.color.red }, root: { display: 'flex', [theme.breakpoints.up('md')]: { justifyContent: 'space-between' } }, label: { [theme.breakpoints.only('sm')]: { minWidth: 150 } }, result: { marginLeft: theme.spa...
DevDW/manager
packages/manager/src/features/Billing/BillingPanels/SummaryPanel/PanelCards/CreditCard.tsx
TypeScript
ArrowFunction
props => { const { expiry, lastFour } = props; const classes = useStyles(); return ( <> <div className={`${classes.section} ${classes.root}`}
DevDW/manager
packages/manager/src/features/Billing/BillingPanels/SummaryPanel/PanelCards/CreditCard.tsx
TypeScript
InterfaceDeclaration
interface Props { lastFour?: string; expiry?: string; }
DevDW/manager
packages/manager/src/features/Billing/BillingPanels/SummaryPanel/PanelCards/CreditCard.tsx
TypeScript
TypeAliasDeclaration
export type CombinedProps = Props;
DevDW/manager
packages/manager/src/features/Billing/BillingPanels/SummaryPanel/PanelCards/CreditCard.tsx
TypeScript
FunctionDeclaration
export async function testFunc(): Promise<MongoClient> { const testClient: MongoClient = await MongoClient.connect(connectionString); return testClient; }
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
FunctionDeclaration
// Streams export function gridTest(bucket: GridFSBucket): void { const openUploadStream = bucket.openUploadStream('file.dat'); openUploadStream.on('close', () => {}); openUploadStream.on('end', () => {}); expectType<Promise<void>>(openUploadStream.abort()); // $ExpectType void expectType<void>( openUploa...
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
ArrowFunction
(err, client?: MongoClient) => { if (err || !client) throw err; const db = client.db('test'); db.collection('test_crud'); // Let's close the db client.close(); }
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
ArrowFunction
err => { if (err instanceof MongoError) { expectType<boolean>(err.hasErrorLabel('label')); } }
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
ArrowFunction
() => { openUploadStream.removeAllListeners(); }
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
ArrowFunction
error => { error; // $ExpectType MongoError }
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
ArrowFunction
(error, result) => {}
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
MethodDeclaration
// eslint-disable-next-line @typescript-eslint/no-unused-vars checkServerIdentity(host, cert) { return undefined; }
ImRodry/node-mongodb-native
test/types/community/client.test-d.ts
TypeScript
ArrowFunction
(response) => { // store user details and jwt token in local storage to keep user logged in between page refreshes localStorage.setItem('token', response.token); const tokenPayload = JSON.parse(atob(response.token.split('.')[1])); const user = {name: tokenPayload.name, id: tokenPayload....
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
ClassDeclaration
/** * Responsible for saving user name, id and jwt token in localstorage * and exposing the name and id through currentUserSubject */ @Injectable({providedIn: 'root'}) export class AuthenticationService { readonly userStorageKey = 'currentUser'; private currentUserSubject: BehaviorSubject<User>; public current...
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
InterfaceDeclaration
interface User { name: string; id: string; }
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
MethodDeclaration
fetchUserFromStorage(): User { return JSON.parse(localStorage.getItem(this.userStorageKey)); }
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
MethodDeclaration
saveUserToStorage(user: User): void { localStorage.setItem(this.userStorageKey, JSON.stringify(user)); }
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
MethodDeclaration
/** * If login is sucessfull save the user name, id and jwt token to local storage and expose the name and id * through currentUserSubject. If the login fails the returned observable errors. * @param username provided by user to LoginComponent * @param password provided by user to LoginComponent * @retur...
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
MethodDeclaration
/** * remove user from local storage and set subject holding the current user to null */ logout(): void { localStorage.removeItem('currentUser'); localStorage.removeItem('token'); this.router.navigate(['login']); this.currentUserSubject.next(null); }
ccims/ccims-frontend
src/app/auth/authentication.service.ts
TypeScript
InterfaceDeclaration
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. export interface AddressDTO { AddressId: string; City: string; Country: string; CountryRegion: string; District: string; FirstName: string; LastName: string; PhoneNumber: string; State: string; Street1: st...
microsoft/Dynamics-365-Fraud-Protection-ManualReview
frontend/src/data-services/api-services/models/address-dto.ts
TypeScript
FunctionDeclaration
function PageHeader(){ function handleGoBack(){ } return ( <View style={styles.container}> <View style={styles.topBar}> <BorderlessButton onPress={handleGoBack}> <Image source={}></Image> </BorderlessButton> </View> </View> ) }
gutoisa/Proffy
mobile/.history/src/components/PageHeader/index_20200808170713.tsx
TypeScript
FunctionDeclaration
function handleGoBack(){ }
gutoisa/Proffy
mobile/.history/src/components/PageHeader/index_20200808170713.tsx
TypeScript
ArrowFunction
() => { test('when there is only one duplicated url', () => { const content = { pages: [ { meta: { url: '/something/cool' } }, { meta: { url: '/something/cool' } } ] }; uniquefyUrls(content as Con...
jamiebuilds/docfy
packages/@docfy/core/tests/uniquefy-urls.test.ts
TypeScript
ArrowFunction
() => { const content = { pages: [ { meta: { url: '/something/cool' } }, { meta: { url: '/something/cool' } } ] }; uniquefyUrls(content as Context); expect(content.pages.map((page) => page.meta...
jamiebuilds/docfy
packages/@docfy/core/tests/uniquefy-urls.test.ts
TypeScript
ArrowFunction
(page) => page.meta.url
jamiebuilds/docfy
packages/@docfy/core/tests/uniquefy-urls.test.ts
TypeScript
ArrowFunction
() => { const content = { pages: [ { meta: { url: '/something/cool' } }, { meta: { url: '/something/cool' } }, { meta: { url: '/something/cool' } } ] }; ...
jamiebuilds/docfy
packages/@docfy/core/tests/uniquefy-urls.test.ts
TypeScript
ArrowFunction
() => { const content = { pages: [ { meta: { url: '/something/blog/' } }, { meta: { url: '/something/blog/' } } ] }; uniquefyUrls(content as Context); expect(content.pages.map((page) => page.me...
jamiebuilds/docfy
packages/@docfy/core/tests/uniquefy-urls.test.ts
TypeScript
ArrowFunction
({ children })=>{ const [logedIn, setLoggedIn] = useState(false) const [userDetail, setUserDetail] = useState({}) return ( <p></p> ) }
infsolution/invit
src/utils/authProvider.tsx
TypeScript
ArrowFunction
(e) => !e.startsWith('/~/')
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { const eachGroup: Path[] = []; eachGroup.push(e); if (this.props.associations) { let name = e; if (e in this.props.associations) { name = this.props.associations[e].metadata.title !== '' ? this.props.associations[e].metadata....
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(group, path) => { if (group.members.size > 0) { const groupEntries = group.members.values(); for (const member of groupEntries) { peerSet.add(member); } } const groupContacts = this.props.contacts[path]; if (groupContacts) { const groupEntries = group...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { return ( e[0].includes(searchTerm) || e[1].toLowerCase().includes(searchTerm) ); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { return ( e.includes(searchTerm) && !props.invites.ships.includes(e) ); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { return e.toLowerCase().includes(searchTerm); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(s) => s === searchTerm
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
([path]) => path === selected
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(ship) => ship === selected
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
([, name]) => name .toLowerCase() .split(' ') .some((s) => s.startsWith(searchTerm))
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(s) => s.startsWith(searchTerm)
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(a, b) => a[1].length - b[1].length
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { e.preventDefault(); e.stopPropagation(); this.nextSelection(); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { e.preventDefault(); e.stopPropagation(); this.nextSelection(true); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { e.preventDefault(); e.stopPropagation(); const { selected } = this.state; if (selected && selected.startsWith('/')) { this.addGroup(selected); } else if (selected) { this.addShip(selected); } this.setState({ selected: null }); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { return e !== ship; }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(group) => { return ( <li key={group[0]} className={ 'list white-d f8 pv2 ph3 pointer' + ' hover-bg-gray4 hover-bg-gray1-d ' + (group[1] ? 'inter' : 'mono') + (group[0] === state.selected ? ' bg-gray1-d bg-gray4' : '') ...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(ship) => { const nicknames = (this.state.contacts.get(ship) || []) .filter((e) => { return !(e === ''); }) .join(', '); return ( <li key={ship} className={ 'list mono white-d f8 pv1 ph3 pointer' + ...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(e) => { return !(e === ''); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(group) => { return ( <span key={group[0]} className={ 'f9 mono black pa2 bg-gray5 bg-gray1-d' + ' ba b--gray4 b--gray2-d white-d dib mr2 mt2 c-default' } > {group} <span className='white-d...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
(ship) => { return ( <span key={ship} className={ 'f9 mono black pa2 bg-gray5 bg-gray1-d' + ' ba b--gray4 b--gray2-d white-d dib mr2 mt2 c-default' } > {'~' + ship} <span className='white-d...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
InterfaceDeclaration
export interface Invites { ships: PatpNoSig[]; groups: string[][]; }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
InterfaceDeclaration
interface InviteSearchProps { groups: Groups; contacts: Rolodex; groupResults: boolean; shipResults: boolean; invites: Invites; setInvite: (inv: Invites) => void; disabled?: boolean; associations?: Associations; }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
InterfaceDeclaration
interface InviteSearchState { groups: string[][]; peers: PatpNoSig[]; contacts: Map<PatpNoSig, string[]>; searchValue: string; searchResults: Invites; selected: PatpNoSig | Path | null; inviteError: boolean; }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
componentDidMount() { this.peerUpdate(); this.bindShortcuts(); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
componentDidUpdate(prevProps) { if (prevProps !== this.props) { this.peerUpdate(); } }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
peerUpdate() { const groups = Array.from(Object.keys(this.props.contacts)) .filter((e) => !e.startsWith('/~/')) .map((e) => { const eachGroup: Path[] = []; eachGroup.push(e); if (this.props.associations) { let name = e; if (e in this.props.associations) { ...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
search(event) { const searchTerm = event.target.value.toLowerCase().replace('~', ''); const { state, props } = this; this.setState({ searchValue: event.target.value }); if (searchTerm.length < 1) { this.setState({ searchResults: { groups: [], ships: [] } }); } if (searchTerm.length > 0...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
bindShortcuts() { const mousetrap = Mousetrap(this.textarea.current); mousetrap.bind(['down', 'tab'], (e) => { e.preventDefault(); e.stopPropagation(); this.nextSelection(); }); mousetrap.bind(['up', 'shift+tab'], (e) => { e.preventDefault(); e.stopPropagation(); th...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
nextSelection(backward = false) { const { selected, searchResults } = this.state; const { ships, groups } = searchResults; if (!selected) { return; } let groupIdx = groups.findIndex(([path]) => path === selected); let shipIdx = ships.findIndex((ship) => ship === selected); if (groupId...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
deleteGroup() { const { ships } = this.props.invites; this.setState({ searchValue: '', searchResults: { groups: [], ships: [] }, }); this.props.setInvite({ groups: [], ships: ships }); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
deleteShip(ship) { let { groups, ships } = this.props.invites; this.setState({ searchValue: '', searchResults: { groups: [], ships: [] }, }); ships = ships.filter((e) => { return e !== ship; }); this.props.setInvite({ groups: groups, ships: ships }); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
addGroup(group) { this.setState({ searchValue: '', searchResults: { groups: [], ships: [] }, }); this.props.setInvite({ groups: [group], ships: [] }); }
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
addShip(ship) { const { groups, ships } = this.props.invites; this.setState({ searchValue: '', searchResults: { groups: [], ships: [] }, }); if (!ships.includes(ship)) { ships.push(ship); } if (groups.length > 0) { return false; } this.props.setInvite({ groups: g...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
submitShipToAdd(ship) { const searchTerm = ship.toLowerCase().replace('~', '').trim(); let isValid = true; if (!urbitOb.isValidPatp('~' + searchTerm)) { isValid = false; } if (!isValid) { this.setState({ inviteError: true, searchValue: '' }); } else if (isValid) { this.addShip...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
MethodDeclaration
render() { const { props, state } = this; let searchDisabled = props.disabled; if (props.invites.groups) { if (props.invites.groups.length > 0) { searchDisabled = true; } } let participants = <div />; let searchResults = <div />; let placeholder = ''; if (props.shi...
ejdiv/urbit
pkg/interface/src/components/InviteSearch.tsx
TypeScript
ArrowFunction
() => { let wrapper: NgxTestWrapper<ElementWrapperComponent>; beforeEach(async() => { wrapper = await mount({ component: ElementWrapperComponent, schemas: [ NO_ERRORS_SCHEMA ], propsData: { element: document.createElement('div'), } }); }); it('should create', () => { ...
Migushthe2nd/altair
packages/altair-app/src/app/modules/altair/components/element-wrapper/element-wrapper.component.spec.ts
TypeScript
ArrowFunction
async() => { wrapper = await mount({ component: ElementWrapperComponent, schemas: [ NO_ERRORS_SCHEMA ], propsData: { element: document.createElement('div'), } }); }
Migushthe2nd/altair
packages/altair-app/src/app/modules/altair/components/element-wrapper/element-wrapper.component.spec.ts
TypeScript
ArrowFunction
() => { expect(wrapper.componentInstance).toBeTruthy(); }
Migushthe2nd/altair
packages/altair-app/src/app/modules/altair/components/element-wrapper/element-wrapper.component.spec.ts
TypeScript
ArrowFunction
(_, k) => k
JoelLefkowitz/calculator
app/src/utils/strings.ts
TypeScript
ArrowFunction
(x: string): boolean => // typeof x === "string" && x.length === 1 && digits.includes(parseInt(x, 10)); typeof x === "string" && x.length === 1 && digits.includes(parseInt(x, 10))
JoelLefkowitz/calculator
app/src/utils/strings.ts
TypeScript
ArrowFunction
(x: string): boolean => typeof x === "string" && all([ all(x.split("").map((i) => i == "." || digits.includes(parseInt(i, 10)))), allIndicesOf(x.split(""), ".").length <= 1, ])
JoelLefkowitz/calculator
app/src/utils/strings.ts
TypeScript
ArrowFunction
(i) => i == "." || digits.includes(parseInt(i, 10))
JoelLefkowitz/calculator
app/src/utils/strings.ts
TypeScript