UNPKG

remark-docx

Version:

remark plugin to compile markdown to docx (Microsoft Word, Office Open XML).

1 lines 994 B
{"version":3,"file":"utils-D_YAYv4R.cjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["const alreadyWarned: { [message: string]: boolean } = {};\n\n/**\n * @internal\n */\nexport function warnOnce(message: string, cond: boolean = false): void {\n if (!cond && !alreadyWarned[message]) {\n alreadyWarned[message] = true;\n console.warn(message);\n }\n}\n\nconst supportedTypes = [\"png\", \"jpg\", \"gif\", \"bmp\", \"svg\"] as const;\nexport type SupportedImageType = (typeof supportedTypes)[number];\n\nexport const isSupportedType = (\n type: string | undefined,\n): type is SupportedImageType => {\n if (!type) return false;\n if ((supportedTypes as readonly string[]).includes(type)) {\n return true;\n }\n return false;\n};\n"],"mappings":"AAAA,IAAM,EAAgD,CAAC,EAKvD,SAAgB,EAAS,EAAiB,EAAgB,GAAa,CACjE,CAAC,GAAQ,CAAC,EAAc,KAC1B,EAAc,GAAW,GACzB,QAAQ,KAAK,CAAO,EAExB,CAEA,IAAM,EAAiB,CAAC,MAAO,MAAO,MAAO,MAAO,KAAK,EAG5C,EACX,GAEK,EACL,EAAK,EAAqC,SAAS,CAAI,EADrC"}