type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
( props: DashboardHeaderProps, ref: React.Ref<HTMLDivElement> ) => { const { asPublicHeader = false, subHeader, className, ...otherProps } = props; const classes = useStyles(); return ( <header ref={ref} className={c(className, classes.root, { [classes.publicHeader]: asPublicHeader })}
porser/porser-client
components/container/DashboardHeader/DashboardHeader.tsx
TypeScript
InterfaceDeclaration
interface DashboardHeaderBaseProps { className?: string; asPublicHeader?: boolean; subHeader?: JSX.Element; }
porser/porser-client
components/container/DashboardHeader/DashboardHeader.tsx
TypeScript
TypeAliasDeclaration
type DashboardHeaderProps = Omit< React.ComponentPropsWithRef<"div">, keyof DashboardHeaderBaseProps > & DashboardHeaderBaseProps;
porser/porser-client
components/container/DashboardHeader/DashboardHeader.tsx
TypeScript
MethodDeclaration
c(className, classes
porser/porser-client
components/container/DashboardHeader/DashboardHeader.tsx
TypeScript
ArrowFunction
({ size = 's', color, customSize, }: IconProps): JSX.Element => ( <div className={`fds-icon fds-icon--${size}`
clew-cbi/form-design-system
src/icons/react/MAIcon.tsx
TypeScript
ArrowFunction
() => log(`Running at http://localhost:${port}`)
patricklatorre/typescript-mvc-starter
server/src/index.ts
TypeScript
FunctionDeclaration
/** * @ignore Exclude from docs * @todo Description */ export declare function fromArray<A>(array: Array<A>): Iterator<A>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * @ignore Exclude from docs * @todo Description */ export declare function length<A>(iter: Iterator<A>): number;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * @ignore Exclude from docs * @todo Description */ export declare function toArray<A>(iter: Iterator<A>): Array<A>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function eachContinue<A>(iter: Iterator<A>, fn: (value: A) => boolean): void;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function each<A>(iter: Iterator<A>, fn: (value: A) => void): void;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function sort<A>(iter: Iterator<A>, fn: (left: A, right: A) => Ordering): Iterator<A>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [A description] * * @ignore Exclude from docs * @todo Description * @type {[type]} */ export declare function map<A, B>(iter: Iterator<A>, fn: (value: A) => B): Iterator<B>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function filter<A>(iter: Iterator<A>, fn: (value: A) => boolean): Iterator<A>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * @ignore Exclude from docs * @todo Description */ export declare function concat<A>(...args: Array<Iterator<A>>): Iterator<A>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * @ignore Exclude from docs * @todo Description */ export declare function flatten<A>(iter: Iterator<Iterator<A>>): Iterator<A>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [number description] * * @ignore Exclude from docs * @todo Description * @type {[type]} */ export declare function indexed<A>(iter: Iterator<A>): Iterator<[number, A]>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function findIndex<A>(iter: Iterator<A>, matches: (value: A) => boolean): number;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function find<A>(iter: Iterator<A>, matches: (value: A) => boolean): A | undefined;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [A description] * * @ignore Exclude from docs * @todo Description * @type {[type]} */ export declare function findMap<A, B>(iter: Iterator<A>, matches: (value: A) => B | null): B | undefined;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [iter description] * * @ignore Exclude from docs * @todo Description * @type {Iterator<A>} */ export declare function contains<A>(iter: Iterator<A>, matches: (value: A) => boolean): boolean;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [A description] * * @ignore Exclude from docs * @todo Description * @type {[type]} */ export declare function foldl<A, B>(iter: Iterator<A>, init: B, fn: (state: B, value: A) => B): B;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [min description] * * @ignore Exclude from docs * @todo Verify that this works correctly * @todo Description * @param {Iterator<number>} a [description] * @return {number} [description] */ export declare function min(a: Iterator<number>): number | null;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [max description] * * @ignore Exclude from docs * @todo Verify that this works correctly * @todo Description * @param {Iterator<number>} a [description] * @return {number} [description] */ export declare function max(a: Iterator<number>): number | null;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
FunctionDeclaration
/** * [join description] * * @ignore Exclude from docs * @todo Description * @param {Iterator<string>} iter [description] * @param {string = ""} separator [description] * @return {string} [description] */ export declare function join(iter: Iterator<string>, separator?: string): string;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
ClassDeclaration
/** * @ignore Exclude from docs * @todo Description */ export declare class ListIterator<T extends IClone<T>> { private _listCopy; private _create; list: Iterable<T>; createNewItems: boolean; /** * Constructor * * @param {Iterable<T>} list [description] * @param {() => T} create [description] */ constructor(list: Iterable<T>, create: () => T); reset(): void; clear(): void; getFirst(): $type.Optional<T>; getLast(): $type.Optional<T>; find(fn: (value: T) => boolean): $type.Optional<T>; removeItem(item: T): boolean; protected returnItem(index: number): $type.Optional<T>; iterator(): Iterator<T>; }
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
InterfaceDeclaration
/** * ============================================================================ * UTILITY FUNCTIONS * ============================================================================ * @hidden */ /** * @ignore Exclude from docs * @todo Description */ export interface Iterator<A> { (push: (value: A) => boolean): void; }
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
InterfaceDeclaration
/** * @ignore Exclude from docs * @todo Description */ export interface Iterable<A> { iterator(): Iterator<A>; }
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
reset(): void;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
clear(): void;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
getFirst(): $type.Optional<T>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
getLast(): $type.Optional<T>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
find(fn: (value: T) => boolean): $type.Optional<T>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
removeItem(item: T): boolean;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
protected returnItem(index: number): $type.Optional<T>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
MethodDeclaration
iterator(): Iterator<T>;
brunnomatheuus/ProjetoInova-Web
node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.d.ts
TypeScript
ArrowFunction
(done) => { const payload = {}; const resources = [{}, {}, {}]; const result = {}; const config: RedundancyConfig = { resources, index: 0, timeout: 200, rotate: 50, random: false, dataAfterTimeout: false, }; // Tracking let isSync = true; const startTime = Date.now(); let sentQuery = 0; let itemAborted = false; let secondItem: PendingQueryItem; // Send query const getStatus = sendQuery( config, payload, (resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 3 times expect(sentQuery < 3).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { done( 'Abort should have not been called for first item' ); }; // Fail in 20ms setTimeout(() => { // Status should not have changed const status = getStatus(); expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Fail queryItem.done(void 0, true); }, 20); return; case 2: // Only second query should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { done( 'Abort should have not been called for second item' ); }; // Save item secondItem = queryItem; return; case 3: // 2nd and 3rd queries should be pending expect(status.queriesSent).to.be.equal(3); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { // This item should be aborted, but only once expect(itemAborted).to.be.equal(false); expect(sentQuery).to.be.equal(3); itemAborted = true; }; // Complete second item secondItem.done(result); return; default: done('This code should not have been reached'); } }, (data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(3); // Third query should have been aborted expect(itemAborted).to.be.equal(true); // Validate data expect(data).to.be.equal(result); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(3); expect(status.queriesPending).to.be.equal(0); // 20ms from first query failing, 50ms from delay between second and third const diff = Date.now() - startTime; expect(diff > 50 && diff < 90).to.be.equal( true, `Time difference: ${diff}, should have been ~70ms` ); done(); } ); // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(0); expect(status.queriesPending).to.be.equal(0); isSync = false; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 3 times expect(sentQuery < 3).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { done( 'Abort should have not been called for first item' ); }; // Fail in 20ms setTimeout(() => { // Status should not have changed const status = getStatus(); expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Fail queryItem.done(void 0, true); }, 20); return; case 2: // Only second query should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { done( 'Abort should have not been called for second item' ); }; // Save item secondItem = queryItem; return; case 3: // 2nd and 3rd queries should be pending expect(status.queriesSent).to.be.equal(3); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { // This item should be aborted, but only once expect(itemAborted).to.be.equal(false); expect(sentQuery).to.be.equal(3); itemAborted = true; }; // Complete second item secondItem.done(result); return; default: done('This code should not have been reached'); } }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { done( 'Abort should have not been called for first item' ); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
() => { // Status should not have changed const status = getStatus(); expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Fail queryItem.done(void 0, true); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { done( 'Abort should have not been called for second item' ); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { // This item should be aborted, but only once expect(itemAborted).to.be.equal(false); expect(sentQuery).to.be.equal(3); itemAborted = true; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(3); // Third query should have been aborted expect(itemAborted).to.be.equal(true); // Validate data expect(data).to.be.equal(result); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(3); expect(status.queriesPending).to.be.equal(0); // 20ms from first query failing, 50ms from delay between second and third const diff = Date.now() - startTime; expect(diff > 50 && diff < 90).to.be.equal( true, `Time difference: ${diff}, should have been ~70ms` ); done(); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(done) => { const payload = {}; const resources = [{}, {}]; const result1 = {}; const result2 = {}; const config: RedundancyConfig = { resources, index: 0, timeout: 200, rotate: 50, random: false, dataAfterTimeout: false, }; // Tracking let isSync = true; const startTime = Date.now(); let sentQuery = 0; let itemAborted = false; let firstItem: PendingQueryItem; // Send query const getStatus = sendQuery( config, payload, (resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 2 times expect(sentQuery < 2).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { done( 'Abort should have not been called for first item' ); }; // Store item firstItem = queryItem; return; case 2: // Both queries should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { expect(itemAborted).to.be.equal(false); itemAborted = true; }; // Complete first item in 20ms (70ms from start), then second item setTimeout(() => { // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); firstItem.done(result1); // Complete second item in 30 ms setTimeout(() => { expect(queryItem.status).to.be.equal('aborted'); // Should not change anything because query is already complete queryItem.done(result2); // Finish test done(); }, 30); }, 20); return; default: done('This code should not have been reached'); } }, (data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(2); // Second query should have been aborted expect(itemAborted).to.be.equal(true); // Validate data expect(data).to.be.equal(result1); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 50ms delay between queries, 20ms delay by test timer const diff = Date.now() - startTime; expect(diff > 50 && diff < 90).to.be.equal( true, `Time difference: ${diff}, should have been ~70ms` ); // Do not finish: second item is still pending } ); // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(0); expect(status.queriesPending).to.be.equal(0); isSync = false; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 2 times expect(sentQuery < 2).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { done( 'Abort should have not been called for first item' ); }; // Store item firstItem = queryItem; return; case 2: // Both queries should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { expect(itemAborted).to.be.equal(false); itemAborted = true; }; // Complete first item in 20ms (70ms from start), then second item setTimeout(() => { // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); firstItem.done(result1); // Complete second item in 30 ms setTimeout(() => { expect(queryItem.status).to.be.equal('aborted'); // Should not change anything because query is already complete queryItem.done(result2); // Finish test done(); }, 30); }, 20); return; default: done('This code should not have been reached'); } }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { expect(itemAborted).to.be.equal(false); itemAborted = true; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
() => { // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); firstItem.done(result1); // Complete second item in 30 ms setTimeout(() => { expect(queryItem.status).to.be.equal('aborted'); // Should not change anything because query is already complete queryItem.done(result2); // Finish test done(); }, 30); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
() => { expect(queryItem.status).to.be.equal('aborted'); // Should not change anything because query is already complete queryItem.done(result2); // Finish test done(); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(2); // Second query should have been aborted expect(itemAborted).to.be.equal(true); // Validate data expect(data).to.be.equal(result1); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 50ms delay between queries, 20ms delay by test timer const diff = Date.now() - startTime; expect(diff > 50 && diff < 90).to.be.equal( true, `Time difference: ${diff}, should have been ~70ms` ); // Do not finish: second item is still pending }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(done) => { const payload = {}; const resources = [{}, {}]; const result = {}; const config: RedundancyConfig = { resources, index: 0, timeout: 100, rotate: 25, random: false, dataAfterTimeout: false, }; // Tracking let isSync = true; const startTime = Date.now(); let sentQuery = 0; let item1Aborted = false; let item2Aborted = false; let firstItem: PendingQueryItem; let completeCount = 0; // Send query const getStatus = sendQuery( config, payload, (resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 2 times expect(sentQuery < 2).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { item1Aborted = true; }; // Store item firstItem = queryItem; return; case 2: // Both queries should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { item2Aborted = true; }; return; default: done('This code should not have been reached'); } }, (data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(2); // Bump couneter completeCount++; switch (completeCount) { case 1: // First call: time out ((): void => { // Validate data expect(data).to.be.equal(void 0); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('failed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 25ms delay between queries * 2 + 100ms timeout const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Send data from first query, which should be ignored because dataAfterTimeout is false firstItem.done(result); // Complete test done(); })(); return; default: done('Callback should have been called only once'); } } ); // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(0); expect(status.queriesPending).to.be.equal(0); isSync = false; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 2 times expect(sentQuery < 2).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { item1Aborted = true; }; // Store item firstItem = queryItem; return; case 2: // Both queries should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { item2Aborted = true; }; return; default: done('This code should not have been reached'); } }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { item1Aborted = true; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { item2Aborted = true; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(2); // Bump couneter completeCount++; switch (completeCount) { case 1: // First call: time out ((): void => { // Validate data expect(data).to.be.equal(void 0); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('failed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 25ms delay between queries * 2 + 100ms timeout const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Send data from first query, which should be ignored because dataAfterTimeout is false firstItem.done(result); // Complete test done(); })(); return; default: done('Callback should have been called only once'); } }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { // Validate data expect(data).to.be.equal(void 0); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('failed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 25ms delay between queries * 2 + 100ms timeout const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Send data from first query, which should be ignored because dataAfterTimeout is false firstItem.done(result); // Complete test done(); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(done) => { const payload = {}; const resources = [{}, {}]; const result = {}; const config: RedundancyConfig = { resources, index: 0, timeout: 100, rotate: 25, random: false, dataAfterTimeout: true, }; // Tracking let isSync = true; const startTime = Date.now(); let sentQuery = 0; let item1Aborted = false; let item2Aborted = false; let firstItem: PendingQueryItem; let completeCount = 0; // Send query const getStatus = sendQuery( config, payload, (resource, queryPayload, queryItem) => { expect(isSync).to.be.equal(false); expect(queryPayload).to.be.equal(payload); // Query should be executed 2 times expect(sentQuery < 2).to.be.equal(true); expect(resource).to.be.equal(resources[sentQuery]); // Check status expect(queryItem.getQueryStatus).to.be.equal(getStatus); const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.payload).to.be.equal(payload); // Bump counter sentQuery++; // Tests specific to each query switch (sentQuery) { case 1: // First query expect(status.queriesSent).to.be.equal(1); expect(status.queriesPending).to.be.equal(1); // Add abort queryItem.abort = (): void => { item1Aborted = true; }; // Store item firstItem = queryItem; return; case 2: // Both queries should be pending expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(2); // Add abort queryItem.abort = (): void => { item2Aborted = true; }; return; default: done('This code should not have been reached'); } }, (data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(2); // Bump couneter completeCount++; switch (completeCount) { case 1: // First call: time out ((): void => { // Validate data expect(data).to.be.equal(void 0); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('failed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 25ms delay between queries * 2 + 100ms timeout const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Send data from first query firstItem.done(result); })(); return; case 2: // Second call: data ((): void => { // Validate data expect(data).to.be.equal(result); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // Same as few lines above const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Done done(); })(); return; default: done('Callback should have been called only twice'); } } ); // Check status const status = getStatus(); expect(status.status).to.be.equal('pending'); expect(status.queriesSent).to.be.equal(0); expect(status.queriesPending).to.be.equal(0); isSync = false; }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(data, error) => { // Make sure queries were sent expect(sentQuery).to.be.equal(2); // Bump couneter completeCount++; switch (completeCount) { case 1: // First call: time out ((): void => { // Validate data expect(data).to.be.equal(void 0); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('failed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 25ms delay between queries * 2 + 100ms timeout const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Send data from first query firstItem.done(result); })(); return; case 2: // Second call: data ((): void => { // Validate data expect(data).to.be.equal(result); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // Same as few lines above const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Done done(); })(); return; default: done('Callback should have been called only twice'); } }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { // Validate data expect(data).to.be.equal(void 0); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('failed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // 25ms delay between queries * 2 + 100ms timeout const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Send data from first query firstItem.done(result); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
(): void => { // Validate data expect(data).to.be.equal(result); expect(error).to.be.equal(void 0); // Check status const status = getStatus(); expect(status.status).to.be.equal('completed'); expect(status.queriesSent).to.be.equal(2); expect(status.queriesPending).to.be.equal(0); // Same as few lines above const diff = Date.now() - startTime; expect(diff > 130 && diff < 170).to.be.equal( true, `Time difference: ${diff}, should have been ~150ms` ); // Done done(); }
cyberalien/redundancy
tests/30_advanced_queries_test.ts
TypeScript
ArrowFunction
() => { const [open, setOpen] = React.useState(true); const [openSecondOverlay, setOpenSecondOverlay] = React.useState(false); const dimension = select('dimension', ['medium', 'large'], 'medium'); const knobOpen = boolean('open', open); const knobSecondOpen = boolean('openSecondOverlay', openSecondOverlay); const onClose = () => { setOpen(!open); action('on close triggered')(); updateKnob('open', !open); }; const onCloseSecondOverlay = () => { setOpenSecondOverlay(!openSecondOverlay); action('on close triggered')(); updateKnob('openSecondOverlay', !openSecondOverlay); } const openModal = () => { setOpen(true); updateKnob('open', !open); }; const openSecondModal = () => { setOpenSecondOverlay(true); updateKnob('openSecondOverlay', true); }; return ( <div> <Paragraph> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <br /> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <br /> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <br /> Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <br /> </Paragraph> <Button appearance="primary" onClick={openModal}> Open modal </Button> <FullscreenModal closeOnEscape={true} open={knobOpen} dimension={dimension} onClose={onClose} headerOptions={{ heading: 'This is modal Heading', subHeading: 'This is modal subheading', }}
SaniyaGupta/design-system
core/components/molecules/fullscreenModal/__stories__/Layering.story.tsx
TypeScript
ArrowFunction
() => { setOpen(!open); action('on close triggered')(); updateKnob('open', !open); }
SaniyaGupta/design-system
core/components/molecules/fullscreenModal/__stories__/Layering.story.tsx
TypeScript
ArrowFunction
() => { setOpenSecondOverlay(!openSecondOverlay); action('on close triggered')(); updateKnob('openSecondOverlay', !openSecondOverlay); }
SaniyaGupta/design-system
core/components/molecules/fullscreenModal/__stories__/Layering.story.tsx
TypeScript
ArrowFunction
() => { setOpen(true); updateKnob('open', !open); }
SaniyaGupta/design-system
core/components/molecules/fullscreenModal/__stories__/Layering.story.tsx
TypeScript
ArrowFunction
() => { setOpenSecondOverlay(true); updateKnob('openSecondOverlay', true); }
SaniyaGupta/design-system
core/components/molecules/fullscreenModal/__stories__/Layering.story.tsx
TypeScript
ArrowFunction
() => { return ( <> <p>mode="month"</p> <DatePicker placeholder="Please select" mode="month" /> <p>mode="year"</p> <DatePicker placeholder="Please select" mode="year" /> </>
zhuangTianYu/fog-design
src/components/date-picker/demo/demo-4.tsx
TypeScript
ArrowFunction
type => Facilities
Kuunika/mhfr-backend
src/common/entities/facility_types.entity.ts
TypeScript
ArrowFunction
facilities => facilities.facility_type
Kuunika/mhfr-backend
src/common/entities/facility_types.entity.ts
TypeScript
ClassDeclaration
@Entity() export class Facility_Types { @PrimaryGeneratedColumn() id: number; @Column() facility_type: string; @Column({type: 'text'}) description: string; @CreateDateColumn({type: 'timestamp'}) created_at: Date; @UpdateDateColumn({type: 'timestamp'}) updated_at: Date; @OneToMany(type => Facilities, facilities => facilities.facility_type) facility: Facilities[]; }
Kuunika/mhfr-backend
src/common/entities/facility_types.entity.ts
TypeScript
ClassDeclaration
export class HelmReleaseMenu extends React.Component<Props> { @autobind() remove() { return releaseStore.remove(this.props.release); } @autobind() upgrade() { const { release, hideDetails } = this.props; createUpgradeChartTab(release); hideDetails && hideDetails(); } @autobind() rollback() { ReleaseRollbackDialog.open(this.props.release); } renderContent() { const { release, toolbar } = this.props; if (!release) return; const hasRollback = release && release.getRevision() > 1; return ( <> {hasRollback && ( <MenuItem onClick={this.rollback}> <Icon material="history" interactive={toolbar} title={_i18n._(t`Rollback`)}/> <span className="title"><Trans>Rollback</Trans></span> </MenuItem> )}
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
InterfaceDeclaration
interface Props extends MenuActionsProps { release: HelmRelease; hideDetails?(): void; }
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
MethodDeclaration
@autobind() remove() { return releaseStore.remove(this.props.release); }
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
MethodDeclaration
@autobind() upgrade() { const { release, hideDetails } = this.props; createUpgradeChartTab(release); hideDetails && hideDetails(); }
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
MethodDeclaration
@autobind() rollback() { ReleaseRollbackDialog.open(this.props.release); }
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
MethodDeclaration
renderContent() { const { release, toolbar } = this.props; if (!release) return; const hasRollback = release && release.getRevision() > 1; return ( <> {hasRollback && ( <MenuItem onClick={this.rollback}> <Icon material="history" interactive={toolbar} title={_i18n._(t`Rollback`)}/> <span className="title"><Trans>Rollback</Trans></span> </MenuItem> )}
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
MethodDeclaration
cssNames("HelmReleaseMenu", className)
22dm/lens
src/renderer/components/+apps-releases/release-menu.tsx
TypeScript
FunctionDeclaration
async function getTotalGenerated(opts: Record<string, string>) { const xchain = nonNullable(opts.xchain); const asset = nonNullable(opts.asset); if (xchain !== 'ethereum') throw new Error('only support ethereum currently'); const configPath = nonNullable(opts.config); await bootstrap(configPath); const conn = await getDBConnection(); const bridgeFeeDB = new BridgeFeeDB(conn); const ethAsset = new EthAsset(asset); const bridgeInFee = await bridgeFeeDB.getEthTotalGeneratedBridgeInFee(asset); const humanizeBridgeInFee = ethAsset.getHumanizedDescription(bridgeInFee); console.log('total bridge-in fee:', humanizeBridgeInFee); const bridgeOutFee = await bridgeFeeDB.getEthTotalGeneratedBridgeOutFee(asset); const humanizeBridgeOutFee = ethAsset.getHumanizedDescription(bridgeOutFee); console.log('total bridge-out fee:', humanizeBridgeOutFee); const bridgeFee = await bridgeFeeDB.getEthTotalGeneratedBridgeFee(asset); const humanizeBridgtFee = ethAsset.getHumanizedDescription(bridgeFee); console.log('total bridge fee:', humanizeBridgtFee); }
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
FunctionDeclaration
async function getTotalWithdrawed(opts: Record<string, string>) { const xchain = nonNullable(opts.xchain); const asset = nonNullable(opts.asset); if (xchain !== 'ethereum') throw new Error('only support ethereum currently'); const configPath = nonNullable(opts.config); await bootstrap(configPath); const conn = await getDBConnection(); const bridgeFeeDB = new BridgeFeeDB(conn); const ethAsset = new EthAsset(asset); const withdrawedBridgeFee = await bridgeFeeDB.getEthTotalWithdrawedBridgeFee(asset); const humanizedWithdrawedBridgeFee = ethAsset.getHumanizedDescription(withdrawedBridgeFee); console.log('total withdrawed bridge fee:', humanizedWithdrawedBridgeFee); }
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
FunctionDeclaration
async function getTotalAvailable(opts: Record<string, string>) { const xchain = nonNullable(opts.xchain); const asset = nonNullable(opts.asset); if (xchain !== 'ethereum') throw new Error('only support ethereum currently'); const configPath = nonNullable(opts.config); await bootstrap(configPath); const conn = await getDBConnection(); const bridgeFeeDB = new BridgeFeeDB(conn); const ethAsset = new EthAsset(asset); const withdrawedBridgeFee = await bridgeFeeDB.getEthTotalWithdrawedBridgeFee(asset); const generatedBridgeFee = await bridgeFeeDB.getEthTotalGeneratedBridgeFee(asset); const availableBridgeFee = new Amount(generatedBridgeFee, 0).sub(new Amount(withdrawedBridgeFee, 0)).toString(0); const humanizedAvailableBridgeFee = ethAsset.getHumanizedDescription(availableBridgeFee); console.log('total available bridge fee:', humanizedAvailableBridgeFee); }
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
FunctionDeclaration
async function generateWithdrawTxSignature(opts: Record<string, string | string[]>) { const xchain = nonNullable(opts.xchain) as string; if (xchain !== 'ethereum') throw new Error('only support ethereum currently'); const asset = nonNullable(opts.asset) as string; const ethAsset = new EthAsset(asset); const recipient = nonNullable(opts.recipient) as string[]; const amount = nonNullable(opts.amount) as string[]; if (recipient.length !== amount.length) throw new Error('recipient number should equal amount number'); const configPath = nonNullable(opts.config) as string; await bootstrap(configPath); const withdrawRecords = recipient.map((r, i) => { return { ckbTxHash: WithdrawBridgeFeeTopic, token: asset, amount: BigNumber.from(ethAsset.parseAmount(amount[i])), recipient: r, }; }); const ethChain = new EthChain('verifier'); const message = await ethChain.getUnlockMessageToSign(withdrawRecords); const privKeyPath = ForceBridgeCore.config.eth.privateKey; const privKey = parsePrivateKey(privKeyPath); const { v, r, s } = ecsign(Buffer.from(message.slice(2), 'hex'), Buffer.from(privKey.slice(2), 'hex')); console.log(`signature of withdraw tx: ${toRpcSig(v, r, s)}`); }
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
FunctionDeclaration
async function sendWithdrawTx(opts: Record<string, string | string[] | boolean>) { const xchain = nonNullable(opts.xchain) as string; if (xchain !== 'ethereum') throw new Error('only support ethereum currently'); const asset = nonNullable(opts.asset) as string; const ethAsset = new EthAsset(asset); const recipient = nonNullable(opts.recipient) as string[]; const amount = nonNullable(opts.amount) as string[]; const signature = nonNullable(opts.signature) as string[]; if (recipient.length !== amount.length) throw new Error('recipient number should equal amount number'); const configPath = nonNullable(opts.config) as string; await bootstrap(configPath); ForceBridgeCore.config.eth.privateKey = parsePrivateKey(ForceBridgeCore.config.eth.privateKey); const withdrawRecords = recipient.map((r, i) => { return { ckbTxHash: WithdrawBridgeFeeTopic, token: asset, amount: BigNumber.from(ethAsset.parseAmount(amount[i])), recipient: r, }; }); const ethChain = new EthChain('collector'); const parsedSigs = signature.map((s) => s.slice(2)); const txRes = await ethChain.sendWithdrawBridgeFeeTx(withdrawRecords, parsedSigs); if (opts.wait as boolean) { const receipt = await txRes.wait(); if (receipt.status == 1) { console.log(`send withdraw tx sucess, tx hash: ${txRes.hash}`); } else { console.log(`send withdraw tx failed, tx receipt: ${receipt}`); } } else { console.log(`withdraw tx was sent, tx hash: ${txRes.hash}`); } }
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
ArrowFunction
(r, i) => { return { ckbTxHash: WithdrawBridgeFeeTopic, token: asset, amount: BigNumber.from(ethAsset.parseAmount(amount[i])), recipient: r, }; }
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
ArrowFunction
(s) => s.slice(2)
homura/force-bridge
offchain-modules/packages/app-cli/src/bridgeFee.ts
TypeScript
ArrowFunction
() => { const args = ['test']; let context: RedisContext; beforeEach(() => { context = new RedisContext(args as [string]); }); describe('getChannel', () => { it('should return original channel', () => { expect(context.getChannel()).to.be.eql(args[0]); }); }); }
10088/nest
packages/microservices/test/ctx-host/redis.context.spec.ts
TypeScript
ArrowFunction
() => { context = new RedisContext(args as [string]); }
10088/nest
packages/microservices/test/ctx-host/redis.context.spec.ts
TypeScript
ArrowFunction
() => { it('should return original channel', () => { expect(context.getChannel()).to.be.eql(args[0]); }); }
10088/nest
packages/microservices/test/ctx-host/redis.context.spec.ts
TypeScript
ArrowFunction
() => { expect(context.getChannel()).to.be.eql(args[0]); }
10088/nest
packages/microservices/test/ctx-host/redis.context.spec.ts
TypeScript
ClassDeclaration
/** * <p>Creates an assessment template for the assessment target that is specified by the ARN * of the assessment target. If the <a href="https://docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html">service-linked role</a> isn’t already registered, this action also creates and * registers a service-linked role to grant Amazon Inspector access to AWS Services needed to * perform security assessments.</p> * @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { InspectorClient, CreateAssessmentTemplateCommand } from "../../client-inspector/mod.ts"; * // const { InspectorClient, CreateAssessmentTemplateCommand } = require("@aws-sdk/client-inspector"); // CommonJS import * const client = new InspectorClient(config); * const command = new CreateAssessmentTemplateCommand(input); * const response = await client.send(command); * ``` * * @see {@link CreateAssessmentTemplateCommandInput} for command's `input` shape. * @see {@link CreateAssessmentTemplateCommandOutput} for command's `response` shape. * @see {@link InspectorClientResolvedConfig | config} for command's `input` shape. * */ export class CreateAssessmentTemplateCommand extends $Command< CreateAssessmentTemplateCommandInput, CreateAssessmentTemplateCommandOutput, InspectorClientResolvedConfig > { // Start section: command_properties // End section: command_properties constructor(readonly input: CreateAssessmentTemplateCommandInput) { // Start section: command_constructor super(); // End section: command_constructor } /** * @internal */ resolveMiddleware( clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: InspectorClientResolvedConfig, options?: __HttpHandlerOptions ): Handler<CreateAssessmentTemplateCommandInput, CreateAssessmentTemplateCommandOutput> { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "InspectorClient"; const commandName = "CreateAssessmentTemplateCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: CreateAssessmentTemplateRequest.filterSensitiveLog, outputFilterSensitiveLog: CreateAssessmentTemplateResponse.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); } private serialize(input: CreateAssessmentTemplateCommandInput, context: __SerdeContext): Promise<__HttpRequest> { return serializeAws_json1_1CreateAssessmentTemplateCommand(input, context); } private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateAssessmentTemplateCommandOutput> { return deserializeAws_json1_1CreateAssessmentTemplateCommand(output, context); } // Start section: command_body_extra // End section: command_body_extra }
Autoskaler/aws-sdk-js-v3
deno/client-inspector/commands/CreateAssessmentTemplateCommand.ts
TypeScript
InterfaceDeclaration
export interface CreateAssessmentTemplateCommandInput extends CreateAssessmentTemplateRequest {}
Autoskaler/aws-sdk-js-v3
deno/client-inspector/commands/CreateAssessmentTemplateCommand.ts
TypeScript
InterfaceDeclaration
export interface CreateAssessmentTemplateCommandOutput extends CreateAssessmentTemplateResponse, __MetadataBearer {}
Autoskaler/aws-sdk-js-v3
deno/client-inspector/commands/CreateAssessmentTemplateCommand.ts
TypeScript
MethodDeclaration
/** * @internal */ resolveMiddleware( clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: InspectorClientResolvedConfig, options?: __HttpHandlerOptions ): Handler<CreateAssessmentTemplateCommandInput, CreateAssessmentTemplateCommandOutput> { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "InspectorClient"; const commandName = "CreateAssessmentTemplateCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: CreateAssessmentTemplateRequest.filterSensitiveLog, outputFilterSensitiveLog: CreateAssessmentTemplateResponse.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); }
Autoskaler/aws-sdk-js-v3
deno/client-inspector/commands/CreateAssessmentTemplateCommand.ts
TypeScript
MethodDeclaration
private serialize(input: CreateAssessmentTemplateCommandInput, context: __SerdeContext): Promise<__HttpRequest> { return serializeAws_json1_1CreateAssessmentTemplateCommand(input, context); }
Autoskaler/aws-sdk-js-v3
deno/client-inspector/commands/CreateAssessmentTemplateCommand.ts
TypeScript
MethodDeclaration
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateAssessmentTemplateCommandOutput> { return deserializeAws_json1_1CreateAssessmentTemplateCommand(output, context); }
Autoskaler/aws-sdk-js-v3
deno/client-inspector/commands/CreateAssessmentTemplateCommand.ts
TypeScript
ClassDeclaration
// Copyright (c) Wictor Wilén. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. /** * Configuration options for the generator */ export class GeneratorTeamsAppOptions { id: string; title: string; description: string; solutionName: string; packageName: string; name: string; shouldUseSubDir: boolean; libraryName: string; 'skip-install': string; telemetry: boolean; namespace: string; developer: string; host: string; hostname: string; bot: boolean; mpnId?: string = undefined; updateBuildSystem: boolean = false; showLoadingIndicator: boolean = false; isFullScreen: boolean = false; reactComponents: boolean; websitePrefix: string; unitTestsEnabled: boolean; manifestVersion: string; updateManifestVersion: boolean = false; // Set to true when asked to update manifest useAzureAppInsights: boolean = false; azureAppInsightsKey?: string = undefined; /* Tabs */ tab: boolean; tabTitle: string; tabName: string; tabUpperName: string; tabReactComponentName: string; tabSharePoint: boolean; tabSharePointHosts: string[] = []; tabScopes: string[]; tabType: "configurable" | "static"; tabSSO: boolean; tabSSOAppId: string; tabSSOAppUri: string; /* Bots */ botid: string = ''; botidEnv: string = "MICROSOFT_APP_ID"; botidEnvSecret: string = "MICROSOFT_APP_PASSWORD"; staticTab: boolean = false; staticTabName: string; staticTabTitle: string; staticTabClassName: string; botType: string = ""; botTitle: string; botName: string; botClassName: string; botCallingEnabled: boolean = false; botFilesEnabled: boolean = false; /* Outgoing webhook */ customBot: boolean; customBotTitle: string; customBotName: string; customBotClassName: string; /* Connector */ connector: boolean; connectorId?: string = undefined; connectorType: string = ''; connectorTitle: string; connectorName: string; connectorComponentName: string; /* Message extensions */ messageExtension: boolean; messageExtensionHost: string = ''; messageExtensionTitle: string; messageExtensionDescription: string; messageExtensionName: string; messageExtensionId: string; messageExtensionClassName: string; messagingExtensionBot: boolean; // indicates that we need to add a bot to host the messaging extension messagingExtensionType: string = "query"; messagingExtensionActionContext?: string[] = undefined; messagingExtensionActionInputType: string | undefined = undefined; messagingExtensionActionResponseType?: string; messagingExtensionCanUpdateConfiguration: boolean = false; messagingExtensionActionResponseTypeConfig: boolean = false; /* manifest */ existingManifest: any; /* Localization */ localization: boolean; defaultLanguage: string | undefined; additionalLanguage: string | undefined; }
felipeplets/generator-teams
src/app/GeneratorTeamsAppOptions.ts
TypeScript
FunctionDeclaration
function normalizeFilename(filename: string) { if (filename.startsWith('/@fs')) { filename = filename.slice('/@fs'.length); } else if (filename.startsWith('/') && !ancestor(filename, config.root.pathname)) { filename = new URL('.' + filename, config.root).pathname; } return filename; }
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript
FunctionDeclaration
function relativeToRoot(pathname: string) { const arg = startsWithForwardSlash(pathname) ? '.' + pathname : pathname; const url = new URL(arg, config.root); return slash(fileURLToPath(url)) + url.search; }
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript
ArrowFunction
(path: string) => path.startsWith(srcRootWeb)
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript
ArrowFunction
(s) => s.stage === 'page'
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript
InterfaceDeclaration
interface AstroPluginOptions { config: AstroConfig; logging: LogOptions; }
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript
MethodDeclaration
configResolved(_resolvedConfig) { resolvedConfig = _resolvedConfig; viteTransform = getViteTransform(resolvedConfig); }
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript
MethodDeclaration
configureServer(server) { viteDevServer = server; }
natemoo-re/astro
packages/astro/src/vite-plugin-astro/index.ts
TypeScript