UNPKG

293 BJavaScriptView Raw
1'use strict'
2
3var counter = 1
4
5function PatternSet (pattern, payload, isDeep) {
6 this.pattern = pattern
7 this.payload = payload || pattern
8 this.magic = 0
9
10 if (isDeep) {
11 this.magic = Object.keys(pattern).length
12 } else {
13 this.magic = counter++
14 }
15}
16
17module.exports = PatternSet