type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ClassDeclaration |
class ConstantPeerSource implements PeerSource {
peers: Map<Endpoint, PeerInfo>;
constructor(peers: IterableIterator<PeerInfo>) {
this.peers = new Map(Array.from(peers).map((pi: PeerInfo) => [pi.endpoint, pi]));
}
async getPeers(count: number): Promise<PeerInfo[]> {
let peers = Array... | hyperhyperspace/hhs-lib-ts | src/mesh/agents/peer/sources/ConstantPeerSource.ts | TypeScript |
MethodDeclaration |
async getPeers(count: number): Promise<PeerInfo[]> {
let peers = Array.from(this.peers.values());
Shuffle.array(peers);
if (peers.length > count) {
peers = peers.slice(0, count);
}
return peers;
} | hyperhyperspace/hhs-lib-ts | src/mesh/agents/peer/sources/ConstantPeerSource.ts | TypeScript |
MethodDeclaration |
async getPeerForEndpoint(endpoint: string): Promise<PeerInfo | undefined> {
return this.peers.get(endpoint);
} | hyperhyperspace/hhs-lib-ts | src/mesh/agents/peer/sources/ConstantPeerSource.ts | TypeScript |
FunctionDeclaration |
function _testIOSSpecificKnownFolder(knownFolderName: string) {
let knownFolder: fs.Folder;
let createdFile: fs.File;
let testFunc = function testFunc() {
knownFolder = fs.knownFolders.ios[knownFolderName]();
if (knownFolder) {
createdFile = knownFolder.getFile('createdFile');
createdFile.writeTextSync('s... | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
FunctionDeclaration |
export function testKnownFolderRemove(done) {
var result;
var knownFolder = fs.knownFolders.temp();
knownFolder.remove().then(
function () {
done(new Error('Remove known folder should resolve as error.'));
},
function (error) {
done(null);
}
);
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
FunctionDeclaration |
export function test_FSEntity_Properties() {
var documents = fs.knownFolders.documents();
var file = documents.getFile('Test_File.txt');
TKUnit.assert(file.extension === '.txt', 'FileEntity.extension not working.');
TKUnit.assert(file.isLocked === false, 'FileEntity.isLocked not working.');
TKUnit.assert(file.la... | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
FunctionDeclaration |
export function test_FileSize(done) {
var file = fs.knownFolders.documents().getFile('Test_File_Size.txt');
file
.writeText('Hello World!')
.then(() => {
TKUnit.assert(file.size === 'Hello World!'.length);
return file.remove();
})
.then(() => done())
.catch(done);
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
FunctionDeclaration |
export function test_UnlockAfterWrite(done) {
var file = fs.knownFolders.documents().getFile('Test_File_Lock.txt');
file
.writeText('Hello World!')
.then(() => {
return file.readText();
})
.then((value) => {
TKUnit.assert(value === 'Hello World!');
return file.remove();
})
.then(() => done())
... | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
FunctionDeclaration |
export function test_CreateParentOnNewFile(done) {
var documentsFolderName = fs.knownFolders.documents().path;
var tempFileName = fs.path.join(documentsFolderName, 'folder1', 'folder2', 'Test_File_Create_Parent.txt');
var file = fs.File.fromPath(tempFileName);
file
.writeText('Hello World!')
.then(() => {
r... | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
FunctionDeclaration |
export function test_FolderClear_RemovesEmptySubfolders(done) {
let documents = fs.knownFolders.documents();
let rootFolder = documents.getFolder('rootFolder');
let emptySubfolder = rootFolder.getFolder('emptySubfolder');
TKUnit.assertTrue(fs.Folder.exists(emptySubfolder.path), 'emptySubfolder should exist before ... | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ArrowFunction |
(e) => {
error = e;
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ArrowFunction |
() => {
TKUnit.assert(file.size === 'Hello World!'.length);
return file.remove();
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ArrowFunction |
() => {
return file.readText();
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ArrowFunction |
(value) => {
TKUnit.assert(value === 'Hello World!');
return file.remove();
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ArrowFunction |
() => {
return fs.knownFolders.documents().getFolder('folder1').remove();
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ArrowFunction |
() => {
TKUnit.assertFalse(fs.File.exists(emptySubfolder.path), 'emptySubfolder should not exist after parent folder was cleared.');
rootFolder.remove();
done();
} | Adarshjaiss/NativeScript | apps/automated/src/file-system/file-system-tests.ts | TypeScript |
ClassDeclaration | /**
* @description RegisterGlobalConstantOperation provides utility functions to fetch a newly issued operation of kind register_global_constant
*/
export declare class RegisterGlobalConstantOperation extends Operation implements GasConsumingOperation, StorageConsumingOperation, FeeConsumingOperation {
private... | PiXLtez/PiXL-Public | node_modules/@taquito/taquito/dist/types/operations/register-global-constant-operation.d.ts | TypeScript |
ArrowFunction |
({ theme }: ThemeProps<BinuiTheme>) => theme.spacing(1) | leesangb/binui | src/components/paginated-list/PaginatedList.tsx | TypeScript |
ArrowFunction |
<T extends object>
({ render, items, getKey, page = 1, pageSize = 7 }: PaginatedListProps<T>) => {
return (
<>
<OrderedList>
{
items.slice((page - 1) * pageSize, page * pageSize)
.map(item => (
<li key={getK... | leesangb/binui | src/components/paginated-list/PaginatedList.tsx | TypeScript |
ArrowFunction |
item => (
<li key={getKey(item)}>
{render(item)}
</li> | leesangb/binui | src/components/paginated-list/PaginatedList.tsx | TypeScript |
InterfaceDeclaration |
export interface PaginatedListProps<T extends object> {
render: (item: T) => ReactElement;
items: T[];
/** 1 based current page */
page: number;
pageSize: number;
getKey: (item: T) => string;
} | leesangb/binui | src/components/paginated-list/PaginatedList.tsx | TypeScript |
MethodDeclaration |
getKey(item) | leesangb/binui | src/components/paginated-list/PaginatedList.tsx | TypeScript |
MethodDeclaration |
render(item) | leesangb/binui | src/components/paginated-list/PaginatedList.tsx | TypeScript |
ClassDeclaration |
export class Stack<TSource> extends ArrayEnumerable<TSource> implements ICollection<TSource> {
public constructor();
public constructor(collection: Iterable<TSource>);
public constructor(collection?: Iterable<TSource>) {
const src = collection ? [...collection] : [];
super(new EnumerableFactory(), getI... | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public clear(): void {
this.srcArr.length = 0;
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public copyTo(array: TSource[]): void; | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public copyTo(array: TSource[], arrayIndex: number): void; | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public copyTo(array: TSource[], arrayIndex?: number): void {
const startArrayIndex = arrayIndex ?? 0;
for (let i = 0, j = startArrayIndex; i < this.srcArr.length; i++, j++) {
array[j] = this.srcArr[i];
}
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public peek(): TSource {
const item = this.tryPeek();
if (item === null) {
throw new Error('Stack is empty.');
}
return item;
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public pop(): TSource {
const item = this.tryPop();
if (item === null) {
throw new Error('Stack is empty.');
}
return item;
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public push(item: TSource): void {
this.srcArr.push(item);
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public tryPeek(): TSource | null {
if (this.srcArr.length === 0) {
return null;
}
return this.srcArr[this.srcArr.length - 1];
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
MethodDeclaration |
public tryPop(): TSource | null {
return this.srcArr.pop() ?? null;
} | jieny/typescript-extended-linq | src/collections/Stack.ts | TypeScript |
ArrowFunction |
listTitle => listTitle | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
ArrowFunction |
(event) => {
this.sidebarClose();
var $layer: any = document.getElementsByClassName('close-layer')[0];
if ($layer) {
$layer.remove();
this.mobile_menu_visible = 0;
}
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
ArrowFunction |
data => {} | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {
private listTitles: any[];
location: Location;
mobile_menu_visible: any = 0;
private toggleButton: any;
private sidebarVisib... | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration |
ngOnInit(){
this.listTitles = ROUTES.filter(listTitle => listTitle);
const navbar: HTMLElement = this.element.nativeElement;
this.toggleButton = navbar.getElementsByClassName('navbar-toggler')[0];
this.router.events.subscribe((event) => {
this.sidebarClose();
var $layer: any = ... | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration |
sidebarOpen() {
const toggleButton = this.toggleButton;
const body = document.getElementsByTagName('body')[0];
setTimeout(function(){
toggleButton.classList.add('toggled');
}, 500);
body.classList.add('nav-open');
this.sidebarVisible = true;
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration |
sidebarClose() {
const body = document.getElementsByTagName('body')[0];
this.toggleButton.classList.remove('toggled');
this.sidebarVisible = false;
body.classList.remove('nav-open');
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration |
sidebarToggle() {
const toggleButton = this.toggleButton;
// const body = document.getElementsByTagName('body')[0];
var $toggle = document.getElementsByClassName('navbar-toggler')[0];
if (this.sidebarVisible === false) {
this.sidebarOpen();
} else {
this... | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration |
getTitle(){
var titlee = this.location.prepareExternalUrl(this.location.path());
if(titlee.charAt(0) === '#'){
titlee = titlee.slice( 1 );
}
for(var item = 0; item < this.listTitles.length; item++){
if(this.listTitles[item].path === titlee){
return this.listTi... | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration | // getUserbyid(id: string) {
// this.service.getPidmByUsuario(id).subscribe(
// data => {
// if (data) {
// this.usuarioData = data;
// this.id = this.usuarioData[0].id;
// this.user = this.usuarioData[0].id;
// id=this.user;
// ... | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
MethodDeclaration |
logout() {
localStorage.removeItem('param');
this.authService.logout();
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/navbar/navbar.component_20200508100441.ts | TypeScript |
ArrowFunction |
(users: any[], email: string, username: string) => {
for (let i = 0; i < users.length; i++) {
if (users[i].account === email) {
for (let j = 0; j < users[i].accountDetails.length; j++) {
if (users[i].accountDetails[j].username === username) {
return users[i... | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
ArrowFunction |
() => {
const users = useAppSelector((state) => state.user.users);
const email = useAppSelector((state) => state.user.email);
const username = useAppSelector((state) => state.user.username);
const watchList = findUserWatchList(users, email, username)
return (
<div >
<Banner />... | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
ArrowFunction |
(state) => state.user.users | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
ArrowFunction |
(state) => state.user.email | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
ArrowFunction |
(state) => state.user.username | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
ArrowFunction |
(details: any, index: number) =>
<SingleContent key | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
MethodDeclaration |
translate("myList") | shandia57/react-netflix-clone-course | src/pages/watchList/WatchList.tsx | TypeScript |
ArrowFunction |
(props) => {
return (
<div>{props.children}</div>
);
} | fossapps/Feature.Manager.Ui | src/app/containers/LoadingState.tsx | TypeScript |
ClassDeclaration |
@Controller('discounts')
export class DiscountsController {
constructor(private readonly discountsService: DiscountsService) {}
@Post()
create(@Body() createDiscountDto: CreateDiscountDto) {
return this.discountsService.create(createDiscountDto);
}
@Get()
findAll(@Query() filter) {
return this.di... | JohnDoeAntler/nestjs-mongoose-jwt-example | src/discounts/discounts.controller.ts | TypeScript |
MethodDeclaration |
@Post()
create(@Body() createDiscountDto: CreateDiscountDto) {
return this.discountsService.create(createDiscountDto);
} | JohnDoeAntler/nestjs-mongoose-jwt-example | src/discounts/discounts.controller.ts | TypeScript |
MethodDeclaration |
@Get()
findAll(@Query() filter) {
return this.discountsService.findAll(filter);
} | JohnDoeAntler/nestjs-mongoose-jwt-example | src/discounts/discounts.controller.ts | TypeScript |
MethodDeclaration |
@Get(':id')
findOne(@Param('id', ParseObjectIdPipe) id: ObjectId) {
return this.discountsService.findById(id);
} | JohnDoeAntler/nestjs-mongoose-jwt-example | src/discounts/discounts.controller.ts | TypeScript |
MethodDeclaration |
@Patch(':id')
update(@Param('id', ParseObjectIdPipe) id: ObjectId, @Body() updateDiscountDto: UpdateDiscountDto) {
return this.discountsService.update(id, updateDiscountDto);
} | JohnDoeAntler/nestjs-mongoose-jwt-example | src/discounts/discounts.controller.ts | TypeScript |
MethodDeclaration |
@Delete(':id')
remove(@Param('id', ParseObjectIdPipe) id: ObjectId) {
return this.discountsService.remove(id);
} | JohnDoeAntler/nestjs-mongoose-jwt-example | src/discounts/discounts.controller.ts | TypeScript |
ArrowFunction |
(
_: Request,
__: Response,
next: NextFunction
) => {
this.session.run(() => next());
} | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
ArrowFunction |
() => next() | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
ArrowFunction |
(
req: Request,
_: Response,
next: NextFunction
) => {
this.session.set('id', req.id);
next();
} | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
ArrowFunction |
(msg: string) => logger.info(msg) as any | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
ArrowFunction |
(err: Error, _: Request, res: Response, next: NextFunction) => {
new ErrorHandler().handle(err, res, next, logger as any);
} | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
ClassDeclaration |
class App {
public readonly app: Application;
private readonly session: Namespace;
constructor() {
this.app = express();
this.session = createNamespace('request');
this.middlewares();
this.configSwagger();
this.routes();
this.errorHandle();
}
private middlewares(): void {
this.... | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
MethodDeclaration |
private middlewares(): void {
this.app.use(express.json());
this.app.use(cors());
const reqId = require('express-request-id');
this.app.use(reqId());
const attachContext: RequestHandler = (
_: Request,
__: Response,
next: NextFunction
) => {
this.session.run(() => next(... | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
MethodDeclaration |
private errorHandle(): void {
this.app.use(
(err: Error, _: Request, res: Response, next: NextFunction) => {
new ErrorHandler().handle(err, res, next, logger as any);
}
);
} | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
MethodDeclaration |
private routes(): void {
this.app.use('/carshop', routes);
} | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
MethodDeclaration |
private async configSwagger(): Promise<void> {
const swagger = await swaggerRoutes.load();
this.app.use(swagger);
} | Gsaavedra-sa/loja-de-carro-api | src/app.ts | TypeScript |
ArrowFunction |
(err: Exception) => {
if (process.env.NODE_ENV === 'development') console.error(err);
else Sentry.captureException(err);
} | andordavoti/tic-tac-toe-app | client/lib/handleError.ts | TypeScript |
ClassDeclaration | /**
* <p>Updates a trigger definition.</p>
*/
export class UpdateTriggerCommand extends $Command<
UpdateTriggerCommandInput,
UpdateTriggerCommandOutput,
GlueClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
constructor(readonly input: UpdateTriggerCommandInp... | PaulThompson/aws-sdk-js-v3 | clients/client-glue/commands/UpdateTriggerCommand.ts | TypeScript |
TypeAliasDeclaration |
export type UpdateTriggerCommandInput = UpdateTriggerRequest; | PaulThompson/aws-sdk-js-v3 | clients/client-glue/commands/UpdateTriggerCommand.ts | TypeScript |
TypeAliasDeclaration |
export type UpdateTriggerCommandOutput = UpdateTriggerResponse & __MetadataBearer; | PaulThompson/aws-sdk-js-v3 | clients/client-glue/commands/UpdateTriggerCommand.ts | TypeScript |
MethodDeclaration | /**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: GlueClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UpdateTriggerCommandInput, UpdateTriggerCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configura... | PaulThompson/aws-sdk-js-v3 | clients/client-glue/commands/UpdateTriggerCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: UpdateTriggerCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1UpdateTriggerCommand(input, context);
} | PaulThompson/aws-sdk-js-v3 | clients/client-glue/commands/UpdateTriggerCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateTriggerCommandOutput> {
return deserializeAws_json1_1UpdateTriggerCommand(output, context);
} | PaulThompson/aws-sdk-js-v3 | clients/client-glue/commands/UpdateTriggerCommand.ts | TypeScript |
FunctionDeclaration |
export function SideBar({ genres, selectedGenreId, onHandleChangeGenre }: SideBarProps) {
return (
<nav className="sidebar">
<span>Watch<p>Me</p></span>
<div className="buttons-container">
{genres.map(genre => (
<Button
key={String(genre.id)}
title={genre.... | RodolphoFernandes/Desafio_Complementar_Capitulo1 | src/components/SideBar.tsx | TypeScript |
TypeAliasDeclaration |
type SideBarProps = {
genres: GenreResponseProps[];
selectedGenreId: number;
onHandleChangeGenre: (id: number) => void;
} | RodolphoFernandes/Desafio_Complementar_Capitulo1 | src/components/SideBar.tsx | TypeScript |
ArrowFunction | /*onclick*/
()=>{
this.router.navigate(['listar-clientes']);
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration |
async ngOnInit() {
this.estadosCivil=['Soltero','Casado','Conviviendo','Divorciado'];
this.obtenerParametroIdCliente();
this.configurarLabelsDeFormulario();
this.setearValidadorDeFormulario();
if(this.modoEdicion){
await this.obtenerClienteAEditar();
this.setearValidadorDeFormulario()... | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration |
async obtenerClienteAEditar(){
try{
this.clienteActual=this.clientesService.clienteSeleccionado;
if(this.clienteActual.clienteId==-1) throw new Error("el cliente seleccionado no puede ser null");
}catch(e){
this.router.navigate(['agregar-cliente']);
}
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration |
setearValidadorDeFormulario(){
let {apellidoPaterno,apellidoMaterno,email,nombres,telefonos,nroIdentificacion,pais,provincia,departamento,direccion}=this.clienteActual;
let {donacionOrganos,nroLicenciaConducir, generoId, tipoDocumentoId, fechaNacimiento, estadoCivil}=this.clienteActual;
let validadQueSeaSo... | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration |
validarQueHayaSeleccionadoUnaOpcion(control: FormControl):any{
if(control.value==-1) return {'debe selecciona una opcion':true};
return null;
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration | /**
* Obtener parametro id de ruta
*/
obtenerParametroIdCliente(){
this.clienteId=this.route.snapshot.params.id;
if(this.clienteId){
this.modoEdicion=true;
}
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration |
configurarLabelsDeFormulario(){
if(this.modoEdicion){
this.tituloFormulario="Editar cliente";
this.tituloBotonSubmit="Actualizar";
}else{
this.tituloFormulario="Registrar Cliente";
this.tituloBotonSubmit="Registrar";
}
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration | /**
* Validador que examina si el campo está vacío
* @param control
*/
validarSiElCampoEstaVacio(control: FormControl):any{
if(! control.value.trim()) return {'el campo no puede estar vacío':true};
return null;
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration | /**
* Cuando se seleccione una foto del picker
*/
fotoSeleccionada(foto:File){
this.clienteFotoFile=foto;
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration | /**
* Cuando se seleccione un archivo del picker
*/
archivoSeleccionado(archivo:File){
this.clienteAdjuntoFile=archivo;
} | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
MethodDeclaration |
async mantenerCliente(datos:any){
let {nombres,apellidoPaterno,fechaNacimiento,apellidoMaterno,email,telefonos,genero,tipoDocumento,nroIdentificacion,pais,provincia,direccion}=datos;
let {estadoCivil,donacionOrganos,nroLicenciaConducir}=datos;
try{
let response;
let formData=new FormData();
... | CarlosDevlp/sistema-damcohua | src/app/layout/mantener-cliente/mantener-cliente.component.ts | TypeScript |
ArrowFunction |
({ color }) => (color ? color : '#fff') | Ner3s/microfrontend-poc | packages/mfe1/src/pages/Cards/styles.ts | TypeScript |
ArrowFunction |
({ Application }) => {
const [isLoggedIn, setIsLoggedIn] = useState(false);
useEffect(() => {
setIsLoggedIn(Application.services.authService.isLogined());
}, [setIsLoggedIn, Application.services.authService]);
return (
<PageLayout Application={Application}>
{isLoggedIn ? (
<HomeSnug App... | connect-foundation/2019-08 | client/src/presentation/pages/home/index.tsx | TypeScript |
ArrowFunction |
() => {
setIsLoggedIn(Application.services.authService.isLogined());
} | connect-foundation/2019-08 | client/src/presentation/pages/home/index.tsx | TypeScript |
MethodDeclaration |
isLoggedIn ? (
<HomeSnug Application={Application} />
) : (
<HomeForm Application={Application} | connect-foundation/2019-08 | client/src/presentation/pages/home/index.tsx | TypeScript |
ArrowFunction |
props => props.theme.background | exlskills/web-client | app/pages/Section/styledComponents.ts | TypeScript |
ArrowFunction |
(): RedisClient => {
return new Redis({
host: hostName, // host will change if you restart container
port: port,
password: pass
});
} | shijiezhou1/apinestjs | src/shared/redis/redis.providers.ts | TypeScript |
TypeAliasDeclaration |
export type RedisClient = Redis.Redis; | shijiezhou1/apinestjs | src/shared/redis/redis.providers.ts | TypeScript |
ArrowFunction |
(app: App) => {
app.component('si-avatar', component)
} | YYsuni/suni | suni-ui/src/components/siAvatar/index.ts | TypeScript |
ArrowFunction |
() => (
<Container>
{nav.map(item => (
<ScrollButton href={item.href} text={item.text} key={item.href} />
))}
</Container>
) | JonathanHalpern/jonathan-halpern | src/containers/navigation.tsx | TypeScript |
ArrowFunction |
item => (
<ScrollButton href={item.href} | JonathanHalpern/jonathan-halpern | src/containers/navigation.tsx | TypeScript |
ArrowFunction |
item => {
const newItem = new PlaylistItem()
newItem.title = item.title
newItem.link = item.link
newItem.id = item.id
newItem.djId = client.sessionId
newItem.duration = item.duration
player.nextTwoPlaylist.push(newItem)
} | goblincore/club-mutant | server/rooms/commands/PlayerUpdatePlaylistCommand.ts | TypeScript |
ClassDeclaration |
export class PlayerSyncShortPlaylist extends Command<IOfficeState, Payload> {
execute(data: Payload) {
const { client, items } = data
const player = this.state.players.get(client.sessionId)
console.log('//Player sync next two playlist command', items, 'client', client.sessionId)
items?.forEach(item... | goblincore/club-mutant | server/rooms/commands/PlayerUpdatePlaylistCommand.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.