Skip to content

Commit d58127b

Browse files
committed
style: reformat code using prettier
1 parent 4c8f72e commit d58127b

36 files changed

+177
-190
lines changed

packages/authentication/test/unit/authenticate-action.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ describe('AuthenticationProvider', () => {
4040
const authenticate: AuthenticateFn = await Promise.resolve(
4141
provider.value(),
4242
);
43-
const request = <ParsedRequest> {};
43+
const request = <ParsedRequest>{};
4444
const user = await authenticate(request);
4545
expect(user).to.be.equal(mockUser);
4646
});
4747

4848
it('updates current user', async () => {
4949
const authenticate = await Promise.resolve(provider.value());
50-
const request = <ParsedRequest> {};
50+
const request = <ParsedRequest>{};
5151
await authenticate(request);
5252
expect(currentUser).to.equal(mockUser);
5353
});
@@ -59,7 +59,7 @@ describe('AuthenticationProvider', () => {
5959
context
6060
.bind(AuthenticationBindings.AUTH_ACTION)
6161
.toProvider(AuthenticationProvider);
62-
const request = <ParsedRequest> {};
62+
const request = <ParsedRequest>{};
6363
const authenticate = await context.get(
6464
AuthenticationBindings.AUTH_ACTION,
6565
);
@@ -76,7 +76,7 @@ describe('AuthenticationProvider', () => {
7676
const authenticate = await context.get(
7777
AuthenticationBindings.AUTH_ACTION,
7878
);
79-
const request = <ParsedRequest> {};
79+
const request = <ParsedRequest>{};
8080
let error;
8181
try {
8282
await authenticate(request);
@@ -95,7 +95,7 @@ describe('AuthenticationProvider', () => {
9595
const authenticate = await context.get(
9696
AuthenticationBindings.AUTH_ACTION,
9797
);
98-
const request = <ParsedRequest> {};
98+
const request = <ParsedRequest>{};
9999
request.headers = {testState: 'fail'};
100100
let error;
101101
try {

packages/authentication/test/unit/authenticate-decorator.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
// License text available at https://opensource.org/licenses/MIT
55

66
import {expect} from '@loopback/testlab';
7-
import {
8-
authenticate,
9-
getAuthenticateMetadata,
10-
} from '../..';
7+
import {authenticate, getAuthenticateMetadata} from '../..';
118

129
describe('Authentication', () => {
1310
describe('@authenticate decorator', () => {

packages/authentication/test/unit/strategy-adapter.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Strategy Adapter', () => {
2525
}
2626
const strategy = new Strategy();
2727
const adapter = new StrategyAdapter(strategy);
28-
const request = <ParsedRequest> {};
28+
const request = <ParsedRequest>{};
2929
await adapter.authenticate(request);
3030
expect(calledFlag).to.be.true();
3131
});
@@ -34,7 +34,7 @@ describe('Strategy Adapter', () => {
3434
const strategy = new MockStrategy();
3535
strategy.setMockUser(mockUser);
3636
const adapter = new StrategyAdapter(strategy);
37-
const request = <ParsedRequest> {};
37+
const request = <ParsedRequest>{};
3838
const user: Object = await adapter.authenticate(request);
3939
expect(user).to.be.eql(mockUser);
4040
});
@@ -43,7 +43,7 @@ describe('Strategy Adapter', () => {
4343
const strategy = new MockStrategy();
4444
strategy.setMockUser(mockUser);
4545
const adapter = new StrategyAdapter(strategy);
46-
const request = <ParsedRequest> {};
46+
const request = <ParsedRequest>{};
4747
request.headers = {testState: 'fail'};
4848
let error;
4949
try {
@@ -58,7 +58,7 @@ describe('Strategy Adapter', () => {
5858
const strategy = new MockStrategy();
5959
strategy.setMockUser(mockUser);
6060
const adapter = new StrategyAdapter(strategy);
61-
const request = <ParsedRequest> {};
61+
const request = <ParsedRequest>{};
6262
request.headers = {testState: 'error'};
6363
let error;
6464
try {

packages/context/src/binding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class Binding {
120120

121121
return {
122122
key: keyWithPath.substr(0, index).trim(),
123-
path: keyWithPath.substr(index+1),
123+
path: keyWithPath.substr(index + 1),
124124
};
125125
}
126126

packages/context/src/is-promise.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
*
1010
* @param value The value to check.
1111
*/
12-
export function isPromise<T>(value: T | PromiseLike<T>):
13-
value is PromiseLike<T> {
12+
export function isPromise<T>(
13+
value: T | PromiseLike<T>,
14+
): value is PromiseLike<T> {
1415
if (!value) return false;
1516
if (typeof value !== 'object' && typeof value !== 'function') return false;
1617
return typeof (value as PromiseLike<T>).then === 'function';

packages/context/src/reflect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class NamespacedReflect {
161161
if (targetKey) {
162162
return Reflect.decorate(decorators, target, targetKey, descriptor);
163163
} else {
164-
return Reflect.decorate(<ClassDecorator[]> decorators, <Function> target);
164+
return Reflect.decorate(<ClassDecorator[]>decorators, <Function>target);
165165
}
166166
}
167167

packages/context/test/acceptance/child-context.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,18 @@ describe('Context bindings - contexts inheritance', () => {
3232
});
3333

3434
it('includes parent bindings when searching via findByTag()', () => {
35-
parentCtx.bind('foo').to('parent:foo').tag('a-tag');
36-
parentCtx.bind('bar').to('parent:bar').tag('a-tag');
37-
childCtx.bind('foo').to('child:foo').tag('a-tag');
35+
parentCtx
36+
.bind('foo')
37+
.to('parent:foo')
38+
.tag('a-tag');
39+
parentCtx
40+
.bind('bar')
41+
.to('parent:bar')
42+
.tag('a-tag');
43+
childCtx
44+
.bind('foo')
45+
.to('child:foo')
46+
.tag('a-tag');
3847

3948
const found = childCtx.findByTag('a-tag').map(b => b.getValue(childCtx));
4049
expect(found).to.deepEqual(['child:foo', 'parent:bar']);

packages/context/test/acceptance/class-level-bindings.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ describe('Context bindings - Injecting dependencies of classes', () => {
138138
ctx.bind('key').to('value');
139139

140140
class Store {
141-
constructor(
142-
@inject.getter('key')
143-
public getter: Getter<string>,
144-
) {}
141+
constructor(@inject.getter('key') public getter: Getter<string>) {}
145142
}
146143

147144
ctx.bind('store').toClass(Store);
@@ -157,10 +154,7 @@ describe('Context bindings - Injecting dependencies of classes', () => {
157154

158155
it('injects a setter function', async () => {
159156
class Store {
160-
constructor(
161-
@inject.setter('key')
162-
public setter: Setter<string>,
163-
) {}
157+
constructor(@inject.setter('key') public setter: Setter<string>) {}
164158
}
165159

166160
ctx.bind('store').toClass(Store);
@@ -173,10 +167,7 @@ describe('Context bindings - Injecting dependencies of classes', () => {
173167

174168
it('injects a nested property', async () => {
175169
class TestComponent {
176-
constructor(
177-
@inject('config#test')
178-
public config: string,
179-
) {}
170+
constructor(@inject('config#test') public config: string) {}
180171
}
181172

182173
ctx.bind('config').to({test: 'test-config'});

packages/context/test/acceptance/finding-bindings.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ describe('Context bindings - Finding bindings', () => {
5959

6060
function createTaggedBindings() {
6161
class Dog {}
62-
ctx.bind('spot').to(new Dog()).tag('dog');
63-
ctx.bind('fido').to(new Dog()).tag('dog');
62+
ctx
63+
.bind('spot')
64+
.to(new Dog())
65+
.tag('dog');
66+
ctx
67+
.bind('fido')
68+
.to(new Dog())
69+
.tag('dog');
6470
}
6571
});
6672

packages/context/test/acceptance/locking-bindings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ describe('Context bindings - Locking bindings', () => {
3939
const key = 'foo';
4040
const operation = () => ctx.bind('foo');
4141
expect(operation).to.throw(
42-
new RegExp(
43-
`Cannot rebind key "${key}" to a locked binding`,
44-
),
42+
new RegExp(`Cannot rebind key "${key}" to a locked binding`),
4543
);
4644
});
4745
});

0 commit comments

Comments
 (0)