1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
const { Record } = require('immutable'); const DEFAULTS = { type: '', mtime: '', path: '' }; class FileState extends Record(DEFAULTS) { static create(state) { return state instanceof FileState ? state : new FileState(state); } } module.exports = FileState;