@@ -121,7 +121,7 @@ export function service(resource: unknown) {
121
121
return function legacyServiceDecorator (
122
122
_prototype : object ,
123
123
key : string ,
124
- descriptor ?: Stage1DecoratorDescriptor
124
+ descriptor ?: Stage1DecoratorDescriptor ,
125
125
) {
126
126
if ( ! descriptor ) return ;
127
127
@@ -130,12 +130,12 @@ export function service(resource: unknown) {
130
130
assert (
131
131
`@service(...) may not be used with an initializer. For example, ` +
132
132
`\`@service(MyService) property;\`` ,
133
- ! descriptor . initializer
133
+ ! descriptor . initializer ,
134
134
) ;
135
135
136
136
assert (
137
137
`Expected passed resource to be a valid resource definition.` ,
138
- typeof resource === 'function' || ( typeof resource === 'object' && resource !== null )
138
+ typeof resource === 'function' || ( typeof resource === 'object' && resource !== null ) ,
139
139
) ;
140
140
141
141
return {
@@ -146,7 +146,7 @@ export function service(resource: unknown) {
146
146
`owner was not found on instance of ${ this . constructor . name } . ` +
147
147
`Has it been linked up correctly with setOwner?` +
148
148
`If this error has occured in a framework-controlled class, something has gone wrong.` ,
149
- owner
149
+ owner ,
150
150
) ;
151
151
152
152
assert ( `Resource definition is invalid` , isResourceType ( resource ) ) ;
@@ -171,7 +171,7 @@ export function service(resource: unknown) {
171
171
assert (
172
172
`When using resources with @service(...), do not call .from() on class-based resources. ` +
173
173
`Resources used as services may not take arguments.` ,
174
- resource . type === 'function-based'
174
+ resource . type === 'function-based' ,
175
175
) ;
176
176
177
177
cache = invokeHelper ( owner , resource ) ;
@@ -180,15 +180,15 @@ export function service(resource: unknown) {
180
180
} else if ( ( resource as any ) . prototype instanceof Resource ) {
181
181
assert (
182
182
`The .from() method on a type of Resource has been removed or altered. This is not allowed.` ,
183
- 'from' in resource && resource . from === Resource . from
183
+ 'from' in resource && resource . from === Resource . from ,
184
184
) ;
185
185
186
186
/**
187
187
* We do a lot of lying internally to make TypeScript nice for consumers.
188
188
* But it does mean that we have to cast in our own code.
189
189
*/
190
190
let { definition } = ( resource as typeof Resource ) . from (
191
- ( ) => [ ]
191
+ ( ) => [ ] ,
192
192
) as unknown as ClassResourceConfig ;
193
193
194
194
cache = invokeHelper ( owner , definition ) ;
@@ -238,7 +238,7 @@ interface RegisterOptions {
238
238
export function serviceOverride ( owner : Owner , { original, replacement } : RegisterOptions ) {
239
239
if ( macroCondition ( ! isTesting ( ) && ! isDevelopingApp ( ) ) ) {
240
240
throw new Error (
241
- '@service is experimental and `serviceOverride` is not available in production builds.'
241
+ '@service is experimental and `serviceOverride` is not available in production builds.' ,
242
242
) ;
243
243
}
244
244
0 commit comments