type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
// Check structure of OCPI Structure
testData.emspService.checkOCPIResponseStructure(response.data);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
let response;
// Check call
it('should access url: /ocpi/cpo/2.1.1', async () => {
// Create
response = await testData.cpoService.getImplementation2_1_1();
// Check status
expect(response.status).to.be.eql(200);
});
// Check Response Object
it('should have corr... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Create
response = await testData.cpoService.getImplementation2_1_1();
// Check status
expect(response.status).to.be.eql(200);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
expect(response.data).to.not.be.empty;
expect(response.data).to.have.property('status_code', 1000);
expect(response.data).to.have.property('status_message', 'Success');
expect(response.data).to.have.property('data').to.be.an('object').that.is.not.empty;
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
expect(response.data.data).to.have.keys('version', 'endpoints');
expect(response.data.data.version, 'Incorrect Version').equal('2.1.1');
expect(response.data.data.endpoints).to.be.an('array').that.is.not.empty;
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
expect(response.data.data.endpoints, 'Invalid Endpoints Object').to.satisfy((endpoints) => {
let validEndpoints = true;
for (const endpoint of endpoints) {
validEndpoints = expect(endpoint).to.have.keys('identifier', 'url') && validEndpoints;
}
return validEndpoi... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
(endpoints) => {
let validEndpoints = true;
for (const endpoint of endpoints) {
validEndpoints = expect(endpoint).to.have.keys('identifier', 'url') && validEndpoints;
}
return validEndpoints;
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
let response;
// Check call
it('should return 501 on url: /ocpi/cpo/2.1.1/invalidEndpoint', async () => {
// Create
response = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/invalidEndpoint');
// Check status
expect(response.status).to.be.eql(501);
});
... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Create
response = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/invalidEndpoint');
// Check status
expect(response.status).to.be.eql(501);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Check structure of OCPI Structure
testData.cpoService.checkOCPIErrorResponseStructure(response.data);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
expect(response.data).to.not.be.empty;
expect(response.data).to.have.property('status_code', 3000);
expect(response.data).to.have.property('status_message', 'Endpoint invalidEndpoint not implemented');
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
let response;
// Check call
it('should return 501 on url: /ocpi/emsp/2.1.1/invalidEndpoint', async () => {
// Create
response = await testData.emspService.accessPath('GET', '/ocpi/emsp/2.1.1/invalidEndpoint');
// Check status
expect(response.status).to.be.eql(501);
});
... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Create
response = await testData.emspService.accessPath('GET', '/ocpi/emsp/2.1.1/invalidEndpoint');
// Check status
expect(response.status).to.be.eql(501);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Check structure of OCPI Structure
testData.emspService.checkOCPIErrorResponseStructure(response.data);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
let response;
/**
* Access without paging
*/
describe('Access without paging', () => {
// Check call
it('should access url: /ocpi/cpo/2.1.1/locations', async () => {
// Get locations
response = await testData.cpoService.getLocations2_1_1();
// Check... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Check call
it('should access url: /ocpi/cpo/2.1.1/locations', async () => {
// Get locations
response = await testData.cpoService.getLocations2_1_1();
// Check status
expect(response.status).to.be.eql(200);
});
// Check Response Object
it('shou... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Get locations
response = await testData.cpoService.getLocations2_1_1();
// Check status
expect(response.status).to.be.eql(200);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Check structure of OCPI Structure
testData.cpoService.checkOCPIResponseStructure(response.data);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
expect(response.data).to.not.be.empty;
expect(response.data).to.have.property('status_code', 1000);
expect(response.data).to.have.property('status_message', 'Success');
expect(response.data).to.have.property('data').to.be.an('array').that.is.not.empty;
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
expect(response.data.data, 'Invalid Location Object').to.satisfy((locations) => {
const validLocationsAndSubEntities = true;
// Loop through location
for (const location of locations) {
// Validate location
testData.cpoService.validateLocationEntity... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
(locations) => {
const validLocationsAndSubEntities = true;
// Loop through location
for (const location of locations) {
// Validate location
testData.cpoService.validateLocationEntity(location);
// ValidLocationsAndSubEntities = validLocationsAndSubEnt... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Check access for each location
it('should access url /ocpi/cpo/2.1.1/locations/ and have headers X-Limit and X-Total-Count', async () => {
// Call
const locationsResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations');
expect(locationsResponse... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Call
const locationsResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations');
expect(locationsResponse.data).to.not.be.empty;
expect(locationsResponse.data).to.have.property('status_code', 1000);
expect(locationsResponse.data).to.have... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Call
const locationsResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/?offset=0&limit=20');
expect(locationsResponse.data).to.not.be.empty;
expect(locationsResponse.data).to.have.property('status_code', 1000);
expect(locationsRes... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Call
const locationsResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/?offset=0&limit=1');
expect(locationsResponse.data).to.not.be.empty;
expect(locationsResponse.data).to.have.property('status_code', 1000);
expect(locationsResp... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
let response;
/**
* Success Cases
*/
describe('Success cases', () => {
// Call once agian the GET Locations
before(async function() {
// Create
response = await testData.cpoService.getLocations2_1_1();
if (response.status !== 200) {
this.skip... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Call once agian the GET Locations
before(async function() {
// Create
response = await testData.cpoService.getLocations2_1_1();
if (response.status !== 200) {
this.skip();
}
});
// Check access for each location
it('should access sing... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
for (const location of response.data.data) {
// Call
const locationResponse = await testData.cpoService.accessPath('GET', `/ocpi/cpo/2.1.1/locations/${location.id}`);
// Check status
expect(locationResponse.status).to.be.eql(200);
expect(testData.... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
for (const location of response.data.data) {
for (const evse of location.evses) {
// Call
const evseResponse = await testData.cpoService.accessPath('GET', `/ocpi/cpo/2.1.1/locations/${location.id}/${evse.uid}`);
// Check status
expect(evse... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
for (const location of response.data.data) {
for (const evse of location.evses) {
for (const connector of evse.connectors) {
// Call
const connectorResponse = await testData.cpoService.accessPath('GET', `/ocpi/cpo/2.1.1/locations/${location.id}/${... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// Invalid location
it('should not find this non-existing location /ocpi/cpo/2.1.1/locations/5abeba9e4bae1457eb565e67', async () => {
// Call
const locationResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/5abeba9e4bae1457eb565e67');
// Check... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Call
const locationResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/5abeba9e4bae1457eb565e67');
// Check status
expect(locationResponse.status).to.be.eql(500);
expect(locationResponse.data).to.have.property('timestamp');
... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Call
const locationResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/5ce249a2372f0b1c8caf9294/NonExistingSite');
// Check status
expect(locationResponse.status).to.be.eql(500);
expect(locationResponse.data).to.have.property('times... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Call
const locationResponse = await testData.cpoService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/5ce249a2372f0b1c8caf9294/cs-15-ut-site-withoutACL/0');
// Check status
expect(locationResponse.status).to.be.eql(500);
expect(locationResponse.data).to.have.prop... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
let response;
/**
* Success Cases
*/
describe('Success cases', () => {
it('Should create a new ocpiEndpoint', async () => {
// Check
expect(testData.newOcpiEndpoint).to.not.be.null;
// Create the entity
testData.newOcpiEndpoint = await testData.centra... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
it('Should create a new ocpiEndpoint', async () => {
// Check
expect(testData.newOcpiEndpoint).to.not.be.null;
// Create the entity
testData.newOcpiEndpoint = await testData.centralUserService.createEntity(
testData.centralUserService.ocpiEndpointApi, Factory.ocp... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Check
expect(testData.newOcpiEndpoint).to.not.be.null;
// Create the entity
testData.newOcpiEndpoint = await testData.centralUserService.createEntity(
testData.centralUserService.ocpiEndpointApi, Factory.ocpiEndpoint.build());
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Change entity
testData.newOcpiEndpoint.localToken = OCPIService.getToken(OCPIRole.CPO);
// Update
await testData.centralUserService.updateEntity(
testData.centralUserService.ocpiEndpointApi, testData.newOcpiEndpoint);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
async () => {
// Delete the created entity
await testData.centralUserService.deleteEntity(
testData.centralUserService.ocpiEndpointApi, testData.newOcpiEndpoint);
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
() => {
// // Invalid location
// it('should not find this non-existing location /ocpi/cpo/2.1.1/locations/5abeba9e4bae1457eb565e67', async () => {
// // Call
// const locationResponse = await testData.ocpiService.accessPath('GET', '/ocpi/cpo/2.1.1/locations/5abeba9e4bae1457eb565e67');
... | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ClassDeclaration |
class TestData {
public pending: any;
public cpoService: OCPIService;
public emspService: OCPIService;
public tenantContext: TenantContext;
public newOcpiEndpoint: any;
public centralUserService: CentralServerService;
public centralUserContext: any;
public userContext: User;
} | nordicenergy/ev-charging-station-management-backend-server | test/api/OCPIServerTest.ts | TypeScript |
ArrowFunction |
(node: ArbolRubros<DatosNodo>) => node.data || null | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ArrowFunction |
(node: ArbolRubros<DatosNodo>) => !!node.children && !!node.children.length ? node.children : [] | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ArrowFunction |
(node: ArbolRubros<DatosNodo>) => !!node.expanded | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ArrowFunction |
([arbol, fuente]) => {
if (Object.keys(arbol).length !== 0) {
if (fuente) {
this.data = this.CargarRubros(fuente, arbol);
} else {
this.data = [arbol[0]];
}
this.dataSource = this.dataSourceBuilder.create(this.data, getters);
} else {
this.parame... | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ArrowFunction |
(rubro: any) => {
if (rubro) {
if (Object.keys(rubro)[0] !== 'type') {
if (rubro !== null) {
this.selectedTreeRow = rubro;
}
}
}
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ArrowFunction |
hijo => hijo.Codigo === Fuente | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'ngx-arbol-rubro',
templateUrl: './arbol-rubro.component.html',
styleUrls: ['./arbol-rubro.component.scss']
})
export class ArbolRubroComponent implements OnInit, OnDestroy, OnChanges {
@Input() FuenteRecurso: any;
selectedTreeRow: any = null;
sortColumn: string = '';
sortDirect... | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
ngOnChanges(changes: SimpleChanges): void {
if (changes.FuenteRecurso) {
this.FuenteRecurso$.next(this.FuenteRecurso);
this.store.dispatch(LoadNodoSeleccionado(null));
}
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
const getters: NbGetters<ArbolRubros<DatosNodo>, ArbolRubros<DatosNodo>> = {
dataGetter: (node: ArbolRubros<DatosNodo>) => node.data || null,
childrenGetter: (node: ArbolRubros<DatosNodo>) => !!node.children && !!node.children.length ? node.children : [],
expandedGetter: (node: Arbol... | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
changeSort(sortRequest: NbSortRequest): void {
this.dataSource.sort(sortRequest);
this.sortColumn = sortRequest.column;
this.sortDirection = sortRequest.direction;
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
getDirection(column: string): NbSortDirection {
if (column === this.sortColumn) {
return this.sortDirection;
}
return NbSortDirection.NONE;
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy(): void {
this.subscription$.unsubscribe();
this.subscription2$.unsubscribe();
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
onSelect(row: any) {
this.store.dispatch(LoadNodoSeleccionado(row));
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
MethodDeclaration |
CargarRubros(Fuente: any, Arbol: any) {
// console.log(Arbol[0]);
const ArbolFuenteRecurso = Arbol[0].children.find(
hijo => hijo.Codigo === Fuente
);
return [ArbolFuenteRecurso];
} | udistrital/central_cuentas_cliente | src/app/shared/components/arbol-rubro/arbol-rubro.component.ts | TypeScript |
ArrowFunction |
(abort: () => never): Promise<Buffer> => {
const { stdin } = process
const ret: any[] = []
let len = 0
return new Promise(resolve => {
if (stdin.isTTY) {
abort()
}
stdin.on('readable', () => {
let chunk
while ((chunk = stdin.read())) {
ret.push(chunk)
len += chu... | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
resolve => {
if (stdin.isTTY) {
abort()
}
stdin.on('readable', () => {
let chunk
while ((chunk = stdin.read())) {
ret.push(chunk)
len += chunk.length
}
})
stdin.on('end', () => {
resolve(Buffer.concat(ret, len))
})
} | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
() => {
let chunk
while ((chunk = stdin.read())) {
ret.push(chunk)
len += chunk.length
}
} | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
() => {
resolve(Buffer.concat(ret, len))
} | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
(options: Options) => {
const { verbose, api, abort, file } = options
const dagApi = DagApi.of(api)
const bufferP = file === undefined ? stdinToBuffer(abort) : Promise.resolve(fs.readFileSync(file))
bufferP
.then(buffer => {
const text = buffer.toString('utf8')
const json = JSON.parse(text)
... | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
buffer => {
const text = buffer.toString('utf8')
const json = JSON.parse(text)
if (!Array.isArray(json)) {
console.log('must be array!')
process.exit(2)
}
const columns = ColumnMap.of(json)
return compressAndStore(dagApi.put)(columns).then(result => {
if (... | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
result => {
if (verbose > 0) {
console.log('Input size ', buffer.length)
console.log('Compressed size ', result.stats.size)
console.log('Ratio ', (buffer.length / result.stats.size).toFixed(2))
console.log('IPFS dag objects', result.stats.blocks)
}... | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
ArrowFunction |
error => {
console.error('', error)
process.exit(4)
} | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
TypeAliasDeclaration |
type Options = Readonly<{
api: string | undefined
verbose: number
file: string | undefined
abort: () => never
}> | rklaehn/iptm | packages/iptm-cli/src/compress.ts | TypeScript |
InterfaceDeclaration |
export interface UserLogin extends mongoose.Document{
username: string
password: string;
} | AlexisDevMaster/NWT-Projet-Back | src/users-pass/user.interface.ts | TypeScript |
ArrowFunction |
<RT extends ResolverRelation<unknown> | ResolverRelationReference<unknown, unknown>>(
relationOptions: RelationTypeMap<RT>,
): RT[] => Object.keys(relationOptions).map((name) => ({ dtoName: name, ...relationOptions[name] })) | Flusinerd/nestjs-query | packages/query-graphql/src/resolvers/relations/helpers.ts | TypeScript |
ArrowFunction |
(name) => ({ dtoName: name, ...relationOptions[name] }) | Flusinerd/nestjs-query | packages/query-graphql/src/resolvers/relations/helpers.ts | TypeScript |
ArrowFunction |
<Relation>(
opts: ResolverRelation<Relation> | ResolverRelationReference<unknown, Relation>,
): ResolverMethodOpts =>
omit(opts, 'DTO', 'keys', 'nullable', 'dtoName', 'relationName', 'disableRead', 'disableUpdate', 'disableRemove') | Flusinerd/nestjs-query | packages/query-graphql/src/resolvers/relations/helpers.ts | TypeScript |
ArrowFunction |
(url: string) => fetch(url).then((res) => res.json()) | nalarkin/web-dev-project | src/pages/secrets/index.tsx | TypeScript |
ArrowFunction |
(res) => res.json() | nalarkin/web-dev-project | src/pages/secrets/index.tsx | TypeScript |
ArrowFunction |
() => {
const { data, error } = useSWR('/api/secrets', fetcher);
if (error) return <Spinner />;
if (!data) return <Spinner />;
return (
<ProductGallary title="Secret Sales" products={data} isSecret={true} /> | nalarkin/web-dev-project | src/pages/secrets/index.tsx | TypeScript |
ArrowFunction |
() => {
return (
<div>
<h1 className="font-bold text-2xl md:text-3xl text-gray-900 mb-6 mt-6 text-center">
You must be logged in to view this content
</h1>
<LoginForm />
</div> | nalarkin/web-dev-project | src/pages/secrets/index.tsx | TypeScript |
ArrowFunction |
() => {
const { isLoggedIn } = useAuth();
return <div>{isLoggedIn ? <ProtectedContent /> : <LoginRequest />}</div>;
} | nalarkin/web-dev-project | src/pages/secrets/index.tsx | TypeScript |
MethodDeclaration |
isLoggedIn ? <ProtectedContent | nalarkin/web-dev-project | src/pages/secrets/index.tsx | TypeScript |
FunctionDeclaration |
export function BlankState(props: BlankStateProps): JSX.Element {
const { loading, mainText, details, href } = props;
if (loading) {
return (
<div className="empty">
<Spinner />
</div>
);
}
return (
<div className="empty">
{mainText}
{href ? (
<a target="bl... | theholla/BikeRides4U | client/src/components/BlankState.tsx | TypeScript |
TypeAliasDeclaration |
type BlankStateProps = {
loading: boolean;
mainText: string;
details?: string;
href?: string;
}; | theholla/BikeRides4U | client/src/components/BlankState.tsx | TypeScript |
ArrowFunction |
() => {
let mockI18nService: any;
beforeEach(() => {
mockI18nService = {
translate: jasmine.createSpy('translate'),
};
});
it('seconds ago', () => {
const pipe = new TimeAgoPipe(mockI18nService);
pipe.transform('2020-02-04T16:15:10.100Z', '2020-02-04T16:15:... | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
mockI18nService = {
translate: jasmine.createSpy('translate'),
};
} | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new TimeAgoPipe(mockI18nService);
pipe.transform('2020-02-04T16:15:10.100Z', '2020-02-04T16:15:10.500Z');
expect(mockI18nService.translate.calls.argsFor(0)).toEqual(['datetime.ago-seconds', { count: 0 }]);
pipe.transform('2020-02-04T16:15:07.500Z', '2020-02-04T16:... | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new TimeAgoPipe(mockI18nService);
pipe.transform('2020-02-04T16:13:10.500Z', '2020-02-04T16:15:10.500Z');
expect(mockI18nService.translate.calls.argsFor(0)).toEqual(
['datetime.ago-minutes', { count: 2 }],
'a',
);
pipe.transform('20... | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new TimeAgoPipe(mockI18nService);
pipe.transform('2020-02-04T14:15:10.500Z', '2020-02-04T16:15:10.500Z');
expect(mockI18nService.translate.calls.argsFor(0)).toEqual(['datetime.ago-hours', { count: 2 }]);
pipe.transform('2020-02-04T02:15:07.500Z', '2020-02-04T16:15... | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new TimeAgoPipe(mockI18nService);
pipe.transform('2020-02-03T16:15:10.500Z', '2020-02-04T16:15:10.500Z');
expect(mockI18nService.translate.calls.argsFor(0)).toEqual(['datetime.ago-days', { count: 1 }]);
pipe.transform('2020-02-01T02:15:07.500Z', '2020-02-04T16:15:... | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new TimeAgoPipe(mockI18nService);
pipe.transform('2019-02-04T12:00:00.000Z', '2020-02-04T12:00:00.000Z');
expect(mockI18nService.translate.calls.argsFor(0)).toEqual(['datetime.ago-years', { count: 1 }]);
pipe.transform('2018-02-04T12:00:01.000Z', '2020-02-04T12:00... | AneBLucena/vendure | packages/admin-ui/src/lib/core/src/shared/pipes/time-ago.pipe.spec.ts | TypeScript |
ClassDeclaration |
class ListAdminitratorsController{
async handle(request: Request, response: Response){
const listAdministratosService = new ListAdministratosService();
const administrators = await listAdministratosService.execute();
return response.json(administrators);
}
} | CaiquePatelliScapeline/No-Garbage | API/src/controllers/ListAdministratorController.ts | TypeScript |
MethodDeclaration |
async handle(request: Request, response: Response){
const listAdministratosService = new ListAdministratosService();
const administrators = await listAdministratosService.execute();
return response.json(administrators);
} | CaiquePatelliScapeline/No-Garbage | API/src/controllers/ListAdministratorController.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'fdp-platform-action-bar-cozy-mode-example',
templateUrl: './platform-action-bar-cozy-mode-example.component.html',
styleUrls: ['./platform-action-bar-cozy-mode-example.component.scss']
})
export class PlatformActionBarCozyModeExampleComponent {
onBackBuutonClick() {
ale... | chrisdavisp/fundamental-ngx | apps/docs/src/app/platform/component-docs/platform-action-bar/platform-action-bar-examples/platform-action-bar-cozy-mode-example.component.ts | TypeScript |
MethodDeclaration |
onBackBuutonClick() {
alert('Back button clicked');
} | chrisdavisp/fundamental-ngx | apps/docs/src/app/platform/component-docs/platform-action-bar/platform-action-bar-examples/platform-action-bar-cozy-mode-example.component.ts | TypeScript |
ClassDeclaration |
declare class Observable<T> {
constructor(subscriber: ZenObservable.Subscriber<T>);
subscribe(observer: ZenObservable.Observer<T>): ZenObservable.Subscription;
subscribe(
onNext: (value: T) => void,
onError?: (error: any) => void,
onComplete?: () => void,
): ZenObservable.Subsc... | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
InterfaceDeclaration |
interface SymbolConstructor {
readonly observable: symbol;
} | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
InterfaceDeclaration |
interface SubscriptionObserver<T> {
closed: boolean;
next(value: T): void;
error(errorValue: any): void;
complete(): void;
} | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
InterfaceDeclaration |
interface Subscription {
closed: boolean;
unsubscribe(): void;
} | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
InterfaceDeclaration |
interface Observer<T> {
start?(subscription: Subscription): any;
next?(value: T): void;
error?(errorValue: any): void;
complete?(): void;
} | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
InterfaceDeclaration |
interface ObservableLike<T> {
subscribe?: Subscriber<T>;
[Symbol.observable](): Observable<T> | ObservableLike<T>;
} | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
TypeAliasDeclaration |
type Subscriber<T> = (observer: SubscriptionObserver<T>) => void | (() => void) | Subscription; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
MethodDeclaration |
subscribe(observer: ZenObservable.Observer<T>): ZenObservable.Subscription; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
MethodDeclaration |
subscribe(
onNext: (value: T) => void,
onError?: (error: any) => void,
onComplete?: () => void,
): ZenObservable.Subscription; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
MethodDeclaration |
[Symbol.observable](): Observable<T>; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
MethodDeclaration |
forEach(callback: (value: T) => void): Promise<void>; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
MethodDeclaration |
map<R>(callback: (value: T) => R): Observable<R>; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
MethodDeclaration |
filter<S extends T>(callback: (value: T) => value is S): Observable<S>; | 1000ch/DefinitelyTyped | types/zen-observable/index.d.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.