Skip to content

Commit

Permalink
🧪 finish ii.pre example in playground
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jan 8, 2025
1 parent c99fd71 commit e9a1056
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions playground/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,27 +385,27 @@ examples.make(() => {
);
});

// ii → unwrap promise
examples.make(() => {
ii(Promise.resolve("hello"));
tt(Promise.resolve(["hello"]));
});

// options.pre
examples.make(() => {
// ii.defaults.pre = (value) => {
// if (typeof value === "string") {
// return value.toUpperCase();
// }
// return value;
// };
ii.pre = (value) => {
if (typeof value === "string") {
return value.toUpperCase();
}
return value;
};

ii("hello", "world", {});

// ii.defaults.pre = undefined;
ii.pre = undefined;
});

// 🐛 ii(new URL()) isn't printed at all
examples.make(() => {
ii(new URL("https://example.com"));
});

// ii → unwrap promise
examples.make(() => {
ii(Promise.resolve("hello"));
tt(Promise.resolve(["hello"]));
});

0 comments on commit e9a1056

Please sign in to comment.