mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
Grammar refactoring
* Grammar refactoring WIP * ISerializer.grammar * Fixing various bugs in the grammar * Small touch that improoves performance * Fix unknown values grammar * Various fixes * Serialization refactoring to drop suboject logic * Details fixed * Entity attributes initialization refactoring * JSDoc error fixed * Rename value key to default * Remove useless default * Revert string keys
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import Utility from "../Utility.js"
|
||||
import GeneralSerializer from "./GeneralSerializer.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("../entity/IEntity").AnyValueConstructor<*>} AnyValueConstructor
|
||||
*/
|
||||
|
||||
@@ -18,12 +18,12 @@ export default class ToStringSerializer extends GeneralSerializer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {T} object
|
||||
* @param {T} entity
|
||||
* @param {Boolean} insideString
|
||||
*/
|
||||
write(entity, object, insideString) {
|
||||
return !insideString && object.constructor === String
|
||||
? `"${Utility.escapeString(object.toString())}"` // String will have quotes if not inside a string already
|
||||
: Utility.escapeString(object.toString())
|
||||
write(entity, insideString) {
|
||||
return !insideString && entity.constructor === String
|
||||
? `"${Utility.escapeString(entity.toString())}"` // String will have quotes if not inside a string already
|
||||
: Utility.escapeString(entity.toString())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user