import { TiledProperty } from "./tiled-types" ; param properties param prop returns export const getProperty = < T = unknown > ( properties , prop ) : TiledProperty < T > | undefined => { if ( Array . isArray ( properties ) ) { return properties ?. filter ( p => p . name ?. toLocaleLowerCase ( ) === prop . toLocaleLowerCase ( ) ) [ 0 ] as TiledProperty < T > ; } } ; export class TiledEntity { public id ! : number ; public name ? : string ; public properties : TiledProperty [ ] = [ ] ; public getProperty < T = unknown > ( prop ) { return getProperty < T > ( this . properties , prop ) ; } }