mirror of
https://github.com/tvytlx/ai-agent-deep-dive.git
synced 2026-04-04 16:14:50 +08:00
13 lines
290 B
JavaScript
13 lines
290 B
JavaScript
/* jshint esversion: 6 */
|
|
"use strict";
|
|
|
|
module.exports = class NodeList extends Array {
|
|
constructor(a) {
|
|
super((a && a.length) || 0);
|
|
if (a) {
|
|
for (var idx in a) { this[idx] = a[idx]; }
|
|
}
|
|
}
|
|
item(i) { return this[i] || null; }
|
|
};
|