Skip to content

Commit

Permalink
Simplify type
Browse files Browse the repository at this point in the history
The official ember types no longer tries to do the complicated `get`
thing, and this is not really used by/seen by/helping anyone since
the helper is only inserted in AST transforms.
  • Loading branch information
chancancode committed Oct 17, 2023
1 parent 52e5727 commit df91563
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions addon/this-fallback-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { deprecate } from '@ember/debug';
import { get } from '@ember/object';
import { assertIsDeprecation } from 'ember-this-fallback/types/deprecations';

type Positional<T, K extends keyof T> = [
context: T,
path: K,
type Positional = [
context: object,
path: string,
deprecationJson: string | false
];

Expand All @@ -16,10 +16,7 @@ type Positional<T, K extends keyof T> = [
* will be called with those params.
*/
const thisFallbackHelper = helper(
<T, K extends keyof T>([context, path, deprecationJson]: Positional<
T,
K
>) => {
([context, path, deprecationJson]: Positional) => {
if (deprecationJson) {
const deprecation = assertIsDeprecation(JSON.parse(deprecationJson));
deprecate(...deprecation);
Expand Down

0 comments on commit df91563

Please sign in to comment.