Skip to content

Commit

Permalink
Fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
TiMESPLiNTER committed Jan 31, 2024
1 parent e2953c7 commit e9442a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 4 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const config: Config = {
"lines": 93,
"statements": 93
}
}
},
collectCoverageFrom: [
"src/**/*"
],
};

export default config;
8 changes: 2 additions & 6 deletions src/pimple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Container, {ServiceKey} from "./container";
import ServiceProvider from "./serviceProvider";

/** Declaration types */
type ProviderDeclaration<T> = Function|ServiceProvider<T>;
type ProviderDeclaration<T> = (container: Pimple<T>) => void|ServiceProvider<T>;
type LazyServiceDefinition<T, S> = (container: Pimple<T>) => S;
type ProtectedServiceDefinition<T, S> = () => LazyServiceDefinition<T, S>;
type ServiceDefinition<T, S> = LazyServiceDefinition<T, S>|ProtectedServiceDefinition<T, S>|S;
Expand Down Expand Up @@ -160,12 +160,8 @@ export default class Pimple<T> implements Container<T>
public register(provider: ProviderDeclaration<T>): Pimple<T> {
if (this.instanceOfServiceProvider(provider) && provider.register instanceof Function) {
provider.register(this);
return this;
}

if (provider instanceof Function) {
} else {
provider(this);
return this;
}

return this;
Expand Down

0 comments on commit e9442a9

Please sign in to comment.