Skip to content

Commit

Permalink
v1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zeplin-dev committed Dec 21, 2021
1 parent a82d8a9 commit e549074
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/models/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,24 @@
*/


import {
LanguageEnum,
transformLanguageEnumToJSON,
transformJSONToLanguageEnum
} from './language-enum';


export const transformCodeToJSON = function (value: Code): any {
return {
snippet: value.snippet,
language: value.language
language: value.language && transformLanguageEnumToJSON(value.language)
}
}

export const transformJSONToCode = function (value: any): Code {
return {
snippet: value.snippet,
language: value.language
language: value.language && transformJSONToLanguageEnum(value.language)
}
}

Expand All @@ -41,11 +46,11 @@ export interface Code {
*/
snippet: string;
/**
* Language of the code snippet
* @type {string}
*
* @type {LanguageEnum}
* @memberof Code
*/
language?: string;
language?: LanguageEnum;
}


0 comments on commit e549074

Please sign in to comment.