class-o-mat
Version:
ALPHA VERSION ONLY: class-o-mats will help to create getter-setter functionality with validations that can be attached to a container class for easier coding. Some basic validations are included. class-o-mats also has the ability to store params as bloc
24 lines (16 loc) • 411 B
JavaScript
import Bunyan from 'bunyan';
const log = Bunyan.createLogger({name: "Stack"});
import { STACK, NONE } from '../constants/types';
import Collection from './collection';
class Stack extends Collection {
TYPE = STACK;
_add(value, _value) {
value.push(_value);
return value;
}
_next(value) {
const nextValue = value.pop();
return { nextValue, value };
}
}
export default Stack;