This file is indexed.

/usr/lib/nodejs/tsame/index.js is in node-tap 11.0.0+ds1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
'use strict'

module.exports = shallow
shallow.strict = strict

// TODO a future version of this that drops node 0.x support will
// check for Symbol.iterator, and handle anything that can be passed
// to Array.from()

var hasSet = typeof Set === 'function'

function isSet (object) {
  return hasSet && (object instanceof Set)
}

function isMap (object) {
  return hasSet && (object instanceof Map)
}

function setSame (a, b) {
  var ret = a.size === b.size
  if (a.size && ret) {
    a.forEach(function (entry) {
      if (ret)
        ret = b.has(entry)
    })
  }
  return ret
}

function mapSame (a, b, ca, cb, fn) {
  var ret = a.size === b.size
  if (a.size && ret) {
    a.forEach(function (value, key) {
      if (ret)
        ret = b.has(key)
      if (ret)
        ret = fn(value, b.get(key), ca, cb)
    })
  }
  return ret
}

function isArguments (object) {
  return Object.prototype.toString.call(object) === '[object Arguments]'
}

function arrayFrom (obj) {
  return Array.isArray(obj) ? obj
    : Array.from ? Array.from(obj)
    : Array.prototype.slice.call(obj)
}

function strict (a, b) {
  return deeper(a, b, [], [])
}

function deeper (a, b, ca, cb) {
  return a === b ? true
    : a !== a ? b !== b
    : typeof a !== 'object' || typeof b !== 'object' ? false
    : a === null || b === null ? false
    : Buffer.isBuffer(a) && Buffer.isBuffer(b) ? bufferSame(a, b)
    : a instanceof Date && b instanceof Date ? a.getTime() === b.getTime()
    : a instanceof RegExp && b instanceof RegExp ? regexpSame(a, b)
    : isArguments(a) ?
      isArguments(b) && deeper(arrayFrom(a), arrayFrom(b), ca, cb)
    : isArguments(b) ? false
    : a.constructor !== b.constructor ? false
    : isSet(a) && isSet(b) ? setSame(a, b)
    : isMap(a) && isMap(b) ? mapSame(a, b, ca, cb, deeper)
    : deeperObj(a, b, Object.keys(a), Object.keys(b), ca, cb)
}

function deeperObj (a, b, ka, kb, ca, cb) {
  // don't bother with stack acrobatics if there's nothing there
  return ka.length === 0 && kb.length === 0 ? true
    : ka.length !== kb.length ? false
    : deeperObj_(a, b, ka, kb, ca, cb)
}

function deeperObj_ (a, b, ka, kb, ca, cb) {
  var ret = true

  var cal = ca.length

  var go = true
  while (cal-- && go) {
    if (ca[cal] === a) {
      ret = cb[cal] === b
      go = false
    }
  }

  if (go) {
    ca.push(a)
    cb.push(b)

    ka.sort()
    kb.sort()

    for (var j = ka.length - 1; j >= 0 && ret; j--) {
      if (ka[j] !== kb[j])
        ret = false
    }

    if (ret) {
      var key
      for (var k = ka.length - 1; k >= 0 && ret; k--) {
        key = ka[k]
        if (!deeper(a[key], b[key], ca, cb))
          ret = false
      }
    }

    if (ret) {
      ca.pop()
      cb.pop()
    }
  }

  return ret
}

function shallow (a, b) {
  return shallower(a, b, [], [])
}

function regexpSame (a, b) {
  return a.source === b.source &&
    a.global === b.global &&
    a.multiline === b.multiline &&
    a.lastIndex === b.lastIndex &&
    a.ignoreCase === b.ignoreCase
}

function bufferSame (a, b) {
  var ret
  if (a.equals) {
    ret = a.equals(b)
  } else if (a.length !== b.length) {
    ret = false
  } else {
    ret = true
    for (var j = 0; j < a.length && ret; j++) {
      if (a[j] != b[j])
        ret = false
    }
  }
  return ret
}

function shallower (a, b, ca, cb) {
  return typeof a !== 'object' && typeof b !== 'object' && a == b ? true
    : a === null || b === null ? a == b
    : a !== a ? b !== b
    : typeof a !== 'object' || typeof b !== 'object' ? false
    : Buffer.isBuffer(a) && Buffer.isBuffer(b) ? bufferSame(a, b)
    : a instanceof Date && b instanceof Date ? a.getTime() === b.getTime()
    : a instanceof RegExp && b instanceof RegExp ? regexpSame(a, b)
    : isArguments(a) || isArguments(b) ?
      shallower(arrayFrom(a), arrayFrom(b), ca, cb)
    : isSet(a) && isSet(b) ? setSame(a, b)
    : isMap(a) && isMap(b) ? mapSame(a, b, ca, cb, shallower)
    : shallowerObj(a, b, Object.keys(a), Object.keys(b), ca, cb)
}

function shallowerObj (a, b, ka, kb, ca, cb) {
  // don't bother with stack acrobatics if there's nothing there
  return ka.length === 0 && kb.length === 0 ? true
    : ka.length !== kb.length ? false
    : shallowerObj_(a, b, ka, kb, ca, cb)
}

function shallowerObj_ (a, b, ka, kb, ca, cb) {
  var ret

  var cal = ca.length
  var go = true
  while (cal-- && go) {
    if (ca[cal] === a) {
      ret = cb[cal] === b
      go = false
    }
  }

  if (go) {
    ca.push(a)
    cb.push(b)

    ka.sort()
    kb.sort()

    ret = true
    for (var k = ka.length - 1; k >= 0 && ret; k--) {
      if (ka[k] !== kb[k])
        ret = false
    }

    if (ret) {
      var key
      for (var l = ka.length - 1; l >= 0 && ret; l--) {
        key = ka[l]
        if (!shallower(a[key], b[key], ca, cb))
          ret = false
      }
    }

    if (ret) {
      ca.pop()
      cb.pop()
    }
  }

  return ret
}