@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
1 lines • 919 B
Source Map (JSON)
{"version":3,"sources":["../../src/functions/ExportUtility.ts"],"names":[],"mappings":";AAKO,SAAS,wBAA2B,OAAe,EAAA;AACtD,EAAI,IAAA;AACA,IAAI,IAAA,aAAA,GAAgB,IAAK,CAAA,SAAA,CAAU,OAAO,CAAA,CAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,MAAM,aAAa,CAAA,CAAA;AAAA,WAE5B,CAAG,EAAA;AACN,IAAQ,OAAA,CAAA,KAAA,CAAM,+CAA+C,CAAC,CAAA,CAAA;AAC9D,IAAM,MAAA,IAAI,MAAM,6CAA6C,CAAA,CAAA;AAAA,GACjE;AACJ","file":"ExportUtility.mjs","sourcesContent":["/**\n * This function is used to create a deep copy of the element\n * @param element The element to be copied\n * @returns The copied element\n */\nexport function createExportableElement<T>(element: T): T {\n try {\n let elementString = JSON.stringify(element)\n return JSON.parse(elementString)\n }\n catch (e) {\n console.error(\"[Pixi'VN] Error creating exportable element\", e)\n throw new Error(\"[Pixi'VN] Error creating exportable element\")\n }\n}\n"]}