type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
---|---|---|---|---|
FunctionDeclaration | /**
*
*/
export default function LandingAppBar(props: LandingAppBarProps): JSX.Element {
const {} = props;
return <nav className="p-4"></nav>;
} | UTDNebula/planner | components/landing/AppBar.tsx | TypeScript |
InterfaceDeclaration | /**
* Component properties for a LandingAppBar.
*/
interface LandingAppBarProps {
items: LandingBarItem;
} | UTDNebula/planner | components/landing/AppBar.tsx | TypeScript |
TypeAliasDeclaration |
type LandingBarItem = {
title: string;
href: string;
}; | UTDNebula/planner | components/landing/AppBar.tsx | TypeScript |
ArrowFunction |
() => {
describe('Component', () => {
it('render', async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
expect(component).toHaveClass('hydrated')
})
})
describe('Methods', () => {
it('show()', async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
const rootElement = await page.find(ROOT_ELEMENT)
expect(rootElement).not.toHaveClass('show')
await component.callMethod('show')
await page.waitForChanges()
expect(rootElement).toHaveClass('show')
})
it('hide()', async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
const rootElement = await page.find(ROOT_ELEMENT)
await component.callMethod('show')
await page.waitForChanges()
expect(rootElement).toHaveClass('show')
await component.callMethod('hide')
await page.waitForChanges()
expect(rootElement).not.toHaveClass('show')
})
})
} | kimulaco/webc-modal | src/components/webc-modal/webc-modal.e2e.ts | TypeScript |
ArrowFunction |
() => {
it('render', async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
expect(component).toHaveClass('hydrated')
})
} | kimulaco/webc-modal | src/components/webc-modal/webc-modal.e2e.ts | TypeScript |
ArrowFunction |
async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
expect(component).toHaveClass('hydrated')
} | kimulaco/webc-modal | src/components/webc-modal/webc-modal.e2e.ts | TypeScript |
ArrowFunction |
() => {
it('show()', async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
const rootElement = await page.find(ROOT_ELEMENT)
expect(rootElement).not.toHaveClass('show')
await component.callMethod('show')
await page.waitForChanges()
expect(rootElement).toHaveClass('show')
})
it('hide()', async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
const rootElement = await page.find(ROOT_ELEMENT)
await component.callMethod('show')
await page.waitForChanges()
expect(rootElement).toHaveClass('show')
await component.callMethod('hide')
await page.waitForChanges()
expect(rootElement).not.toHaveClass('show')
})
} | kimulaco/webc-modal | src/components/webc-modal/webc-modal.e2e.ts | TypeScript |
ArrowFunction |
async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
const rootElement = await page.find(ROOT_ELEMENT)
expect(rootElement).not.toHaveClass('show')
await component.callMethod('show')
await page.waitForChanges()
expect(rootElement).toHaveClass('show')
} | kimulaco/webc-modal | src/components/webc-modal/webc-modal.e2e.ts | TypeScript |
ArrowFunction |
async () => {
const page = await newE2EPage()
await page.setContent(
`<webc-modal>
<p>Hello world</p>
</webc-modal>`
)
const component = await page.find(COMPONENT_NAME)
const rootElement = await page.find(ROOT_ELEMENT)
await component.callMethod('show')
await page.waitForChanges()
expect(rootElement).toHaveClass('show')
await component.callMethod('hide')
await page.waitForChanges()
expect(rootElement).not.toHaveClass('show')
} | kimulaco/webc-modal | src/components/webc-modal/webc-modal.e2e.ts | TypeScript |
ClassDeclaration |
export class Schueler {
name: string;
gruppenId?: string;
} | crymlink/projektBackend | src/interface/schueler.class.ts | TypeScript |
TypeAliasDeclaration |
export type SchuelerDocument = Schueler & Document; | crymlink/projektBackend | src/interface/schueler.class.ts | TypeScript |
ArrowFunction |
(msg: Message) => {
const dataHash = utils.solidityKeccak256(['bytes'], [msg.data]);
return utils.solidityKeccak256(
['address', 'address', 'uint256', 'bytes32', 'uint256', 'uint', 'address', 'uint', 'uint'],
[msg.from, msg.to, msg.value, dataHash, msg.nonce, msg.gasPrice, msg.gasToken, msg.gasLimit, msg.operationType]);
} | aihua/eth-UniversalLoginSDK | universal-login-contracts/lib/calculateMessageSignature.ts | TypeScript |
ArrowFunction |
(privateKey: string, msg: Message) => {
const wallet = new Wallet(privateKey);
const massageHash = calculateMessageHash(msg);
return wallet.signMessage(utils.arrayify(massageHash));
} | aihua/eth-UniversalLoginSDK | universal-login-contracts/lib/calculateMessageSignature.ts | TypeScript |
InterfaceDeclaration |
export interface Message {
from: string;
to: string;
value: utils.BigNumberish;
data: string;
nonce: utils.BigNumberish;
gasPrice: utils.BigNumberish;
gasToken: string;
gasLimit: utils.BigNumberish;
operationType: utils.BigNumberish;
} | aihua/eth-UniversalLoginSDK | universal-login-contracts/lib/calculateMessageSignature.ts | TypeScript |
ClassDeclaration |
export class AttachCertificateToDistributionCommand extends $Command<
AttachCertificateToDistributionCommandInput,
AttachCertificateToDistributionCommandOutput,
LightsailClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
constructor(readonly input: AttachCertificateToDistributionCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: LightsailClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<AttachCertificateToDistributionCommandInput, AttachCertificateToDistributionCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const handlerExecutionContext: HandlerExecutionContext = {
logger,
inputFilterSensitiveLog: AttachCertificateToDistributionRequest.filterSensitiveLog,
outputFilterSensitiveLog: AttachCertificateToDistributionResult.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}
private serialize(
input: AttachCertificateToDistributionCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_json1_1AttachCertificateToDistributionCommand(input, context);
}
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<AttachCertificateToDistributionCommandOutput> {
return deserializeAws_json1_1AttachCertificateToDistributionCommand(output, context);
}
// Start section: command_body_extra
// End section: command_body_extra
} | justingrant/aws-sdk-js-v3 | clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts | TypeScript |
TypeAliasDeclaration |
export type AttachCertificateToDistributionCommandInput = AttachCertificateToDistributionRequest; | justingrant/aws-sdk-js-v3 | clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts | TypeScript |
TypeAliasDeclaration |
export type AttachCertificateToDistributionCommandOutput = AttachCertificateToDistributionResult & __MetadataBearer; | justingrant/aws-sdk-js-v3 | clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts | TypeScript |
MethodDeclaration |
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: LightsailClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<AttachCertificateToDistributionCommandInput, AttachCertificateToDistributionCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const handlerExecutionContext: HandlerExecutionContext = {
logger,
inputFilterSensitiveLog: AttachCertificateToDistributionRequest.filterSensitiveLog,
outputFilterSensitiveLog: AttachCertificateToDistributionResult.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
} | justingrant/aws-sdk-js-v3 | clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts | TypeScript |
MethodDeclaration |
private serialize(
input: AttachCertificateToDistributionCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_json1_1AttachCertificateToDistributionCommand(input, context);
} | justingrant/aws-sdk-js-v3 | clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<AttachCertificateToDistributionCommandOutput> {
return deserializeAws_json1_1AttachCertificateToDistributionCommand(output, context);
} | justingrant/aws-sdk-js-v3 | clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts | TypeScript |
ArrowFunction |
() => {
getTableData();
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
() => {
baseTableRef.value.clearScroll();
loading.value = true;
tableModel
.base({
pageSize: pageConf.pageSize,
currentPage: pageConf.currentPage,
})
.then(res => {
tableData.value = res.list;
pageConf.total = res.total;
loading.value = false;
})
.catch(err => {
tableData.value= []
loading.value = false;
});
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
res => {
tableData.value = res.list;
pageConf.total = res.total;
loading.value = false;
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
err => {
tableData.value= []
loading.value = false;
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
({ row }) => (
<el-input | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
e => {
let { pageSize, currentPage, type } = e;
if (type === "size") {
pageConf.currentPage = 1;
getTableData();
} else {
getTableData();
}
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
row => {
const rows = Object.assign(row, { name: "1111" });
baseTableRef.value.reloadRow([rows]);
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
() => (
<div>
<vxe-table | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
({ row }) => {
return (
<el-button
size="mini"
type="success"
onClick={handINput.bind(this, row)}
>
update
</el-button>
);
} | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
MethodDeclaration |
setup() {
const baseTableRef = ref({} as VxeTableInstance);
const tableData = ref([]);
const loading = ref(false);
const pageConf = reactive({
pageSize: 20,
currentPage: 1,
total: 0,
});
onMounted(() => {
getTableData();
});
const getTableData = () => {
baseTableRef.value.clearScroll();
loading.value = true;
tableModel
.base({
pageSize: pageConf.pageSize,
currentPage: pageConf.currentPage,
})
.then(res => {
tableData.value = res.list;
pageConf.total = res.total;
loading.value = false;
})
.catch(err => {
tableData.value= []
loading.value = false;
});
};
const inputSlot = {
default: ({ row }) => (
<el-input size="mini" v-model={row | JohnZhaoXiaoHu/vue3-admin-vite-ts | src/views/table/baseTable.tsx | TypeScript |
ArrowFunction |
() => {
const props = {
processInstance: {
id: '538f9feb-5a14-4096-b791-2055b38da7c6',
processId: 'travels',
businessKey: 'Tra234',
parentProcessInstanceId: null,
parentProcessInstance: null,
processName: 'travels',
rootProcessInstanceId: null,
roles: [],
state: ProcessInstanceState.Error,
addons: [
'jobs-management',
'prometheus-monitoring',
'process-management'
],
start: new Date('2019-10-22T03:40:44.089Z'),
error: {
nodeDefinitionId: '__a1e139d5-4e77-48c9-84ae-34578e9817n',
message: 'Something went wrong'
},
lastUpdate: new Date('2019-10-22T03:40:44.089Z'),
serviceUrl: 'http://localhost:4000',
endpoint: 'http://localhost:4000',
variables:
'{"flight":{"arrival":"2019-10-30T22:00:00Z[UTC]","departure":"2019-10-23T22:00:00Z[UTC]","flightNumber":"MX555"},"trip":{"begin":"2019-10-23T22:00:00Z[UTC]","city":"New York","country":"US","end":"2019-10-30T22:00:00Z[UTC]","visaRequired":false},"hotel":{"address":{"city":"New York","country":"US","street":"street","zipCode":"12345"},"bookingNumber":"XX-012345","name":"Perfect hotel","phone":"09876543"},"traveller":{"address":{"city":"Berlin","country":"Germany","street":"Bakers","zipCode":"100200"},"email":"[email protected]","firstName":"Cristiano","lastName":"Nicolai","nationality":"German"}}',
nodes: [],
milestones: [],
isSelected: false,
childProcessInstances: []
},
onSkipClick: jest.fn(),
onRetryClick: jest.fn(),
onAbortClick: jest.fn()
};
it('Skip click test', () => {
let wrapper = mount(<ProcessListActionsKebab {...props} />);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(
wrapper
.find(DropdownItem)
.at(1)
.find('a')
.children()
.contains('Skip')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(1)
.simulate('click');
expect(props.onSkipClick).toHaveBeenCalled();
});
it('Retry click test', () => {
let wrapper = mount(<ProcessListActionsKebab {...props} />);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(
wrapper
.find(DropdownItem)
.at(0)
.find('a')
.children()
.contains('Retry')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(0)
.simulate('click');
expect(props.onRetryClick).toHaveBeenCalled();
});
it('Abort click test', () => {
let wrapper = mount(<ProcessListActionsKebab {...props} />);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(
wrapper
.find(DropdownItem)
.at(2)
.find('a')
.children()
.contains('Abort')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(2)
.simulate('click');
expect(props.onAbortClick).toHaveBeenCalled();
});
it('process instance in active state', () => {
let wrapper = mount(
<ProcessListActionsKebab
{...{
...props,
processInstance: {
...props.processInstance,
state: ProcessInstanceState.Active
}
}}
/>
);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(wrapper.find(DropdownItem).length).toEqual(1);
expect(
wrapper
.find(DropdownItem)
.at(0)
.find('a')
.children()
.contains('Abort')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(0)
.simulate('click');
expect(props.onAbortClick).toHaveBeenCalled();
});
} | AjayJagan/kogito-apps | ui-packages/packages/process-list/src/envelope/components/ProcessListActionsKebab/tests/ProcessListActionsKebab.test.tsx | TypeScript |
ArrowFunction |
() => {
let wrapper = mount(<ProcessListActionsKebab {...props} />);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(
wrapper
.find(DropdownItem)
.at(1)
.find('a')
.children()
.contains('Skip')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(1)
.simulate('click');
expect(props.onSkipClick).toHaveBeenCalled();
} | AjayJagan/kogito-apps | ui-packages/packages/process-list/src/envelope/components/ProcessListActionsKebab/tests/ProcessListActionsKebab.test.tsx | TypeScript |
ArrowFunction |
() => {
let wrapper = mount(<ProcessListActionsKebab {...props} />);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(
wrapper
.find(DropdownItem)
.at(0)
.find('a')
.children()
.contains('Retry')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(0)
.simulate('click');
expect(props.onRetryClick).toHaveBeenCalled();
} | AjayJagan/kogito-apps | ui-packages/packages/process-list/src/envelope/components/ProcessListActionsKebab/tests/ProcessListActionsKebab.test.tsx | TypeScript |
ArrowFunction |
() => {
let wrapper = mount(<ProcessListActionsKebab {...props} />);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(
wrapper
.find(DropdownItem)
.at(2)
.find('a')
.children()
.contains('Abort')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(2)
.simulate('click');
expect(props.onAbortClick).toHaveBeenCalled();
} | AjayJagan/kogito-apps | ui-packages/packages/process-list/src/envelope/components/ProcessListActionsKebab/tests/ProcessListActionsKebab.test.tsx | TypeScript |
ArrowFunction |
() => {
let wrapper = mount(
<ProcessListActionsKebab
{...{
...props,
processInstance: {
...props.processInstance,
state: ProcessInstanceState.Active
}
}}
/>
);
wrapper
.find(Dropdown)
.find(KebabToggle)
.find('button')
.simulate('click');
wrapper = wrapper.update();
expect(wrapper.find(DropdownItem).length).toEqual(1);
expect(
wrapper
.find(DropdownItem)
.at(0)
.find('a')
.children()
.contains('Abort')
).toBeTruthy();
wrapper
.find(DropdownItem)
.at(0)
.simulate('click');
expect(props.onAbortClick).toHaveBeenCalled();
} | AjayJagan/kogito-apps | ui-packages/packages/process-list/src/envelope/components/ProcessListActionsKebab/tests/ProcessListActionsKebab.test.tsx | TypeScript |
FunctionDeclaration | /**
* Compares two currencies for equality
*/
export declare function currencyEquals(currencyA: Currency, currencyB: Currency): boolean; | hexlabio/pancake-sdk | dist/entities/token.d.ts | TypeScript |
ClassDeclaration | /**
* Represents an ERC20 token with a unique address and some metadata.
*/
export declare class Token extends Currency {
readonly chainId: ChainId;
readonly address: string;
readonly projectLink?: string;
constructor(chainId: ChainId, address: string, decimals: number, symbol?: string, name?: string, projectLink?: string);
/**
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
* @param other other token to compare
*/
equals(other: Token): boolean;
/**
* Returns true if the address of this token sorts before the address of the other token
* @param other other token to compare
* @throws if the tokens have the same address
* @throws if the tokens are on different chains
*/
sortsBefore(other: Token): boolean;
} | hexlabio/pancake-sdk | dist/entities/token.d.ts | TypeScript |
MethodDeclaration | /**
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
* @param other other token to compare
*/
equals(other: Token): boolean; | hexlabio/pancake-sdk | dist/entities/token.d.ts | TypeScript |
MethodDeclaration | /**
* Returns true if the address of this token sorts before the address of the other token
* @param other other token to compare
* @throws if the tokens have the same address
* @throws if the tokens are on different chains
*/
sortsBefore(other: Token): boolean; | hexlabio/pancake-sdk | dist/entities/token.d.ts | TypeScript |
FunctionDeclaration |
export default function makeExpressRouterAdapter() {
return function expressRouterAdapter(controller, responseFormat?: string, download?: boolean) {
return async (req: Request | any, res: Response) => {
const httpRequest: IHttpRequest = {
body: req.body,
params: req.params,
token: req.params.token,
ref: req.params.ref,
lang: req.params.lang,
file: req.file
}
// console.log('adapt lang ', httpRequest.lang)
const httpResponse: IHttpResponse = await controller(httpRequest)
if(download) {
res.type(responseFormat)
res.status(httpResponse.statusCode).download(httpResponse.body.data)
} else if (responseFormat === 'html') {
res.type(responseFormat)
res.status(httpResponse.statusCode).render(httpResponse.body.view)
} else if (responseFormat) {
res.type(responseFormat)
res.status(httpResponse.statusCode).send(httpResponse.body)
} else {
res.status(httpResponse.statusCode).json(httpResponse.body)
}
}
}
} | Nex-Developers/node-boilerplate | src/configs/adapters/express-router-adapter.ts | TypeScript |
ArrowFunction |
async (req: Request | any, res: Response) => {
const httpRequest: IHttpRequest = {
body: req.body,
params: req.params,
token: req.params.token,
ref: req.params.ref,
lang: req.params.lang,
file: req.file
}
// console.log('adapt lang ', httpRequest.lang)
const httpResponse: IHttpResponse = await controller(httpRequest)
if(download) {
res.type(responseFormat)
res.status(httpResponse.statusCode).download(httpResponse.body.data)
} else if (responseFormat === 'html') {
res.type(responseFormat)
res.status(httpResponse.statusCode).render(httpResponse.body.view)
} else if (responseFormat) {
res.type(responseFormat)
res.status(httpResponse.statusCode).send(httpResponse.body)
} else {
res.status(httpResponse.statusCode).json(httpResponse.body)
}
} | Nex-Developers/node-boilerplate | src/configs/adapters/express-router-adapter.ts | TypeScript |
ArrowFunction |
({ hideLoader, onInViewport, pending }) => {
const [inViewport, setInViewport] = useState(false)
const [element, setElement] = useState<HTMLDivElement | null>(null)
useEffect(() => {
if (element) {
const observer = new IntersectionObserver(
entries => {
for (const entry of entries) {
if (entry.intersectionRatio > 0) {
setInViewport(true)
} else {
setInViewport(false)
}
}
},
{
root: null,
rootMargin: "200px",
threshold: 0,
},
)
observer.observe(element)
return () => observer.disconnect()
}
}, [element])
useEffect(() => {
if (!pending && inViewport) {
onInViewport?.()
}
}, [inViewport, onInViewport, pending])
return (
<div className={styles.main} ref={setElement}>
{pending && !hideLoader && <PropagateLoader color="#0080a0" />} | keesey/phylopic | apps/www/src/swr/pagination/InfiniteScroll/index.tsx | TypeScript |
ArrowFunction |
() => {
if (element) {
const observer = new IntersectionObserver(
entries => {
for (const entry of entries) {
if (entry.intersectionRatio > 0) {
setInViewport(true)
} else {
setInViewport(false)
}
}
},
{
root: null,
rootMargin: "200px",
threshold: 0,
},
)
observer.observe(element)
return () => observer.disconnect()
}
} | keesey/phylopic | apps/www/src/swr/pagination/InfiniteScroll/index.tsx | TypeScript |
ArrowFunction |
entries => {
for (const entry of entries) {
if (entry.intersectionRatio > 0) {
setInViewport(true)
} else {
setInViewport(false)
}
}
} | keesey/phylopic | apps/www/src/swr/pagination/InfiniteScroll/index.tsx | TypeScript |
ArrowFunction |
() => observer.disconnect() | keesey/phylopic | apps/www/src/swr/pagination/InfiniteScroll/index.tsx | TypeScript |
ArrowFunction |
() => {
if (!pending && inViewport) {
onInViewport?.()
}
} | keesey/phylopic | apps/www/src/swr/pagination/InfiniteScroll/index.tsx | TypeScript |
InterfaceDeclaration |
export interface Props {
hideLoader?: boolean
onInViewport?: () => void
pending?: boolean
} | keesey/phylopic | apps/www/src/swr/pagination/InfiniteScroll/index.tsx | TypeScript |
ArrowFunction |
(iconProps: IFluentIconsProps, props: React.HTMLAttributes<HTMLElement>): JSX.Element => {
const {
primaryFill,
className
} = iconProps;
return <svg {...props} width={12} height={12} viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" className={className}><path d="M7.5 5.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z" fill={primaryFill} /><path d="M1 3.5C1 2.67 1.67 2 2.5 2h7c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5h-7A1.5 1.5 0 011 8.5v-5zM8 9h1.5a.5.5 0 00.5-.5v-5a.5.5 0 00-.5-.5h-7a.5.5 0 00-.5.5v5c0 .28.22.5.5.5H4v-.5a1 1 0 011-1h2a1 1 0 011 1V9z" fill={primaryFill} /></svg>;
} | LiquidatorCoder/fluentui-system-icons | packages/react-icons/src/components/VideoPerson12Filled.tsx | TypeScript |
ArrowFunction |
() => import('./views/base/base.module').then(m => m.BaseModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.BaseModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/buttons/buttons.module').then(m => m.ButtonsModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.ButtonsModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/chartjs/chartjs.module').then(m => m.ChartJSModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.ChartJSModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/dashboard/dashboard.module').then(m => m.DashboardModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.DashboardModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/icons/icons.module').then(m => m.IconsModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.IconsModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/notifications/notifications.module').then(m => m.NotificationsModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.NotificationsModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/manage/manage.module').then(m => m.ManageModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.ManageModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/theme/theme.module').then(m => m.ThemeModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.ThemeModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
() => import('./views/widgets/widgets.module').then(m => m.WidgetsModule) | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ArrowFunction |
m => m.WidgetsModule | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [ RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {} | funpk4/eshopper-heroku | src/app/app.routing.ts | TypeScript |
ClassDeclaration |
export class AwsS3Component implements Component {
constructor() {
this.providers = {
[AWSS3Bindings.AwsS3Provider.key]: AwsS3Provider,
};
}
providers?: ProviderMap = {};
} | sf-kansara/loopback4-s3 | src/component.ts | TypeScript |
ArrowFunction |
(processCfg: HyperionProcessConfig)=> {
const type: string = processCfg.type;
if (this.moduleRegistry.has(type)) {
const module: HyperionModule = this.moduleRegistry.get(type);
const validator: HyperionValidator = module.getValidator();
const err: AsteriaError = validator.validate(processCfg);
if (err) {
logger.fatal(err.toString());
throw ErrorUtil.errorToException(err);
} else {
const process: StreamProcess = module.buildStreamProcess(processCfg.config);
this.PROCESSOR.addProcess(process);
}
} else {
const error: AsteriaError = new AsteriaError(
AsteriaErrorCode.INVALID_CONFIG,
this.getClassName(),
`module with reference "${type}" does not exist; use registerModule() to add a module to the hyperion processor`
);
logger.fatal(error.toString());
throw ErrorUtil.errorToException(error);
}
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
ClassDeclaration | /**
* The <code>Hyperion</code> class is the entry point of the Hyperion framework. It provides all functionalities needed
* for running Asteria processes defined by Plain Old JavaScript objects.
*/
export class Hyperion extends AbstractAsteriaObject {
/**
* The session config for this <code>Hyperion</code> instance.
*/
private readonly CONFIG: HyperionConfig = null;
/**
* The reference to the session holded by this <code>Hyperion</code> instance.
*/
private readonly SESSION: OuranosSession = null;
/**
* The reference to the processor used by this <code>Hyperion</code> instance to run Asteria stream processes.
*/
private readonly PROCESSOR: HyperionProcessor = null;
/**
* The module registry associated with this <code>Hyperion</code> instance.
*/
private moduleRegistry: HyperionModuleRegistry = null;
/**
* Create a new <code>Hyperion</code> instance.
*
* @param {HyperionConfig} config the config of the session associated with the new <code>Hyperion</code> instance.
*/
private constructor(config: HyperionConfig) {
super('com.asteria.hyperion.core::Hyperion');
this.CONFIG = config;
this.SESSION = Ouranos.createSession({ name: config.name }) as OuranosSession;
this.PROCESSOR = new HyperionProcessor(this.SESSION);
}
/**
* Build and return a new <code>Hyperion</code> instance.
*
* @param {HyperionConfig} config the description of all Asteria processes managed by this <code>Hyperion</code>
* instance.
*
* @returns {Hyperion} a new <code>Hyperion</code> instance.
*/
public static build(config: HyperionConfig, moduleRegistry: HyperionModuleRegistry = null): Hyperion {
const processor: Hyperion = new Hyperion(config);
processor.setModuleRegistry(moduleRegistry);
return processor;
}
/**
* Return the <code>HyperionModuleRegistry</code> object for this processor.
*
* @returns {HyperionModuleRegistry} the <code>HyperionModuleRegistry</code> object for this processor.
*/
public getModuleRegistry(): HyperionModuleRegistry {
return this.moduleRegistry;
}
/**
* Set the <code>HyperionModuleRegistry</code> object for this processor.
*
* @param {HyperionModuleRegistry} moduleRegistry the new <code>HyperionModuleRegistry</code> object for this
* processor.
*/
public setModuleRegistry(moduleRegistry: HyperionModuleRegistry = null): void {
const logger: AsteriaLogger = (this.SESSION.getContext() as OuranosContext).getLogger();
if (moduleRegistry) {
this.moduleRegistry = moduleRegistry;
logger.info(`new module registry added: ${moduleRegistry.getClassName()}`);
} else {
this.initModuleRegistry();
logger.info('default module registry initialized');
}
}
/**
* Run all stream processes registered in this <code>Hyperion</code> instance and return the the reference to the
* last registered stream.
*
* @returns {AsteriaStream} the reference to the <code>AsteriaStream</code> objects created by this processor.
*/
public run(): AsteriaStream {
this.initProcessor(this.CONFIG);
return this.PROCESSOR.run();
}
/**
* Stop all stream processes registered in this <code>Hyperion</code> instance.
*/
public stop(): void {
// TODO: not implemented yet.
}
/**
* Return the context for this <code>Hyperion</code> instance.
*
* @returns {AsteriaContext} the context for this <code>Hyperion</code> instance.
*/
public getContext(): AsteriaContext {
return this.SESSION.getContext();
}
/**
* Parse the specified Hyperion config and initialize the processor.
*/
private initProcessor(config: HyperionConfig): void {
const processes: Array<HyperionProcessConfig> = config.processes;
const logger: AsteriaLogger = (this.SESSION.getContext() as OuranosContext).getLogger();
if (processes && processes.length > 0) {
config.processes.forEach((processCfg: HyperionProcessConfig)=> {
const type: string = processCfg.type;
if (this.moduleRegistry.has(type)) {
const module: HyperionModule = this.moduleRegistry.get(type);
const validator: HyperionValidator = module.getValidator();
const err: AsteriaError = validator.validate(processCfg);
if (err) {
logger.fatal(err.toString());
throw ErrorUtil.errorToException(err);
} else {
const process: StreamProcess = module.buildStreamProcess(processCfg.config);
this.PROCESSOR.addProcess(process);
}
} else {
const error: AsteriaError = new AsteriaError(
AsteriaErrorCode.INVALID_CONFIG,
this.getClassName(),
`module with reference "${type}" does not exist; use registerModule() to add a module to the hyperion processor`
);
logger.fatal(error.toString());
throw ErrorUtil.errorToException(error);
}
});
} else {
const error: AsteriaError = OuranosErrorBuilder.getInstance().build(
AsteriaErrorCode.MISSING_PARAMETER,
this.getClassName(),
'no processes are specified'
);
logger.warn(error.toString());
}
}
/**
* Initialize the module registry with default modules.
*/
private initModuleRegistry(): void {
const factory: HyperionModuleRegistryFactory = new HyperionModuleRegistryFactory();
this.moduleRegistry = factory.create();
}
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Build and return a new <code>Hyperion</code> instance.
*
* @param {HyperionConfig} config the description of all Asteria processes managed by this <code>Hyperion</code>
* instance.
*
* @returns {Hyperion} a new <code>Hyperion</code> instance.
*/
public static build(config: HyperionConfig, moduleRegistry: HyperionModuleRegistry = null): Hyperion {
const processor: Hyperion = new Hyperion(config);
processor.setModuleRegistry(moduleRegistry);
return processor;
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Return the <code>HyperionModuleRegistry</code> object for this processor.
*
* @returns {HyperionModuleRegistry} the <code>HyperionModuleRegistry</code> object for this processor.
*/
public getModuleRegistry(): HyperionModuleRegistry {
return this.moduleRegistry;
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Set the <code>HyperionModuleRegistry</code> object for this processor.
*
* @param {HyperionModuleRegistry} moduleRegistry the new <code>HyperionModuleRegistry</code> object for this
* processor.
*/
public setModuleRegistry(moduleRegistry: HyperionModuleRegistry = null): void {
const logger: AsteriaLogger = (this.SESSION.getContext() as OuranosContext).getLogger();
if (moduleRegistry) {
this.moduleRegistry = moduleRegistry;
logger.info(`new module registry added: ${moduleRegistry.getClassName()}`);
} else {
this.initModuleRegistry();
logger.info('default module registry initialized');
}
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Run all stream processes registered in this <code>Hyperion</code> instance and return the the reference to the
* last registered stream.
*
* @returns {AsteriaStream} the reference to the <code>AsteriaStream</code> objects created by this processor.
*/
public run(): AsteriaStream {
this.initProcessor(this.CONFIG);
return this.PROCESSOR.run();
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Stop all stream processes registered in this <code>Hyperion</code> instance.
*/
public stop(): void {
// TODO: not implemented yet.
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Return the context for this <code>Hyperion</code> instance.
*
* @returns {AsteriaContext} the context for this <code>Hyperion</code> instance.
*/
public getContext(): AsteriaContext {
return this.SESSION.getContext();
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Parse the specified Hyperion config and initialize the processor.
*/
private initProcessor(config: HyperionConfig): void {
const processes: Array<HyperionProcessConfig> = config.processes;
const logger: AsteriaLogger = (this.SESSION.getContext() as OuranosContext).getLogger();
if (processes && processes.length > 0) {
config.processes.forEach((processCfg: HyperionProcessConfig)=> {
const type: string = processCfg.type;
if (this.moduleRegistry.has(type)) {
const module: HyperionModule = this.moduleRegistry.get(type);
const validator: HyperionValidator = module.getValidator();
const err: AsteriaError = validator.validate(processCfg);
if (err) {
logger.fatal(err.toString());
throw ErrorUtil.errorToException(err);
} else {
const process: StreamProcess = module.buildStreamProcess(processCfg.config);
this.PROCESSOR.addProcess(process);
}
} else {
const error: AsteriaError = new AsteriaError(
AsteriaErrorCode.INVALID_CONFIG,
this.getClassName(),
`module with reference "${type}" does not exist; use registerModule() to add a module to the hyperion processor`
);
logger.fatal(error.toString());
throw ErrorUtil.errorToException(error);
}
});
} else {
const error: AsteriaError = OuranosErrorBuilder.getInstance().build(
AsteriaErrorCode.MISSING_PARAMETER,
this.getClassName(),
'no processes are specified'
);
logger.warn(error.toString());
}
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
MethodDeclaration | /**
* Initialize the module registry with default modules.
*/
private initModuleRegistry(): void {
const factory: HyperionModuleRegistryFactory = new HyperionModuleRegistryFactory();
this.moduleRegistry = factory.create();
} | asteria-project/asteria-hyperion | src/com/asteria/hyperion/core/Hyperion.ts | TypeScript |
ArrowFunction |
() => {
const { state, controls } = useContext(ColorGeneratorContext);
const [activeColor, setActiveColor] = useState('');
const toggleActiveColor = (color: string) => {
setActiveColor(activeColor === color ? '' : color);
};
return (
<ul className={styles.selectColors}>
{Array.from(state.colors).map(([name]) => {
const { tint, shade } = state.colors.get(name);
const isOpen = activeColor === name ? true : false;
return (
<li
className={clsx({ [styles.item]: true, [styles.isOpen]: isOpen })}
>
<VariableSelector
name={name}
isParentOpen={isOpen}
onClick={() | Christo-Deyzel/ionic-docs | src/components/ColorGenerator/SelectColors/index.tsx | TypeScript |
ArrowFunction |
(color: string) => {
setActiveColor(activeColor === color ? '' : color);
} | Christo-Deyzel/ionic-docs | src/components/ColorGenerator/SelectColors/index.tsx | TypeScript |
ArrowFunction |
([name]) => {
const { tint, shade } = state.colors.get(name);
const isOpen = activeColor === name ? true : false;
return (
<li
className={clsx({ [styles.item]: true, [styles.isOpen]: isOpen })}
>
<VariableSelector
name={name}
isParentOpen={isOpen}
onClick={() | Christo-Deyzel/ionic-docs | src/components/ColorGenerator/SelectColors/index.tsx | TypeScript |
MethodDeclaration |
clsx({ [styles.item]: true, [styles.isOpen]: isOpen }) | Christo-Deyzel/ionic-docs | src/components/ColorGenerator/SelectColors/index.tsx | TypeScript |
ClassDeclaration |
export declare class NgbTimepickerModule {
} | bigzerosolutions/qlez-app | node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.module.d.ts | TypeScript |
ArrowFunction |
([key, value]) => {
if (value === null || typeof value === 'undefined') {
return;
}
if (Array.isArray(value)) {
// eslint-disable-next-line no-param-reassign
value = value.join(',');
}
if (value instanceof Date) {
// eslint-disable-next-line no-param-reassign
value = value.toISOString();
} else if (value !== null && typeof value === 'object') {
// eslint-disable-next-line no-param-reassign
value = JSON.stringify(value);
} else if (value instanceof Function) {
const part = value();
return part && parts.push(part);
}
parts.push(`${this.encode(key)}=${this.encode(value)}`);
return;
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ArrowFunction |
([, value]) => typeof value !== 'undefined' | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ArrowFunction |
(accumulator, [key, value]) => ({ ...accumulator, [key]: value }) | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ArrowFunction |
(data: T): void => callback(null, data) | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ArrowFunction |
(data: T): T => data | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ArrowFunction |
(error: Config.Error) => callback(error) | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ArrowFunction |
(error: Error) => {
throw error;
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ClassDeclaration |
export class BaseClient implements Client {
private instance: AxiosInstance;
constructor(protected readonly config: Config) {
this.instance = axios.create({
paramsSerializer: this.paramSerializer.bind(this),
...config.baseRequestConfig,
baseURL: config.host,
headers: this.removeUndefinedProperties({
[STRICT_GDPR_FLAG]: config.strictGDPR,
[ATLASSIAN_TOKEN_CHECK_FLAG]: config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined,
...config.baseRequestConfig?.headers,
}),
});
if (this.config.newErrorHandling === undefined) {
console.log('Jira.js: Deprecation warning: New error handling mechanism added. Please use `newErrorHandling: true` in config'); // TODO New feature enabling.
}
}
protected paramSerializer(parameters: Record<string, any>): string {
const parts: string[] = [];
Object.entries(parameters).forEach(([key, value]) => {
if (value === null || typeof value === 'undefined') {
return;
}
if (Array.isArray(value)) {
// eslint-disable-next-line no-param-reassign
value = value.join(',');
}
if (value instanceof Date) {
// eslint-disable-next-line no-param-reassign
value = value.toISOString();
} else if (value !== null && typeof value === 'object') {
// eslint-disable-next-line no-param-reassign
value = JSON.stringify(value);
} else if (value instanceof Function) {
const part = value();
return part && parts.push(part);
}
parts.push(`${this.encode(key)}=${this.encode(value)}`);
return;
});
return parts.join('&');
}
protected encode(value: string) {
return encodeURIComponent(value)
.replace(/%3A/gi, ':')
.replace(/%24/g, '$')
.replace(/%2C/gi, ',')
.replace(/%20/g, '+')
.replace(/%5B/gi, '[')
.replace(/%5D/gi, ']');
}
protected removeUndefinedProperties(obj: Record<string, any>): Record<string, any> {
return Object.entries(obj)
.filter(([, value]) => typeof value !== 'undefined')
.reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {});
}
async sendRequest<T>(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise<T>;
async sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T>, telemetryData?: any): Promise<void>;
async sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T> | never): Promise<void | T> {
try {
const modifiedRequestConfig = {
...requestConfig,
headers: this.removeUndefinedProperties({
Authorization: await AuthenticationService.getAuthenticationToken(this.config.authentication, {
baseURL: this.config.host,
url: this.instance.getUri(requestConfig),
method: requestConfig.method!,
}),
...requestConfig.headers,
}),
};
const response = await this.instance.request<T>(modifiedRequestConfig);
const callbackResponseHandler = callback && ((data: T): void => callback(null, data));
const defaultResponseHandler = (data: T): T => data;
const responseHandler = callbackResponseHandler ?? defaultResponseHandler;
this.config.middlewares?.onResponse?.(response.data);
return responseHandler(response.data);
} catch (e: any) {
const err = this.config.newErrorHandling && e.isAxiosError ? e.response.data : e;
const callbackErrorHandler = callback && ((error: Config.Error) => callback(error));
const defaultErrorHandler = (error: Error) => {
throw error;
};
const errorHandler = callbackErrorHandler ?? defaultErrorHandler;
this.config.middlewares?.onError?.(err);
return errorHandler(err);
}
}
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
MethodDeclaration |
protected paramSerializer(parameters: Record<string, any>): string {
const parts: string[] = [];
Object.entries(parameters).forEach(([key, value]) => {
if (value === null || typeof value === 'undefined') {
return;
}
if (Array.isArray(value)) {
// eslint-disable-next-line no-param-reassign
value = value.join(',');
}
if (value instanceof Date) {
// eslint-disable-next-line no-param-reassign
value = value.toISOString();
} else if (value !== null && typeof value === 'object') {
// eslint-disable-next-line no-param-reassign
value = JSON.stringify(value);
} else if (value instanceof Function) {
const part = value();
return part && parts.push(part);
}
parts.push(`${this.encode(key)}=${this.encode(value)}`);
return;
});
return parts.join('&');
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
MethodDeclaration |
protected encode(value: string) {
return encodeURIComponent(value)
.replace(/%3A/gi, ':')
.replace(/%24/g, '$')
.replace(/%2C/gi, ',')
.replace(/%20/g, '+')
.replace(/%5B/gi, '[')
.replace(/%5D/gi, ']');
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
MethodDeclaration |
protected removeUndefinedProperties(obj: Record<string, any>): Record<string, any> {
return Object.entries(obj)
.filter(([, value]) => typeof value !== 'undefined')
.reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {});
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
MethodDeclaration |
async sendRequest<T>(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise<T>; | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
MethodDeclaration |
async sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T>, telemetryData?: any): Promise<void>; | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
MethodDeclaration |
async sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T> | never): Promise<void | T> {
try {
const modifiedRequestConfig = {
...requestConfig,
headers: this.removeUndefinedProperties({
Authorization: await AuthenticationService.getAuthenticationToken(this.config.authentication, {
baseURL: this.config.host,
url: this.instance.getUri(requestConfig),
method: requestConfig.method!,
}),
...requestConfig.headers,
}),
};
const response = await this.instance.request<T>(modifiedRequestConfig);
const callbackResponseHandler = callback && ((data: T): void => callback(null, data));
const defaultResponseHandler = (data: T): T => data;
const responseHandler = callbackResponseHandler ?? defaultResponseHandler;
this.config.middlewares?.onResponse?.(response.data);
return responseHandler(response.data);
} catch (e: any) {
const err = this.config.newErrorHandling && e.isAxiosError ? e.response.data : e;
const callbackErrorHandler = callback && ((error: Config.Error) => callback(error));
const defaultErrorHandler = (error: Error) => {
throw error;
};
const errorHandler = callbackErrorHandler ?? defaultErrorHandler;
this.config.middlewares?.onError?.(err);
return errorHandler(err);
}
} | alanmxll/jira.js | src/clients/baseClient.ts | TypeScript |
ClassDeclaration |
export class ColourConfig extends React.Component<IProps, {}> {
render() {
return (
<div className={'colour-config-container'}>
<div className={'colour-select-container'}>
<div className={'colour-select'}>
<label className={'form-label'} style={{ lineHeight: '24px' }} | Meebuhs/newtab | src/newtab/components/ui/modals/editors/ColourConfig.tsx | TypeScript |
InterfaceDeclaration |
interface IProps {
updateColourValue: (attribute: string, value: RGBColor) => void
backgroundColour: RGBColor
} | Meebuhs/newtab | src/newtab/components/ui/modals/editors/ColourConfig.tsx | TypeScript |
MethodDeclaration |
render() {
return (
<div className={'colour-config-container'}>
<div className={'colour-select-container'}>
<div className={'colour-select'}>
<label className={'form-label'} style={{ lineHeight: '24px' }} | Meebuhs/newtab | src/newtab/components/ui/modals/editors/ColourConfig.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.