Skip to content

Commit

Permalink
chore(types): type makeTagged
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jan 11, 2024
1 parent e6d6984 commit 935718b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/pass-style/src/makeTagged.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import { assertPassable } from './passStyleOf.js';
const { create, prototype: objectPrototype } = Object;
const { Fail } = assert;

/**
* @template {string} T
* @template {any} P
* @param {T} tag
* @param {P} payload
* @returns {import('./types.js').CopyTagged<T,P>}
*/
export const makeTagged = (tag, payload) => {
typeof tag === 'string' ||
Fail`The tag of a tagged record must be a string: ${tag}`;
Expand Down

0 comments on commit 935718b

Please sign in to comment.