UNPKG

s3-orm

Version:

Object-Relational Mapping (ORM) interface for Amazon S3, enabling model-based data operations with indexing and querying capabilities

28 lines (22 loc) 598 B
import Logger from "../utils/Logger"; import Chance from "chance"; const chance = new Chance(); export class ArrayType { static isNumeric:boolean = false; static typeName:string = "array"; static mock(){ return chance.n(chance.word, 5); } static encode(val: any): string { return JSON.stringify(val); } static decode(val: string) { try { return JSON.parse(val); } catch(err){ Logger.error(`Error decoding json string ${val}`); } return null } }