mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
23 lines
580 B
JavaScript
23 lines
580 B
JavaScript
import PinEntity from "../entity/PinEntity"
|
|
import Serializer from "./Serializer"
|
|
|
|
export default class PinSerializer extends Serializer {
|
|
|
|
getAttributes() {
|
|
return PinEntity.attributes
|
|
}
|
|
|
|
read(value) {
|
|
const parseResult = Serializer.grammar.Pin.parse(value)
|
|
if (!parseResult.status) {
|
|
console.error("Error when trying to parse the pin.")
|
|
return parseResult
|
|
}
|
|
return parseResult.value
|
|
}
|
|
|
|
write(object) {
|
|
let result = `Pin (${this.subWrite([], object, ",")})`
|
|
return result
|
|
}
|
|
} |