Skip to content

Commit a6c3b61

Browse files
committed
allow both two and three arguments
1 parent 409c183 commit a6c3b61

File tree

1 file changed

+3
-1
lines changed
  • ember-set-helper/src/helpers

1 file changed

+3
-1
lines changed

ember-set-helper/src/helpers/set.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { helper } from '@ember/component/helper';
22
import { set as emberSet } from '@ember/object';
33
import { assert } from '@ember/debug';
44

5-
function set<T extends object, K extends keyof T>(positional: [T, K, T[K]]) {
5+
function set<T extends object, K extends keyof T>(
6+
positional: [T, K] | [T, K, T[K]],
7+
) {
68
const [target, path, maybeValue] = positional;
79
assert(
810
'you must pass a path to {{set}}. You can pass a path statically, as in `{{set this "foo"}}`, or with the path dynamically, as in `{{set this this.greetingPath "Hello"}}`',

0 commit comments

Comments
 (0)