/**
 * Copyright (c) 2019-present Wen-Zhi Wang <zxcvb22217@gmail.com>
 * All rights reserved.
 *
 * Use of this source code is governed by a MIT license that can be found
 * in the LICENSE file.
 */ /** Import scripts. */ import { getBlockUri , getBlockColor } from "./util" ; /** Import types. */ import * as Notion from "notionapi-agent/dist/interfaces" ; import { transformTitle } from "./transformTitle" ; async function transformCode ( node ) { return { children : [ ] , uri : getBlockUri ( node ) , type : "code" , color : getBlockColor ( node ) , createdTime : node . created_time , lastEditedTime : node . last_edited_time , title : node . properties ? await transformTitle ( node , node . properties . title ) || [ ] : [ ] , language : node . properties ? node . properties . language ? node . properties . language [ 0 ] [ 0 ] : undefined : undefined , wrap : ( typeof node . format !== "undefined" && typeof node . format . code_wrap !== "undefined" ) ? node . format . code_wrap : false } ; } export default transformCode ;