Skip to content

Commit 7cf3ca6

Browse files
committed
fix(attributes): set on AttributeCaster have to return a value
This isn't a breaking change as `void` is assignable to `unknown`
1 parent a4bbb02 commit 7cf3ca6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Contracts/AttributeCaster.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { Attributes } from '../Calliope/Concerns/HasAttributes';
88
*/
99
export default interface AttributeCaster {
1010
/**
11-
* Transform the attribute from the underlying model value.
11+
* Transform the attribute from the underlying model value and return it.
1212
*
1313
* @param {any} value - the value to return
1414
* @param {object} attributes - receives a clone of the raw attributes
@@ -18,12 +18,12 @@ export default interface AttributeCaster {
1818
get: (value: unknown, attributes: Attributes) => unknown;
1919

2020
/**
21-
* Transform the attribute to its underlying model values.
21+
* Transform the attribute to its underlying model values and return it.
2222
*
2323
* @param {any} value - the value to set
2424
* @param {object} attributes - receives a clone of the raw attributes
2525
*
26-
* @return {void}
26+
* @return {any}
2727
*/
28-
set: (value: unknown, attributes: Attributes) => void;
28+
set: (value: unknown, attributes: Attributes) => unknown;
2929
}

0 commit comments

Comments
 (0)