type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
InterfaceDeclaration |
export interface SortDropdownAttrs extends ComponentAttrs {
state: AbstractListState<Model>;
updateUrl?: boolean;
} | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
InterfaceDeclaration |
export interface SortOptions {
[key: string]: string;
} | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
MethodDeclaration |
view(): import("mithril").Vnode<{
className: string;
buttonClassName: string;
label: string;
}, unknown>; | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
MethodDeclaration |
className(): string; | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
MethodDeclaration |
activeSort(): string; | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
MethodDeclaration |
applySort(sort: string): void; | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
MethodDeclaration |
abstract options(): SortOptions; | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
MethodDeclaration |
defaultSort(): string; | flamarkt/core | js/dist-typings/common/components/AbstractSortDropdown.d.ts | TypeScript |
ArrowFunction |
res => {
return res
} | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
ArrowFunction |
res => {
if (!res) return false
else {
this.User.id = res.id
this.events.publish("user:login", this.User);
return true
}
} | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
ClassDeclaration | /*
Generated class for the UserProvider provider.
See https://angular.io/guide/dependency-injection for more info on providers
and Angular DI.
*/
@Injectable()
export class UserProvider {
public User: any
constructor(public http: HttpClient, public events: Events, public db: FirebaseDbProvider) {
this.User =... | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
MethodDeclaration |
public addUser(user: any) {
return this.db.addUser(user)
.then(res => {
return res
})
} | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
MethodDeclaration |
public checkUser(name: String, password: String) {
this.User = { name: name, id: '' }
return this.db.checkUser(name, password)
.then(res => {
if (!res) return false
else {
this.User.id = res.id
this.events.publish("user:login", this.User);
return true
}
})
} | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
MethodDeclaration |
public getCurrentUser() {
return this.User
} | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
MethodDeclaration |
public logout(){
this.User = null
this.events.publish("user:logout", this.User);
} | SimonGlew/SWEN325_Ionic | src/providers/user/user.ts | TypeScript |
ArrowFunction |
({ layoutItem, type }: TextBoxProps) => {
const {
readOnly,
getValue,
editorPreparing,
editorInitialized,
editorValidating,
editorValueChanged,
editorEntered,
} = useContext(EditItemsContext);
const [required, setRequired] = useState(layoutItem.required ?? false);
const [readonly, ... | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
ArrowFunction |
() => {
if (layoutItem && layoutItem.dataMember && editorPreparing && readOnly) {
editorPreparing(layoutItem.dataMember, layoutItem);
setReadonly(!readOnly || readOnly() || layoutItem.readonly);
setRequired(layoutItem.required ?? false);
setPrepared(true);
}
} | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
ArrowFunction |
(option) => {
switch (option) {
case 'value':
return editorRef.current?.instance.option('value');
case 'required':
return required;
case 'readonly':
return readonly;
}
} | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
ArrowFunction |
(option, newValue) => {
switch (option) {
case 'value':
valueNotificationRef.current = false;
editorRef.current?.instance.option('value', newValue);
valueNotificationRef.current = true;
break;
case 'required':
setRequired(newValue ... | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
ArrowFunction |
(v) => (
<CustomRule
key={v.identifier} | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
InterfaceDeclaration |
export interface TextBoxProps extends EditItemProps {
type: 'text' | 'mail';
} | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
MethodDeclaration |
getValue(layoutItem | frankball/ballware-react-renderer-dx | src/editing/items/textbox.tsx | TypeScript |
FunctionDeclaration |
function Page() {
const { data } = useQuery(
key,
async () => {
await sleep(10)
if (!succeed) {
throw new Error('Error')
} else {
return 'data'
}
},
{
retry: false,
useErrorBoundary: true,
... | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
FunctionDeclaration |
function Page() {
const { data } = useQuery(
key,
async () => {
fetchCount++
await sleep(10)
throw new Error('Error')
},
{
retry: false,
useErrorBoundary: true,
}
)
return <div>{data}</div>
} | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
() => {
const queryCache = new QueryCache()
const queryClient = new QueryClient({ queryCache })
it('should retry fetch if the reset error boundary has been reset', async () => {
const key = queryKey()
let succeed = false
const consoleMock = mockConsoleError()
function Page() {
const { da... | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
async () => {
const key = queryKey()
let succeed = false
const consoleMock = mockConsoleError()
function Page() {
const { data } = useQuery(
key,
async () => {
await sleep(10)
if (!succeed) {
throw new Error('Error')
} else {
... | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
async () => {
await sleep(10)
if (!succeed) {
throw new Error('Error')
} else {
return 'data'
}
} | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
() => rendered.getByText('error boundary') | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
() => rendered.getByText('retry') | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
() => rendered.getByText('data') | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
async () => {
const key = queryKey()
const consoleMock = mockConsoleError()
let fetchCount = 0
function Page() {
const { data } = useQuery(
key,
async () => {
fetchCount++
await sleep(10)
throw new Error('Error')
},
{
retry:... | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
async () => {
fetchCount++
await sleep(10)
throw new Error('Error')
} | 5achinJani/react-query | src/react/tests/QueryResetErrorBoundary.test.tsx | TypeScript |
ArrowFunction |
() => {
test('it throws for empty file', async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/empty-file.yml'); }).rejects.toThrowError(/empty-file/);
await expect(async () => { await TemplateRoot.create('./test/resources/empty-file.yml'); }).rejects.toThrowError(/i... | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/empty-file.yml'); }).rejects.toThrowError(/empty-file/);
await expect(async () => { await TemplateRoot.create('./test/resources/empty-file.yml'); }).rejects.toThrowError(/is empty/);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => { await TemplateRoot.create('./test/resources/empty-file.yml'); } | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/invalid-version.yml'); }).rejects.toThrowError(/Unexpected AWSTemplateFormatVersion version/);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => { await TemplateRoot.create('./test/resources/invalid-version.yml'); } | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/invalid-yml.yml'); }).rejects.toThrowError(/unable to load file/);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => { await TemplateRoot.create('./test/resources/invalid-yml.yml'); } | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/missing-organization.yml'); }).rejects.toThrowError(/Organization attribute is missing/);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => { await TemplateRoot.create('./test/resources/missing-organization.yml'); } | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/invalid-include-notfound.yml'); }).rejects.toThrowError(/no such file or directory/);
await expect(async () => { await TemplateRoot.create('./test/resources/invalid-include-notfound.yml'); }).rejects.toThrowError(/\/no... | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => { await TemplateRoot.create('./test/resources/invalid-include-notfound.yml'); } | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
await expect(async () => { await TemplateRoot.create('./test/resources/invalid-include-invalid-yml.yml'); }).rejects.toThrowError();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => { await TemplateRoot.create('./test/resources/invalid-include-invalid-yml.yml'); } | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
let basic: TemplateRoot;
beforeEach(async () => {
basic = await TemplateRoot.create('./test/resources/valid-basic.yml');
});
test('it parses successfully', () => {
expect(basic).toBeDefined();
});
test('it contains master account', () => {
expect(basic.organiz... | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
basic = await TemplateRoot.create('./test/resources/valid-basic.yml');
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(basic).toBeDefined();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(basic.organizationSection.masterAccount).toBeDefined();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(basic.organizationSection.masterAccount.logicalId).toBe('MasterAccount');
expect(basic.organizationSection.masterAccount.type).toBe('OC::ORG::MasterAccount');
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(basic.organizationSection.masterAccount.accountName).toBe('My Organization Root');
expect(basic.organizationSection.masterAccount.accountId).toBe('123456789012');
expect(basic.organizationSection.masterAccount.rootEmail).toBeUndefined();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(basic.organizationSection.accounts.length).toBe(0);
expect(basic.organizationSection.organizationalUnits.length).toBe(0);
expect(basic.organizationSection.serviceControlPolicies.length).toBe(0);
expect(basic.organizationSection.organizationRoot).toBeUndefined();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
let basic: TemplateRoot;
let include: TemplateRoot;
beforeEach(async () => {
basic = await TemplateRoot.create('./test/resources/valid-basic.yml');
include = await TemplateRoot.create('./test/resources/valid-include.yml');
});
test('it contains same organization contents w... | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
basic = await TemplateRoot.create('./test/resources/valid-basic.yml');
include = await TemplateRoot.create('./test/resources/valid-include.yml');
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(JSON.stringify(include.contents.Organization)).toBe(JSON.stringify(basic.contents.Organization));
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
let template: TemplateRoot;
let sandbox = Sinon.createSandbox();
beforeEach(async () => {
sandbox.stub(ConsoleUtil, 'LogWarning');
template = await TemplateRoot.create('./test/resources/valid-regular-cloudformation.yml');
});
afterEach(() => {
sandbox.restore();
... | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
sandbox.stub(ConsoleUtil, 'LogWarning');
template = await TemplateRoot.create('./test/resources/valid-regular-cloudformation.yml');
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
sandbox.restore();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(template.organizationSection.resources.length).toBe(1);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(template.resourcesSection.resources.length).toBe(1);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(template.contents.Outputs).toBeDefined();
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
let template: TemplateRoot;
let sandbox = Sinon.createSandbox();
beforeEach(async () => {
sandbox.stub(ConsoleUtil, 'LogWarning');
template = await TemplateRoot.create('./test/resources/merge.yml');
});
test('template contains 9 accounts', () => {
expect(template.o... | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
async () => {
sandbox.stub(ConsoleUtil, 'LogWarning');
template = await TemplateRoot.create('./test/resources/merge.yml');
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
ArrowFunction |
() => {
expect(template.organizationSection.accounts.length).toBe(9);
} | GrahamCampbell/org-formation-cli | test/unit-tests/parser/parser.files.test.ts | TypeScript |
FunctionDeclaration | // Helper to convert strings used for jsonPath where \. or - is present to use indexed notation,
// for example: .metadata.labels.kubesphere\.io/alias-name -> .metadata.labels['kubesphere\.io/alias-name']
export function parseJsonPath(jsonPath: string) {
let pathExpression = jsonPath;
if (jsonPath.match(/[\\-]/g))... | BlackHole1/lens | src/renderer/utils/jsonPath.ts | TypeScript |
FunctionDeclaration |
function convertToIndexNotation(key: string, firstItem = false) {
if (key.match(/[\\-]/g)) { // check if found '\' and '-' in key
if (key.includes("[")) { // handle cases where key contains [...]
const keyToConvert = key.match(/^.*(?=\[)/g); // get the text from the key before '['
if (keyToConvert &... | BlackHole1/lens | src/renderer/utils/jsonPath.ts | TypeScript |
ArrowFunction |
value => convertToIndexNotation(value) | BlackHole1/lens | src/renderer/utils/jsonPath.ts | TypeScript |
ArrowFunction |
() => {
return (
<div className="">
<Head>
<title>Your Template App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>
</div> | cptlstudio/nextjs-template | src/pages/index.tsx | TypeScript |
FunctionDeclaration |
function makeArrowStyles(direction: string, color: string, size: number): any {
let arrowStyles;
if (direction === 'topLeft') {
arrowStyles = {
borderLeft: `${size}px solid transparent`,
borderRight: `${size}px solid transparent`,
borderBottom: `${size}px solid ${color}`,
borderTop: 0,... | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
FunctionDeclaration |
function setTranslation(direction = 'topCenter', size: number) {
let x = '0px';
let y = '0px';
if (direction === 'topLeft') {
x = -(size * 2) + 'px';
y = (size + BUFFER) + 'px';
}
if (direction === 'topCenter') {
x = '-50%';
y = (size + BUFFER) + 'px';
}
if (direction === 'topRight') {... | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
ArrowFunction |
(direction: string, color: string, size: number): React.CSSProperties => {
return {
...base,
...makeArrowStyles(direction, color, size),
};
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
ArrowFunction |
() => window.addEventListener('click', this.checkClick) | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
ClassDeclaration |
export class ToolTip extends React.PureComponent<IToolTipProps, IToolTipState> {
container: HTMLDivElement = null;
state = {
isVisible: this.props.isVisible,
};
componentDidMount() {
if (this.props.onDeactivate) {
setTimeout(() => window.addEventListener('click', this.checkClick), 60);
}
... | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
InterfaceDeclaration |
export interface IToolTipProps extends React.Props<any> {
arrowPosition?: ArrowPosition;
backgroundColor: string;
hasDropShadow?: boolean;
isVisible: boolean;
size: number;
position?: {
top: number,
left: number,
};
zIndex?: number;
onDeactivate?(): any;
width?: number;
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
InterfaceDeclaration |
export interface IToolTipState {
isVisible: boolean;
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
TypeAliasDeclaration |
export type ArrowPosition = 'topLeft' | 'topCenter' | 'topRight' | 'rightTop' |
'rightCenter' | 'rightBottom' | 'bottomRight' | 'bottomCenter' |
'bottomLeft' | 'leftBottom' | 'leftCenter' | 'leftTop'; | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
MethodDeclaration |
componentDidMount() {
if (this.props.onDeactivate) {
setTimeout(() => window.addEventListener('click', this.checkClick), 60);
}
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
MethodDeclaration |
componentWillUpdate(nextProps: IToolTipProps) {
if (this.props.isVisible !== nextProps.isVisible) {
this.setState({
isVisible: nextProps.isVisible,
});
}
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
MethodDeclaration |
componentWillUnmount() {
window.removeEventListener('click', this.checkClick);
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
MethodDeclaration |
@autobind
saveContainerRef(el: HTMLDivElement) {
this.container = el;
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
MethodDeclaration |
@autobind
checkClick(e: any) {
e.preventDefault();
if (!this.container || this.container.contains(e.target as any)) {
return;
}
this.setState({
isVisible: false,
});
if (this.props.onDeactivate) {
this.props.onDeactivate();
}
} | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
MethodDeclaration |
render() {
const {
arrowPosition,
backgroundColor,
hasDropShadow,
children,
position,
size,
zIndex,
width,
} = this.props;
const {
isVisible,
} = this.state;
return (
<div
ref={this.saveContainerRef}
{...css(
ST... | cameronaaron/conversationai-moderator | packages/frontend-web/src/app/components/ToolTip/ToolTip.tsx | TypeScript |
ClassDeclaration |
@Controller('categorias')
export class CategoriaController {
constructor(
private readonly categoriaService: CategoriaService,
) {}
@Get()
@HttpCode(200)
async get() {
return await this.categoriaService.get();
}
@Post()
@HttpCode(200)
async insert(@Body() categoria:Categoria) {
retu... | dias1618/aquila-backend-records | src/controllers/categoria.controller.ts | TypeScript |
MethodDeclaration |
@Get()
@HttpCode(200)
async get() {
return await this.categoriaService.get();
} | dias1618/aquila-backend-records | src/controllers/categoria.controller.ts | TypeScript |
MethodDeclaration |
@Post()
@HttpCode(200)
async insert(@Body() categoria:Categoria) {
return await this.categoriaService.save(new Categoria(categoria));
} | dias1618/aquila-backend-records | src/controllers/categoria.controller.ts | TypeScript |
MethodDeclaration |
@Put()
@HttpCode(200)
async update(@Body() categoria:Categoria) {
return await this.categoriaService.save(new Categoria(categoria));
} | dias1618/aquila-backend-records | src/controllers/categoria.controller.ts | TypeScript |
MethodDeclaration |
@Delete(':id')
@HttpCode(200)
async delete(@Param('id') id:number) {
return await this.categoriaService.delete(id);
} | dias1618/aquila-backend-records | src/controllers/categoria.controller.ts | TypeScript |
ArrowFunction |
async (packet: IlpPrepare, next: MiddlewareCallback<IlpPrepare, IlpReply>) => {
const { amount } = packet
// TODO: Do we need a BigNumber-based token bucket?
if (!incomingBucket.take(Number(amount))) {
throw new InsufficientLiquidityError('exceeded money bandwidth, th... | 1Crazymoney/ilp-connector | src/middlewares/throughput.ts | TypeScript |
ClassDeclaration |
export default class ThroughputMiddleware implements Middleware {
async applyToPipelines (pipelines: Pipelines, account: Account) {
if (account.info.throughput) {
const {
refillPeriod = DEFAULT_REFILL_PERIOD,
incomingAmount = false,
outgoingAmount = false
} = account.info.thr... | 1Crazymoney/ilp-connector | src/middlewares/throughput.ts | TypeScript |
MethodDeclaration |
async applyToPipelines (pipelines: Pipelines, account: Account) {
if (account.info.throughput) {
const {
refillPeriod = DEFAULT_REFILL_PERIOD,
incomingAmount = false,
outgoingAmount = false
} = account.info.throughput || {}
if (incomingAmount) {
// TODO: When we a... | 1Crazymoney/ilp-connector | src/middlewares/throughput.ts | TypeScript |
ArrowFunction |
() => localeCN | chalecao/preact-h5-ui | src/calendar/index.tsx | TypeScript |
ClassDeclaration |
export default class Calendar extends React.Component<CalendarProps, any> {
static defaultProps = {
prefixCls: 'am-calendar',
timePickerPrefixCls: 'am-picker',
timePickerPickerPrefixCls: 'am-picker-col'
};
static contextTypes = {
antLocale: PropTypes.object
};
render() {
// tslint:disab... | chalecao/preact-h5-ui | src/calendar/index.tsx | TypeScript |
MethodDeclaration |
render() {
// tslint:disable-next-line:no-this-assignment
const { props, context } = this;
const locale = getComponentLocale(props, context, 'Calendar', () => localeCN
);
const Header = RMCalendar.DefaultHeader;
return (
<RMCalendar
locale={locale}
// tslint:disable-next-... | chalecao/preact-h5-ui | src/calendar/index.tsx | TypeScript |
ClassDeclaration |
@Component({
selector: 'verseghy-toast',
templateUrl: './toast.component.html',
styleUrls: ['./toast.component.scss'],
animations: [
trigger('toast', [
transition(':enter', [
style({
opacity: 0,
transform: 'translate3d(0, calc(100% + 10px), 0)',
}),
animate... | Verseghy/website_frontend | apps/frontend/src/app/components/toast/toast.component.ts | TypeScript |
ArrowFunction |
({
attributes,
children,
element,
}: ElementProps) => {
switch (element.type) {
case ElementType['heading_one']:
return <RichTextH1 {...attributes}>{children}</RichTextH1>;
case ElementType['heading_two']:
return <RichTextH2 {...attributes}>{children}</RichTextH2>;
case ElementType['hea... | technologiestiftung/kulturdaten-frontend | components/richtext/Element.tsx | TypeScript |
InterfaceDeclaration |
export interface ElementProps {
attributes: { [key: string]: string | number | boolean };
children: React.ReactNode;
element: CustomElement;
} | technologiestiftung/kulturdaten-frontend | components/richtext/Element.tsx | TypeScript |
EnumDeclaration |
export enum ElementType {
'heading_one' = 'heading_one',
'heading_two' = 'heading_two',
'heading_three' = 'heading_three',
'ol_list' = 'ol_list',
'ul_list' = 'ul_list',
'list_item' = 'list_item',
'paragraph' = 'paragraph',
} | technologiestiftung/kulturdaten-frontend | components/richtext/Element.tsx | TypeScript |
TypeAliasDeclaration |
export type CustomText = {
bold?: boolean;
italic?: boolean;
underline?: boolean;
} & Text; | technologiestiftung/kulturdaten-frontend | components/richtext/Element.tsx | TypeScript |
TypeAliasDeclaration |
export type CustomDescendant = CustomElement | CustomText; | technologiestiftung/kulturdaten-frontend | components/richtext/Element.tsx | TypeScript |
TypeAliasDeclaration |
export type CustomElement = { type: ElementType; children: CustomDescendant[] } & SlateElement; | technologiestiftung/kulturdaten-frontend | components/richtext/Element.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.