Skip to content

Commit

Permalink
fix(text): update
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Mar 26, 2023
1 parent 9f32123 commit 709f197
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ function create(arg0: any, arg1: any, arg2?: any): any {
if (rawReturnValue) {
const _value = rawReturnValue[0];
if (_options.strict && typeof value === 'object' && value !== null) {
handleReturnValue({ rootDraft: proxyDraft, value, useRawReturn: true });
handleReturnValue({
rootDraft: proxyDraft,
value,
useRawReturn: true,
});
}
return finalize([_value]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rawReturn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function rawReturn<T extends object | undefined>(value: T): T {
(typeof value !== 'object' || value === null)
) {
console.warn(
'rawReturn() must be called with an object or `undefined`, other types do not need to be returned via rawReturn().'
'rawReturn() must be called with an object(including plain object, arrays, Set, Map, etc.) or `undefined`, other types do not need to be returned via rawReturn().'
);
}
return {
Expand Down
2 changes: 1 addition & 1 deletion test/rawReturn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ test('error args', () => {
].forEach((value: any) => {
create({}, () => rawReturn(value));
expect(logSpy).toHaveBeenCalledWith(
'rawReturn() must be called with an object or `undefined`, other types do not need to be returned via rawReturn().'
'rawReturn() must be called with an object(including plain object, arrays, Set, Map, etc.) or `undefined`, other types do not need to be returned via rawReturn().'
);
logSpy.mockClear();
});
Expand Down

0 comments on commit 709f197

Please sign in to comment.