UNPKG

ngx-rickandmorty

Version:

13 lines 517 B
import { __rest } from "tslib"; import { extractIdsFromUrl } from '../helpers/extract-ids-from-url'; export class Location { static fromJson(_a) { var { created, residents } = _a, common = __rest(_a, ["created", "residents"]); const location = new Location(); Object.assign(location, common); location.residents = residents.map(extractIdsFromUrl).map(([id]) => id); location.created = new Date(created); return location; } } //# sourceMappingURL=location.js.map