RockPaperScissors/node_modules/@discordjs/builders/dist/index.mjs.map

8 lines
56 KiB
Plaintext
Raw Normal View History

2021-11-30 21:03:51 +00:00
{
"version": 3,
"sources": ["../src/messages/embed/Assertions.ts", "../src/messages/embed/Embed.ts", "../src/messages/formatters.ts", "../src/interactions/slashCommands/Assertions.ts", "../src/interactions/slashCommands/SlashCommandBuilder.ts", "../src/interactions/slashCommands/options/boolean.ts", "../src/interactions/slashCommands/mixins/CommandOptionBase.ts", "../src/interactions/slashCommands/mixins/NameAndDescription.ts", "../src/interactions/slashCommands/options/channel.ts", "../src/interactions/slashCommands/mixins/CommandChannelOptionBase.ts", "../src/interactions/slashCommands/options/integer.ts", "../src/interactions/slashCommands/mixins/CommandOptionWithChoices.ts", "../src/interactions/slashCommands/options/mentionable.ts", "../src/interactions/slashCommands/options/number.ts", "../src/interactions/slashCommands/options/role.ts", "../src/interactions/slashCommands/options/string.ts", "../src/interactions/slashCommands/options/user.ts", "../src/interactions/slashCommands/mixins/CommandOptions.ts", "../src/interactions/slashCommands/SlashCommandSubcommands.ts", "../src/interactions/contextMenuCommands/Assertions.ts", "../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts"],
"sourcesContent": ["import type { APIEmbedField } from 'discord-api-types/v9';\nimport ow from 'ow';\n\nexport const fieldNamePredicate = ow.string.minLength(1).maxLength(256);\n\nexport const fieldValuePredicate = ow.string.minLength(1).maxLength(1024);\n\nexport const fieldInlinePredicate = ow.optional.boolean;\n\nexport const embedFieldPredicate = ow.object.exactShape({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = ow.array.ofType(embedFieldPredicate);\n\nexport function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void {\n\tow(fields.length + amountAdding, 'field amount', ow.number.lessThanOrEqual(25));\n}\n\nexport const authorNamePredicate = ow.any(fieldNamePredicate, ow.null);\n\nexport const urlPredicate = ow.any(ow.string.url, ow.nullOrUndefined);\n\nexport const colorPredicate = ow.any(ow.number.greaterThanOrEqual(0).lessThanOrEqual(0xffffff), ow.null);\n\nexport const descriptionPredicate = ow.any(ow.string.minLength(1).maxLength(4096), ow.null);\n\nexport const footerTextPredicate = ow.any(ow.string.minLength(1).maxLength(2048), ow.null);\n\nexport const timestampPredicate = ow.any(ow.number, ow.date, ow.null);\n\nexport const titlePredicate = ow.any(fieldNamePredicate, ow.null);\n", "import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedProvider,\n\tAPIEmbedThumbnail,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport ow from 'ow';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfieldInlinePredicate,\n\tfieldNamePredicate,\n\tfieldValuePredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\n\nexport interface AuthorOptions {\n\tname: string;\n\turl?: string;\n\ticonURL?: string;\n}\n\nexport interface FooterOptions {\n\ttext: string;\n\ticonURL?: string;\n}\n\n/**\n * Represents an embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed implements APIEmbed {\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic fields: APIEmbedField[];\n\n\t/**\n\t * The embed title\n\t */\n\tpublic title?: string;\n\n\t/**\n\t * The embed description\n\t */\n\tpublic description?: string;\n\n\t/**\n\t * The embed url\n\t */\n\tpublic url?: string;\n\n\t/**\n\t * The embed color\n\t */\n\tpublic color?: number;\n\n\t/**\n\t * The timestamp of the embed in the ISO format\n\t */\n\tpublic timestamp?: string;\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic thumbnail?: APIEmbedThumbnail;\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic image?: APIEmbedImage;\n\n\t/**\n\t * Received video data\n\t */\n\tpublic video?: APIEmbedVideo;\n\n\t/**\n\t * The embed author data\n\t */\n\tpublic author?: APIEmbedAuthor;\n\n\t/**\n\t * Received data about the embed provider\n\t */\n\tpublic provider?: APIEmbedProvider;\n\n\t/**\n\t * The embed footer data\n\t */\n\tpublic footer?: APIEmbedFooter;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.title = data.title;\n\t\tthis.description = data.description;\n\t\tthis.url = data.url;\n\t\tthis.color = data.color;\n\t\tthis.thumbnail = data.thumbnail;\n\t\tthis.image = data.image;\n\t\tthis.video = data.video;\n\t\tthis.author = data.author;\n\t\tthis.provider = data.provider;\n\t\tthis.footer = data.footer;\n\t\tthis.fields = data.fields ?? [];\n\n\t\tif (data.timestamp) this.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * The accumulated length for the embed title, description, fields, footer text, and author name\n\t */\n\tpublic get length(): number {\n\t\treturn (\n\t\t\t(this.title?.length ?? 0) +\n\t\t\t(this.description?.length ?? 0) +\n\t\t\tthis.fields.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) +\n\t\t\t(this.footer?.text.length ?? 0) +\n\t\t\t(this.author?.name.length ?? 0)\n\t\t);\n\t}\n\n\t/**\n\t * Adds a field to the embed (max 25)\n\t *\n\t
"mappings": "mcAAA,0VACA,kBAEO,GAAM,GAAqB,EAAG,OAAO,UAAU,GAAG,UAAU,KAEtD,EAAsB,EAAG,OAAO,UAAU,GAAG,UAAU,MAEvD,EAAuB,EAAG,SAAS,QAEnC,GAAsB,EAAG,OAAO,WAAW,CACvD,KAAM,EACN,MAAO,EACP,OAAQ,IAGI,EAA4B,EAAG,MAAM,OAAO,IAElD,WAA6B,EAAyB,EAA4B,CACxF,EAAG,EAAO,OAAS,EAAc,eAAgB,EAAG,OAAO,gBAAgB,KAGrE,GAAM,GAAsB,EAAG,IAAI,EAAoB,EAAG,MAEpD,EAAe,EAAG,IAAI,EAAG,OAAO,IAAK,E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