UNPKG

functionalscript

Version:

FunctionalScript is a purely functional subset of JavaScript

22 lines (21 loc) 521 B
import { mapSet, mapDelete } from "./module.f.js"; export default { set: () => { const map = mapSet(new Map(), 'a', 'b'); if (map.get('a') !== 'b') { throw 'error'; } if (map.size !== 1) { throw 'error'; } }, delete: () => { const map = mapDelete(mapSet(new Map(), 'a', 'b'), 'a'); if (map.get('a') !== undefined) { throw 'error'; } if (map.size !== 0) { throw 'error'; } } };