Skip to content

Instantly share code, notes, and snippets.

@alexmachina
Last active January 30, 2020 12:28
Show Gist options
  • Save alexmachina/11f12241eac6d79a35cfd5c55cd915ff to your computer and use it in GitHub Desktop.
Save alexmachina/11f12241eac6d79a35cfd5c55cd915ff to your computer and use it in GitHub Desktop.
Ajuda nois
type Acquirer = {
id?: string;
name: string;
internalCode: string;
}
// QUERO DEFINIR QUE O PARAMETRO overrides É UM SUBSET DE PROPRIEDADES DO TIPO Acquirer.
// NÃO QUERO DEIXAR TUDO OPCIONAL NO tipo Acquirer
const insertFakeAcquirer = (overrides: Acquirer) => {
const fakeAcquirer = {
name: "Stone",
internalCode: "C34faa",
...overrides
};
// ...database operations
}
// COMPILADOR CHORA
insertFakeAcquirer({ internalCode: "AN44" });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment