type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ClassDeclaration
export class PlayerSetCurrentPlaylistItemCommand extends Command<IOfficeState, Payload> { execute(data: Payload) { const { client, item } = data const player = this.state.players.get(client.sessionId) const newItem = new PlaylistItem() newItem.title = item.title newItem.link = item.link newIt...
goblincore/club-mutant
server/rooms/commands/PlayerUpdatePlaylistCommand.ts
TypeScript
ClassDeclaration
export class PlayerSetNextPlaylistItemCommand extends Command<IOfficeState, Payload> { execute(data: Payload) { const { client, item } = data console.log('////PlayerSetNextPlaylistItemCommand, item', item) const player = this.state.players.get(client.sessionId) const newItem = new PlaylistItem() ...
goblincore/club-mutant
server/rooms/commands/PlayerUpdatePlaylistCommand.ts
TypeScript
TypeAliasDeclaration
type Payload = { client?: Client index?: number item?: IPlaylistItem items?: IPlaylistItem[] }
goblincore/club-mutant
server/rooms/commands/PlayerUpdatePlaylistCommand.ts
TypeScript
MethodDeclaration
execute(data: Payload) { const { client, items } = data const player = this.state.players.get(client.sessionId) console.log('//Player sync next two playlist command', items, 'client', client.sessionId) items?.forEach(item => { const newItem = new PlaylistItem() newItem.title = item.title ...
goblincore/club-mutant
server/rooms/commands/PlayerUpdatePlaylistCommand.ts
TypeScript
MethodDeclaration
execute(data: Payload) { const { client, item } = data const player = this.state.players.get(client.sessionId) const newItem = new PlaylistItem() newItem.title = item.title newItem.link = item.link newItem.duration = item.duration player.currentPlaylistItem = newItem }
goblincore/club-mutant
server/rooms/commands/PlayerUpdatePlaylistCommand.ts
TypeScript
MethodDeclaration
execute(data: Payload) { const { client, item } = data console.log('////PlayerSetNextPlaylistItemCommand, item', item) const player = this.state.players.get(client.sessionId) const newItem = new PlaylistItem() newItem.title = item.title newItem.link = item.link newItem.duration = item.durat...
goblincore/club-mutant
server/rooms/commands/PlayerUpdatePlaylistCommand.ts
TypeScript
ClassDeclaration
/* * refer to https://stackoverflow.com/questions/51873087/unable-to-use-mixins-in-vue-with-typescript * import { Component, Mixins } from 'vue-property-decorator'; * class ExtendedClass extends Mixins(ActualMixin) { */ @Component export default class AuthMixin extends Vue { get accountId() { return this.$store....
ansezz/nft-gallery
src/utils/mixins/authMixin.ts
TypeScript
FunctionDeclaration
export declare function timeoutWith<T, R>( due: number | Date, withObservable: ObservableInput<R>, scheduler?: SchedulerLike, ): OperatorFunction<T, T | R>;
Soremwar/deno_definition_types
rxjs/v6.5.5/internal/operators/timeoutWith.d.ts
TypeScript
ArrowFunction
({ styles }) => ( <span css={wireFrameCellCss}
uswitch/trustyle
src/elements/wireframe-cell/src/index.tsx
TypeScript
InterfaceDeclaration
interface WireFrameCellProps extends React.HTMLAttributes<HTMLDivElement> { styles?: any }
uswitch/trustyle
src/elements/wireframe-cell/src/index.tsx
TypeScript
ClassDeclaration
@Component({ selector: 'app-product-list', templateUrl: './product-list.component.html', styleUrls: ['./product-list.component.css'] }) export class ProductListComponent { products = products; share(product): void { window.alert(`The product ${product.name} has been shared!`); window.ope...
diable201/WEB-development
Laboratory Works/Lab_4-5/store/src/app/product-list/product-list.component.ts
TypeScript
MethodDeclaration
share(product): void { window.alert(`The product ${product.name} has been shared!`); window.open(`https://t.me/share/url?url=${product.link}&text=Hi! Look what I\'ve found on the Amazon.` ); }
diable201/WEB-development
Laboratory Works/Lab_4-5/store/src/app/product-list/product-list.component.ts
TypeScript
MethodDeclaration
removeUpload(product): void { // get index/position of uploadItem within array const index: number = this.products.indexOf(product); // if index returned is negative it means element not found in array // else: (positive) index can be used // e.g. to remove the single element at this position ...
diable201/WEB-development
Laboratory Works/Lab_4-5/store/src/app/product-list/product-list.component.ts
TypeScript
MethodDeclaration
onNotify(): void { window.alert('You will be notified when the product goes on sale'); }
diable201/WEB-development
Laboratory Works/Lab_4-5/store/src/app/product-list/product-list.component.ts
TypeScript
ArrowFunction
(v) => { return v.name }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(v) => { return v.votes_count }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
() => { return `rgba(${this.randomInt()}, ${this.randomInt()}, ${this.randomInt()}, 1)` }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
() => { this.editPost(post) }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
() => { this.copyLink(post) }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
() => { this.deletePost(post) }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
() => { return }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(v) => { switch (v.text) { case 'Редактировать': return post.editable; case 'Удалить': return post.deletable; default: return true; } }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(res: any) => { if (res.success) { this.events.publish('posts:delete', post.id); this.flash.push('Пост успешно удален'); } }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(err: any) => { console.log(err); }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(res: any) => { if (res.success) { this.flash.push('Победитель выбран'); this.navCtrl.push('FeedPage'); } }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
() => { this.navCtrl.push('Ошибка выбора победителя, попробуйте ещё.') }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(res: any) => { if (res.success) { this.flash.push('Вы успешно проголосовали.'); this.navCtrl.push('FeedPage'); } }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
(v) => { return v.id === this.item.question.winner_id; }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ClassDeclaration
@Component({ selector: 'post-question', templateUrl: 'post-question.html' }) export class PostQuestionComponent implements AfterViewInit { @Input() item: any; @ViewChild('barCanvas') barCanvas; private selected: any; private barChart: any; constructor(public navCtrl: NavController, ...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
ngAfterViewInit(): void { if (this.voted()) { this.initBar(); } }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
initBar() { let options = this.item.question.options; this.barChart = new Chart(this.barCanvas.nativeElement, { type: 'bar', data: { labels: options.map((v) => { return v.name }), datasets: [{ ...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
feedActionSheet(post: any) { let buttons = [ { text: 'Редактировать', handler: () => { this.editPost(post) } }, { text: 'Скопировать ссылку', handler: () => { ...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
deletePost(post: any) { this.api.delete(`posts/${post.id}`).subscribe((res: any) => { if (res.success) { this.events.publish('posts:delete', post.id); this.flash.push('Пост успешно удален'); } }, (err: any) => { console.log(err); ...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
editPost(post: any) { this.navCtrl.push('NewVotePage', {post: post}); }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
copyLink(post: any) { this.clipboard.copy(post.link); }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
toPost(post: any) { let page = 'VotePage', question = post.question; if (question.is_expired && question.can_set_winner && !question.winner_id) { page = 'VotePage'; } else if (!question.user_option_id && !question.is_expired) { page = 'VotePage' } el...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
optionName(option: any) { return `${option.name} (${option.votes_count})`; }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
setWinner(option: any) { this.api.post(`posts/question/vote/action`, { post_id: this.item.id, option_id: option.id }).subscribe((res: any) => { if (res.success) { this.flash.push('Победитель выбран'); this.navCtrl.push('FeedPage'); ...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
randomInt(min = 1, max = 255) { return Math.floor(Math.random() * (max - min + 1)) + min; }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
vote() { if (!this.selected) { return; } this.api.post('posts/question/vote', {question_option_id: this.selected}) .subscribe((res: any) => { if (res.success) { this.flash.push('Вы успешно проголосовали.'); this.na...
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
canVote() { return !this.item.question.user_option_id && !this.item.question.is_expired }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
voted() { return this.item.question.winner_id || this.item.question.is_expired || this.item.question.user_option_id; }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
winnerName() { let option = this.item.question.options.find((v) => { return v.id === this.item.question.winner_id; }); return option ? option.name : ''; }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
MethodDeclaration
toProfile(post: any) { this.navCtrl.push('ProfilePage', {user: post.user_id}); }
nofikoff/Android_Ionic_Cordova_my_APP_Profsouz_Airlines_MAU
src/components/post-question/post-question.ts
TypeScript
ArrowFunction
([pluginName, pluginOption]) => { if (optionsWithDefaults.indexOf(pluginName) > -1) return if (!pluginOption || !pluginOption.enable) return if (!isNpmPkg(pluginName)) { // local plugin pluginName = path.join(appPath, pluginName) } try { const pluginPath = resolveSync(pluginName, { ba...
skywalker512/taro
packages/taro-mini-runner/src/webpack/postcss.conf.ts
TypeScript
ClassDeclaration
@Injectable() export class PrismaService extends PrismaClient { constructor(config: ConfigService) { super({ datasources: { db: { url: config.get('DATABASE_URL'), }, }, }); } cleanDb() { return this.$transaction([this.todo.deleteMany(), this.user.deleteMany()]);...
Commonlk/todolist
backend/src/prisma/prisma.service.ts
TypeScript
MethodDeclaration
cleanDb() { return this.$transaction([this.todo.deleteMany(), this.user.deleteMany()]); }
Commonlk/todolist
backend/src/prisma/prisma.service.ts
TypeScript
ArrowFunction
(theme: Theme) => createStyles({ domain: { width: '60%' }, domainRow: { backgroundColor: theme.bg.white }, domainCellContainer: { [theme.breakpoints.down('sm')]: { textAlign: 'left' } }, labelStatusWrapper: { display: 'flex', flexFlow: 'row nowr...
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
ArrowFunction
( e: | React.ChangeEvent<HTMLTableRowElement> | React.MouseEvent<HTMLAnchorElement, MouseEvent>, id: number, domain: string, type: string ) => { if (type === 'slave') { e.preventDefault(); this.props.onEdit(domain, id); } }
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
ArrowFunction
e => this.handleRowClick(e, id, domain, type)
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
ArrowFunction
(status: DomainStatus) => { switch (status) { case 'active': return 'Active'; case 'disabled': return 'Disabled'; case 'edit_mode': return 'Edit Mode'; case 'has_errors': return 'Error'; default: return 'Unknown'; } }
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
ClassDeclaration
class DomainTableRow extends React.Component<CombinedProps> { handleRowClick = ( e: | React.ChangeEvent<HTMLTableRowElement> | React.MouseEvent<HTMLAnchorElement, MouseEvent>, id: number, domain: string, type: string ) => { if (type === 'slave') { e.preventDefault(); thi...
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
InterfaceDeclaration
interface Props extends Handlers { domain: string; id: number; status: DomainStatus; type: 'master' | 'slave'; }
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
TypeAliasDeclaration
type ClassNames = | 'domain' | 'labelStatusWrapper' | 'domainRow' | 'domainCellContainer';
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
TypeAliasDeclaration
type CombinedProps = Props & WithStyles<ClassNames>;
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
MethodDeclaration
render() { const { classes, domain, id, type, status, onClone, onRemove, onEdit } = this.props; return ( <TableRow key={id} data-qa-domain-cell={domain} className={`${classes.domainRow} ${'fade-in-table'}`}
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
MethodDeclaration
humanizeDomainStatus(status)
er0k/manager
packages/manager/src/features/Domains/DomainTableRow.tsx
TypeScript
ArrowFunction
(element: Link | null) => { if (element) { this._element = element } }
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
ClassDeclaration
export default class StateLink extends React.PureComponent< Props & React.HTMLProps<HTMLAnchorElement> > { context: RouterProviderContext | null = null _element: Link | null = null static defaultProps = { replace: false, toIndex: false, } static contextTypes = { __internalRouter: internalRout...
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
TypeAliasDeclaration
type Props = { state?: Record<string, any> toIndex?: boolean }
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
MethodDeclaration
resolveUrl(): string { const {toIndex, state} = this.props if (state && toIndex) { throw new Error('Passing both `state` and `toIndex` as props to StateLink is invalid') } if (!state && !toIndex) { // eslint-disable-next-line no-console console.error( new Error( 'N...
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
MethodDeclaration
resolvePathFromState(state: Record<string, any>) { if (!this.context) throw new Error('StateLink: missing context value') if (!this.context.__internalRouter) { return `javascript://state@${JSON.stringify(state)}` } return this.context.__internalRouter.resolvePathFromState(state) }
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
MethodDeclaration
focus() { if (this._element) { this._element.focus() } }
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
MethodDeclaration
render() { const {state, toIndex, ...rest} = this.props return <Link {...rest} href={this.resolveUrl()} ref={this.setElement} /> }
AdamMescher/nvte-next10
sanity/node_modules/@sanity/state-router/src/components/StateLink.tsx
TypeScript
FunctionDeclaration
/** JSDoc */ function getFunction(frame: stacktrace.StackFrame): string { try { return frame.getFunctionName() || `${frame.getTypeName()}.${frame.getMethodName() || '<anonymous>'}`; } catch (e) { // This seems to happen sometimes when using 'use strict', // stemming from `getTypeName`. // [TypeError...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ function getModule(filename: string, base?: string): string { if (!base) { base = mainModule; // tslint:disable-line:no-parameter-reassignment } // It's specifically a module const file = basename(filename, '.js'); filename = dirname(filename); // tslint:disable-line:no-parameter-reassignmen...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ async function readSourceFiles( filenames: string[], ): Promise<{ [key: string]: string; }> { // we're relying on filenames being de-duped already if (filenames.length === 0) { return {}; } const sourceFiles: { [key: string]: string; } = {}; await Promise.all( filenames.map(as...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ export async function extractStackFromError(error: Error): Promise<stacktrace.StackFrame[]> { const stack = stacktrace.parse(error); if (!stack) { return []; } return stack; }
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ export async function parseStack(stack: stacktrace.StackFrame[]): Promise<StackFrame[]> { const filesToRead: string[] = []; const frames: StackFrame[] = stack.map(frame => { const parsedFrame: StackFrame = { colno: frame.getColumnNumber(), filename: frame.getFileName() || '', func...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** * This function tries to read the source files + adding pre and post context (source code) * to a frame. * @param filesToRead string[] of filepaths * @param frames StackFrame[] containg all frames */ async function addPrePostContext(filesToRead: string[], frames: StackFrame[]): Promise<StackFrame[]> { const ...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ export async function getExceptionFromError(error: Error): Promise<SentryException> { const name = error.name || error.constructor.name; const stack = await extractStackFromError(error); const frames = await parseStack(stack); return { stacktrace: { frames: prepareFramesForEvent(frames),...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ export async function parseError(error: ExtendedError): Promise<SentryEvent> { const name = error.name || error.constructor.name; const exception = await getExceptionFromError(error); const event: SentryEvent = { exception: { values: [exception], }, message: `${name}: ${error.messag...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
FunctionDeclaration
/** JSDoc */ export function prepareFramesForEvent(stack: StackFrame[]): StackFrame[] { if (!stack || !stack.length) { return []; } let localStack = stack; const firstFrameFunction = localStack[0].function || ''; if (firstFrameFunction.includes('captureMessage') || firstFrameFunction.includes('captureEx...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
ArrowFunction
async filename => { let content; try { content = await readFileAsync(filename); } catch (_) { // unsure what to add here as the file is unreadable content = null; } if (typeof content === 'string') { sourceFiles[filename] = content; } }
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
ArrowFunction
frame => { const parsedFrame: StackFrame = { colno: frame.getColumnNumber(), filename: frame.getFileName() || '', function: getFunction(frame), lineno: frame.getLineNumber(), }; const isInternal = frame.isNative() || (parsedFrame.filename && !parsedFrame.filenam...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
ArrowFunction
frame => { if (frame.filename && sourceFiles[frame.filename]) { try { const lines = sourceFiles[frame.filename].split('\n'); frame.pre_context = lines .slice(Math.max(0, (frame.lineno || 0) - (LINES_OF_CONTEXT + 1)), (frame.lineno || 0) - 1) .map((line: string) => snipLin...
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
ArrowFunction
(line: string) => snipLine(line, 0)
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
ArrowFunction
key => !(key in ['name', 'message', 'stack', 'domain'])
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
InterfaceDeclaration
/** * Just an Error object with arbitrary attributes attached to it. */ interface ExtendedError extends Error { [key: string]: any; }
SimonSchick/sentry-javascript
packages/node/src/parsers.ts
TypeScript
ArrowFunction
(_req: any, res: { send: (arg0: string) => void }): void => { res.send('http://api.sitetest4.robloxlabs.com/Login/Negotiate.ashx'); }
AbylTheVintageBoy/RobloxLabsTemp
Source/Services/Roblox.ApiProxy.Service/Controllers/Login/RequestAuth.ashx.ts
TypeScript
ArrowFunction
() => { const goodUrls: Array<[string | URL, boolean]> = [ ['clerk.dev.lclclerk.com', false], ['clerk.prod.lclclerk.com', false], ['clerk.abc.efg.lclstage.dev', false], ['clerk.abc.efg.stgstage.dev', false], ['accounts.abc.efg.dev.lclclerk.com', true], ['https://accounts.abc.efg.stg.lclclerk....
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
(a, expected) => { expect(isAccountsHostedPages(a as any)).toBe(expected); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const goodUrls: Array<[string | URL, boolean]> = [ ['https://www.google.com', false], ['https://www.clerk.dev', false], ['https://www.lclclerk.com', false], ['clerk.prod.lclclerk.com', false], ['something.dev.lclclerk.com', true], ['something.lcl.dev', true], ['https://www.somethi...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
(a, expected) => { expect(isDevOrStagingUrl(a as any)).toBe(expected); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { it('builds a URL()', () => { expect(buildURL({}, { stringify: true })).toBe('http://localhost/'); expect( buildURL( { pathname: 'my-path', hash: 'my-hash?my-hashed-search', search: 'my-search', }, { stringify: true }, ), ).toBe('ht...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { expect(buildURL({}, { stringify: true })).toBe('http://localhost/'); expect( buildURL( { pathname: 'my-path', hash: 'my-hash?my-hashed-search', search: 'my-search', }, { stringify: true }, ), ).toBe('http://localhost/my-path?my-searc...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { it('trims all the final slashes', () => { expect(trimTrailingSlash('')).toBe(''); expect(trimTrailingSlash('/foo')).toBe('/foo'); expect(trimTrailingSlash('/foo/')).toBe('/foo'); expect(trimTrailingSlash('//foo//bar///')).toBe('//foo//bar'); }); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { expect(trimTrailingSlash('')).toBe(''); expect(trimTrailingSlash('/foo')).toBe('/foo'); expect(trimTrailingSlash('/foo/')).toBe('/foo'); expect(trimTrailingSlash('//foo//bar///')).toBe('//foo//bar'); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { it('returns the same url if no params provided', () => { const base = new URL('https://dashboard.clerk.dev'); const res = appendAsQueryParams(base); expect(res).toBe('https://dashboard.clerk.dev/'); }); it('handles URL objects', () => { const base = new URL('https://dashboard.clerk.dev')...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = new URL('https://dashboard.clerk.dev'); const res = appendAsQueryParams(base); expect(res).toBe('https://dashboard.clerk.dev/'); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = new URL('https://dashboard.clerk.dev'); const url = new URL( 'https://dashboard.clerk.dev/applications/appid/instances/', ); const res = appendAsQueryParams(base, { redirect_url: url }); expect(res).toBe( 'https://dashboard.clerk.dev/#/?redirect_url=%2Fapplications%...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = 'https://dashboard.clerk.dev'; const url = 'https://dashboard.clerk.dev/applications/appid/instances/'; const res = appendAsQueryParams(base, { redirect_url: url }); expect(res).toBe( 'https://dashboard.clerk.dev/#/?redirect_url=%2Fapplications%2Fappid%2Finstances%2F', );...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = 'https://dashboard.clerk.dev'; const url = 'https://dashboard.clerk.dev/applications/appid/instances/'; const res = appendAsQueryParams(base, { redirect_url: url, after_sign_in_url: url, }); expect(res).toBe( 'https://dashboard.clerk.dev/#/?redirect_url=%2Fapp...
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = new URL('https://dashboard.clerk.dev'); const res = appendAsQueryParams(base, { redirect_url: undefined }); expect(res).toBe('https://dashboard.clerk.dev/'); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = new URL('https://dashboard.clerk.dev'); const res = appendAsQueryParams(base, { redirect_url: '/test' }); expect(res).toBe( 'https://dashboard.clerk.dev/#/?redirect_url=http%3A%2F%2Flocalhost%2Ftest', ); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = new URL('https://dashboard.clerk.dev'); const res = appendAsQueryParams(base, { redirectUrl: '/test' }); expect(res).toBe( 'https://dashboard.clerk.dev/#/?redirect_url=http%3A%2F%2Flocalhost%2Ftest', ); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { const base = new URL('https://dashboard.clerk.dev'); const url = new URL('https://www.google.com/something'); const res = appendAsQueryParams(base, { redirect_url: url }); expect(res).toBe( 'https://dashboard.clerk.dev/#/?redirect_url=https%3A%2F%2Fwww.google.com%2Fsomething', ); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { it('returns all ETLDs for a give hostname', () => { expect(getAllETLDs('foo.bar.qux.baz')).toEqual([ 'baz', 'qux.baz', 'bar.qux.baz', ]); }); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ArrowFunction
() => { expect(getAllETLDs('foo.bar.qux.baz')).toEqual([ 'baz', 'qux.baz', 'bar.qux.baz', ]); }
deriegle/javascript
packages/clerk-js/src/utils/url.test.ts
TypeScript
ClassDeclaration
/** * This emitter is used for sending synthetic native events to listeners * registered in the API layer with `NativeEventEmitter`. */ class SyntheticPlatformEmitter { _emitter = new EventEmitter(RCTDeviceEventEmitter.sharedSubscriber); emit(eventName: string, props: any): void { this._emitter.emit(eventNa...
AlexSensei/expo
packages/@unimodules/react-native-adapter/src/SyntheticPlatformEmitter.ts
TypeScript