mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 14:24:47 +08:00
Integer => IntegerEntity, No more primitive
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
import Integer from "./primitive/Integer"
|
||||
|
||||
export default class TypeInitialization {
|
||||
|
||||
static sanitize(value) {
|
||||
if (!(value instanceof Object)) {
|
||||
return value // Is already primitive
|
||||
}
|
||||
if (value instanceof Boolean || value instanceof Integer || value instanceof Number) {
|
||||
if (value instanceof Boolean || value instanceof Number || value instanceof String) {
|
||||
return value.valueOf()
|
||||
}
|
||||
if (value instanceof String) {
|
||||
return value.toString()
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user