electra2020.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. var EventEmitter = require("events").EventEmitter
  2. var _ = require("lodash");
  3. var async = require("async");
  4. function uberfactory(uuid, slugger) {
  5. var ignores = [
  6. "uninherits",
  7. "inherits",
  8. "unextends",
  9. "extends",
  10. "unisa",
  11. "isa",
  12. "relatesAsToWith",
  13. "test",
  14. "emita",
  15. "emitas",
  16. "data2",
  17. "getStuff",
  18. "pingup",
  19. "data",
  20. "metas2",
  21. "metas",
  22. "metas3",
  23. "exporta",
  24. "pickdeep",
  25. "withAllSync",
  26. "withAll",
  27. "innerExport",
  28. "exportFlatSync",
  29. "exportSync",
  30. "export2",
  31. "export",
  32. "domain",
  33. "_events",
  34. "rawListeners",
  35. "_maxListeners",
  36. "setMaxListeners",
  37. "getMaxListeners",
  38. "emit",
  39. "addListener",
  40. "on",
  41. "prependListener",
  42. "once",
  43. "prependOnceListener",
  44. "removeListener",
  45. "removeAllListeners",
  46. "listeners",
  47. "listenerCount",
  48. "eventNames",
  49. "_data", "path", "name", "children", "parents", "_inherits", "_extends", "_isa",
  50. "_hasa", "_relations", "_references", "_created", "_metas",
  51. "_rootname", "exportSerialised"
  52. ]
  53. return function factory(therootname) {
  54. var seed = therootname;
  55. var ROOT = new electra(therootname, true, false)
  56. function inner(name) {
  57. if (typeof(name) == "undefined") {
  58. return ROOT;
  59. }
  60. name = slugger(name);
  61. if (!ROOT.children[name]) {
  62. ROOT.children[name] = new electra(name);
  63. }
  64. return ROOT.children[name]
  65. }
  66. function electra(name, isroot, parent) {
  67. //name = slugger(name);
  68. this._data = {}
  69. this._metas = {};
  70. this.path = (parent ? parent.path : "") + name;
  71. this.name = name;
  72. //this._id = uuid();
  73. this.children = {};
  74. this.parents = {};
  75. this._inherits = {};
  76. this._extends = {};
  77. this._isa = {};
  78. this._hasa = {};
  79. this._relations = {};
  80. this._references = {};
  81. this._created = new Date();
  82. this._rootname = therootname;
  83. var self = this;
  84. if (parent) {
  85. this.parents[parent.name] = parent;
  86. this.path = parent.path + "/" + name
  87. }
  88. if (isroot) {
  89. this.isroot = true;
  90. return this;
  91. }
  92. function xinner(name) {
  93. var args = Array.prototype.slice.apply(arguments, [0]);
  94. if (args.length > 1) {
  95. return args.map(function(n) {
  96. return xinner(n)
  97. })
  98. }
  99. if (typeof(name) == "undefined") {
  100. return self;
  101. }
  102. name = slugger(name);
  103. if (name.indexOf("://") > -1) {
  104. if (!self.children[name]) {
  105. self.children[name] = new electra(name, false, self);
  106. self.pingup("created", self.children[name](), name)
  107. self.emit("added", name);
  108. }
  109. return self.children[name]
  110. }
  111. if (name.indexOf("/") > -1) {
  112. //its a path;
  113. var arr = name.split("/");
  114. var newname = arr.shift();
  115. if (!self.children[newname]) {
  116. self.children[newname] = new electra(newname, false, self);
  117. self.pingup("created", self.children[newname](), newname, arr)
  118. self.emit("added", newname);
  119. }
  120. return self.children[newname](arr.join("/"))
  121. }
  122. if (!self.children[name]) {
  123. self.children[name] = new electra(name, false, self);
  124. self.pingup("created", self.children[name](), name)
  125. }
  126. return self.children[name]
  127. }
  128. return xinner
  129. }
  130. electra.prototype.__proto__ = EventEmitter.prototype
  131. electra.prototype.inherits = function(obj_) {
  132. var obj = typeof(obj_) === "function" ? obj_() : typeof(obj_) === "object" ? obj_ : typeof(obj_) === "string" ? inner(obj_)() : false
  133. if (obj) {
  134. this._inherits[obj.path] = obj;
  135. obj._extends[this.path] = this;
  136. }
  137. return this;
  138. }
  139. electra.prototype.uninherits = function(obj_) {
  140. var obj = typeof(obj_) === "function" ? obj_() : typeof(obj_) === "object" ? obj_ : typeof(obj_) === "string" ? inner(obj_)() : false
  141. if (obj && this._inherits[obj.path]) {
  142. delete this._inherits[obj.path]
  143. delete obj._extends[this.path]
  144. }
  145. return this;
  146. }
  147. electra.prototype.extends = function(obj_) {
  148. var obj = typeof(obj_) === "function" ? obj_() : typeof(obj_) === "object" ? obj_ : typeof(obj_) === "string" ? inner(obj_)() : false
  149. if (obj) {
  150. this._extends[obj.path] = obj;
  151. obj._inherits[this.path] = this;
  152. }
  153. return this;
  154. }
  155. electra.prototype.unextends = function(obj_) {
  156. var obj = typeof(obj_) === "function" ? obj_() : typeof(obj_) === "object" ? obj_ : typeof(obj_) === "string" ? inner(obj_)() : false
  157. if (obj && this._extends[obj.path]) {
  158. delete this._extends[obj.path]
  159. delete obj._inherits[this.path]
  160. }
  161. return this;
  162. }
  163. electra.prototype.isa = function(elef) {
  164. var self = this;
  165. var args = Array.prototype.slice.apply(arguments, [0]);
  166. if (args.length > 1) {
  167. args.map(function(n) {
  168. var ele = typeof(n) === "function" ? n() : n;
  169. self._isa[ele.path] = ele
  170. ele._hasa[self.path] = self;
  171. self.pingup("isa", self, ele.path)
  172. ele.pingup("isa", self, ele.path)
  173. })
  174. } else {
  175. if (typeof(elef) === "object" && elef.length) {
  176. elef.map(function(n) {
  177. var ele = typeof(n) === "function" ? n() : n;
  178. self._isa[ele.path] = ele
  179. ele._hasa[self.path] = self;
  180. self.pingup("isa", self, ele.path)
  181. ele.pingup("isa", self, ele.path)
  182. })
  183. } else {
  184. var ele = typeof(elef) === "function" ? elef() : typeof(elef) === "object" ? elef : typeof(elef) === "string" ? inner(elef)() : false
  185. if (ele) {
  186. this._isa[ele.path] = ele
  187. ele._hasa[this.path] = this;
  188. self.pingup("isa", self, ele.path)
  189. ele.pingup("isa", self, ele.path)
  190. }
  191. }
  192. }
  193. return this;
  194. }
  195. electra.prototype.unisa = function(elef) {
  196. var self = this;
  197. var args = Array.prototype.slice.apply(arguments, [0]);
  198. if (args.length > 1) {
  199. args.map(function(n) {
  200. var ele = typeof(n) === "function" ? n() : n;
  201. delete self._isa[ele.path]
  202. delete ele._hasa[self.path]
  203. self.pingup("isa", self, ele.path)
  204. ele.pingup("isa", self, ele.path)
  205. })
  206. } else {
  207. if (typeof(elef) === "object" && elef.length) {
  208. elef.map(function(n) {
  209. var ele = typeof(n) === "function" ? n() : n;
  210. delete self._isa[ele.path]
  211. delete ele._hasa[self.path]
  212. self.pingup("isa", self, ele.path)
  213. ele.pingup("isa", self, ele.path)
  214. })
  215. } else {
  216. var ele = typeof(elef) === "function" ? elef() : elef;
  217. delete this._isa[ele.path]
  218. delete ele._hasa[this.path]
  219. self.pingup("isa", self, ele.path)
  220. ele.pingup("isa", self, ele.path)
  221. }
  222. }
  223. return this;
  224. }
  225. electra.prototype.relatesAsToWith = function(relationout, elef, relationto, withstuff) {
  226. var self = this;
  227. if (typeof(relationto) === "undefined") {
  228. relationto = relationout;
  229. }
  230. if (typeof(withstuff) === "undefined") {
  231. withstuff = "";
  232. }
  233. var withstuffOut = Object.assign({
  234. "out": relationout,
  235. "in": relationto
  236. }, withstuff);
  237. var withstuffTo = Object.assign({
  238. "in": relationout,
  239. "out": relationto
  240. }, withstuff);
  241. if (typeof(elef) === "object" && elef.length) {
  242. elef.map(function(n) {
  243. var ele = typeof(n) === "function" ? n() : n;
  244. self._relations[relationout] = self._relations[relationout] || {}
  245. self._relations[relationout][ele.path] = {
  246. ref: ele,
  247. context: withstuffOut
  248. }
  249. ele._relations[relationto] = ele._relations[relationto] || {}
  250. ele._relations[relationto][self.path] = {
  251. ref: self,
  252. context: withstuffTo
  253. }
  254. })
  255. } else {
  256. var ele = typeof(elef) === "function" ? elef() : elef;
  257. self._relations[relationout] = self._relations[relationout] || {}
  258. self._relations[relationout][ele.path] = {
  259. ref: ele,
  260. context: withstuffOut
  261. }
  262. ele._relations[relationto] = ele._relations[relationto] || {}
  263. ele._relations[relationto][self.path] = {
  264. ref: self,
  265. context: withstuffTo
  266. }
  267. }
  268. return this;
  269. }
  270. electra.prototype.test = function() {
  271. return this;
  272. }
  273. electra.prototype.emita = function() {
  274. var self = this;
  275. var args = Array.prototype.slice.apply(arguments, [0]);
  276. var kk = _.keys(this.parents);
  277. if (kk.length > 0) {
  278. kk.map(function(k) {
  279. self.parents[k].emita.apply(self.parents[k], args)
  280. })
  281. } else {}
  282. var kk = _.keys(this.children);
  283. if (kk.length > 0) {
  284. kk.map(function(k) {
  285. //self.children[k].emita.apply(self.children[k],args)
  286. })
  287. } else {}
  288. /* _.map(this.children,function(child,name){
  289. child().emita.apply(child(),args);
  290. }) **/
  291. }
  292. electra.prototype.emitas = function() {
  293. var self = this;
  294. var args = Array.prototype.slice.apply(arguments, [0]);
  295. var kk = _.keys(this.parents);
  296. if (kk.length > 0) {
  297. kk.map(function(k) {
  298. self.parents[k].emita.apply(self.parents[k], args)
  299. })
  300. } else {}
  301. var kk = _.keys(this.children);
  302. if (kk.length > 0) {
  303. kk.map(function(k) {
  304. //self.children[k].emita.apply(self.children[k],args)
  305. })
  306. } else {}
  307. /* _.map(this.children,function(child,name){
  308. child().emita.apply(child(),args);
  309. }) **/
  310. }
  311. electra.prototype.data2 = function(key, value) {
  312. var self = this;
  313. if (typeof(key) === "undefined") {
  314. return this._data;
  315. } else {
  316. if (typeof(value) === "undefined") {
  317. if (typeof(key) === "object") {
  318. var oldvalue = this._data;
  319. this._data = Object.assign(this._data, key);
  320. _.map(this.parents, function(par, nam) {
  321. par.emit("changed", self, "[[object]]", self._data, oldvalue);
  322. })
  323. this.emit("changed", this, "[[object]]", this._data, oldvalue);
  324. return this;
  325. } else {
  326. return this._data[key];
  327. }
  328. } else {
  329. var oldvalue = this._data[key];
  330. this._data[key] = value;
  331. _.map(this.parents, function(par, nam) {
  332. par.emit("changed", self, key, value, oldvalue);
  333. })
  334. this.emit("changed", this, key, value, oldvalue);
  335. return this._data[key];
  336. }
  337. }
  338. }
  339. electra.prototype.getStuff = function(stuff, applybefore, named_, dd) {
  340. var named = named_ || "data";
  341. var dd = dd || false;
  342. var obj = {
  343. name: this.path,
  344. from: named,
  345. data: applybefore(getpath(this, stuff))
  346. }
  347. var arr = [obj];
  348. if (dd) {
  349. return arr
  350. }
  351. arr = [].concat.apply(arr, _.map(this._inherits, function(par, nam) {
  352. return par.getStuff.apply(par, [stuff, applybefore, "inherit_" + named_]);
  353. }))
  354. arr = [].concat.apply(arr, _.map(this.parents, function(par, nam) {
  355. return par.getStuff.apply(par, [stuff, applybefore, "parent_" + named_]);
  356. }))
  357. arr = [].concat.apply(arr, _.map(this._isa, function(par, nam) {
  358. return par.getStuff.apply(par, [stuff, applybefore, "isa_" + named_, true]);
  359. }))
  360. arr = arr.filter(function(a) {
  361. return a.data ? a.data.length > 0 : false
  362. });
  363. return arr
  364. }
  365. electra.prototype.pingup = function() {
  366. var args = Array.prototype.slice.apply(arguments, [0]);
  367. _.map(this.parents, function(par, nam) {
  368. return par.pingup.apply(par, args);
  369. })
  370. this.emit.apply(this, args);
  371. }
  372. electra.prototype.data = function(key, value) {
  373. var self = this;
  374. if (typeof(key) === "undefined") {
  375. return this._data;
  376. } else {
  377. if (typeof(value) === "undefined") {
  378. if (typeof(key) === "object") {
  379. var oldvalue = this._data;
  380. this._data = Object.assign(this._data, key);
  381. this.pingup("changed", self, "[[object]]", self._data, oldvalue)
  382. return this;
  383. } else {
  384. return this._data[key];
  385. }
  386. } else {
  387. var oldvalue = getpath(this._data, key); //this._data[key];
  388. setpath(this._data, key, value)
  389. // this._data[key] = value;
  390. this.pingup("changed", self, key, value, oldvalue)
  391. return getpath(this._data, key); //this._data[key];
  392. }
  393. }
  394. }
  395. electra.prototype.metas = function(key, value) {
  396. var self = this;
  397. if (typeof(key) === "undefined") {
  398. return this._metas;
  399. } else {
  400. if (typeof(value) === "undefined") {
  401. if (typeof(key) === "object") {
  402. var oldvalue = this._metas;
  403. this._metas = Object.assign(this._metas, key);
  404. this.pingup("changed:meta", self, "[[object]]", self._metas, oldvalue)
  405. return this;
  406. } else {
  407. return this._metas[key];
  408. }
  409. } else {
  410. var oldvalue = this._metas[key];
  411. this._metas[key] = value;
  412. this.pingup("changed:meta", self, key, value, oldvalue)
  413. return this._metas[key];
  414. }
  415. }
  416. }
  417. /* electra.prototype.metas = function() {
  418. var self = this;
  419. var args = Array.prototype.slice.apply(arguments, [0]);
  420. if (args.length === 0) {
  421. return this._metas;
  422. }
  423. args.map(function(obj_) {
  424. var obj = typeof(obj_) === "function" ? obj_() : typeof(obj_) === "object" ? obj_ : typeof(obj_) === "string" ? inner(obj_)() : false
  425. if (obj) {
  426. self._metas.push({
  427. "meta": obj,
  428. "data": {}
  429. })
  430. }
  431. })
  432. return this;
  433. }
  434. electra.prototype.metas3 = function(arr) {
  435. var self = this;
  436. self._metas = self._metas.concat(arr);
  437. return self;
  438. }
  439. */
  440. electra.prototype.exporta = function(path) {
  441. this.export(path, function(err, arr) {
  442. // console.log("EXPORTED", err, JSON.stringify(arr, true, 2));
  443. })
  444. }
  445. electra.prototype.pickdeep = function(prop, cb) {
  446. var self = this;
  447. async.mapLimit(this.children, 10, function(obj, next) {
  448. //setTimeout(function(){
  449. obj().pickdeep(prop, next)
  450. //},1)
  451. // next(null,)
  452. }, function(err, collect) {
  453. cb(err, [].concat.apply([self[prop]], collect));
  454. })
  455. return this;
  456. }
  457. electra.prototype.withAllSync = function(func, cb) {
  458. var self = this;
  459. async.mapLimit(this.children, 10, function(obj, next) {
  460. //setTimeout(function(){
  461. obj().withAllSync(func, next)
  462. //},1)
  463. // next(null,)
  464. }, function(err, collect) {
  465. cb(err, [].concat.apply([func(self)], collect));
  466. })
  467. return this;
  468. }
  469. electra.prototype.withAll = function(func, cb) {
  470. var self = this;
  471. async.mapLimit(this.children, 10, function(obj, next) {
  472. obj().withAll(func, next)
  473. }, function(err, collect) {
  474. func(self, function(err2, result) {
  475. cb(err || err2, [].concat.apply([result], collect));
  476. })
  477. })
  478. return this;
  479. }
  480. electra.prototype.exportSync = function(path, serializers) {
  481. var self = this;
  482. var obj = self.innerExport(path, serializers);
  483. var collect = _.map(self.children, function(child, name) {
  484. return child().exportSync(path + "/" + name, serializers)
  485. })
  486. collect.sort(function(a, b) {
  487. return a.name > b.name ? 1 : a.name < b.name ? -1 : 0
  488. })
  489. obj.children = collect;
  490. return obj;
  491. }
  492. electra.prototype.exportFlatSync = function(path) {
  493. var self = this;
  494. return [].concat.apply([self.innerExport(path)], _.map(self.children, function(child, name) {
  495. return child().exportFlatSync(path + "/" + name)
  496. }))
  497. }
  498. electra.prototype.export2 = function(path, cb) {
  499. var self = this;
  500. var obj = self.innerExport(path);
  501. obj.children = _.map(self.children, function(a, n) {
  502. return a().path
  503. });
  504. cb(null, obj);
  505. }
  506. electra.prototype.innerExport = function(path, serializers) {
  507. var self = this;
  508. var obj = {};
  509. // obj._id = self._id;
  510. obj.name = self.name;
  511. obj.path = self.path;
  512. obj.created = self._created.toJSON();
  513. obj.data = self._data;
  514. obj.meta = self._metas;
  515. obj.inherits = _.map(self._inherits, function(a, n) {
  516. return a.path
  517. });
  518. obj.extends = _.map(self._extends, function(a, n) {
  519. return a.path
  520. });
  521. /*obj.parents = _.map(self.parents, function(a, n) {
  522. return a.path
  523. });*/
  524. obj.isa = _.map(self._isa, function(a, n) {
  525. return a.path
  526. });
  527. /*obj.hasa = _.map(self._hasa, function(a, n) {
  528. return a.path
  529. });*/
  530. obj.rel = {};
  531. _.map(self._relations, function(a, n) {
  532. obj.rel[n] = {}
  533. _.map(a, function(aa, nn) {
  534. obj.rel[n][aa.ref.path] = aa.context;
  535. });
  536. });
  537. //clean up
  538. obj.inherits = obj.inherits.length ? obj.inherits : undefined;
  539. obj.extends = obj.extends.length ? obj.extends : undefined;
  540. //obj.parents = obj.parents.length ? obj.parents : undefined;
  541. obj.isa = obj.isa.length ? obj.isa : undefined;
  542. //obj.hasa = obj.hasa.length ? obj.hasa : undefined;
  543. obj.data = _.size(obj.data) ? obj.data : undefined;
  544. obj.meta = _.size(obj.meta) ? obj.meta : undefined;
  545. obj.rel = _.size(obj.rel) ? obj.rel : undefined;
  546. _.keys(obj).map(function(k) {
  547. if (obj[k] === undefined) {
  548. delete obj[k];
  549. //obj[k] = null /* nope */
  550. }
  551. })
  552. var therest = _.omit(self, ignores);
  553. //seriadeep(therest, obj, serializers,1);
  554. _.map(therest, function(val, ke) {
  555. if (typeof(val) === "function") {
  556. obj[ke] = "$$$FUNCTION$$$" + val;
  557. } else {
  558. if (serializers && serializers[ke]) {
  559. obj[ke] = serializers[ke](val);
  560. } else {
  561. _.map(val,function(cval,cprop){
  562. })
  563. obj[ke] = val;
  564. }
  565. }
  566. })
  567. return obj
  568. }
  569. function seriadeep(rest, obj, serializers,one) {
  570. if(one>2){return }
  571. _.map(rest, function(val, ke) {
  572. if (typeof(val) === "function") {
  573. obj[ke] = "$$$FUNCTION$$$" + val;
  574. } else if (typeof(val) === "object") {
  575. obj[ke] = seriadeep(val, obj, serializers, (one||1) +1);
  576. } else {
  577. if (serializers && serializers[ke]) {
  578. obj[ke] = serializers[ke](val)
  579. } else {
  580. obj[ke] = val;
  581. }
  582. }
  583. })
  584. }
  585. electra.prototype.exportSerialised = function(serializers) {
  586. var self = this;
  587. return function(path, cb) {
  588. async.mapLimit(this.children, 10, function(obj, next) {
  589. obj().exportSerialised(serializers)(path + obj().name, next)
  590. // next(null,)
  591. }, function(err, collect) {
  592. var obj = self.innerExport(path, serializers);
  593. collect.sort(function(a, b) {
  594. return a.name > b.name ? 1 : a.name < b.name ? -1 : 0
  595. })
  596. obj.children = collect;
  597. cb(err, obj);
  598. })
  599. return this;
  600. }
  601. }
  602. electra.prototype.export = function(path, cb) {
  603. var self = this;
  604. async.mapLimit(this.children, 10, function(obj, next) {
  605. obj().export(path + obj().name, next)
  606. }, function(err, collect) {
  607. var obj = self.innerExport(path);
  608. if (collect.sort) {
  609. collect.sort(function(a, b) {
  610. return a.name > b.name ? 1 : a.name < b.name ? -1 : 0
  611. })
  612. }
  613. obj.children = collect;
  614. cb(err, obj);
  615. })
  616. return this;
  617. }
  618. return inner
  619. }
  620. }
  621. function getpath(obj, path) {
  622. path = path || "";
  623. var arr = path.split(".");
  624. var t = obj;
  625. var done = false;
  626. if (arr.length) {
  627. while (arr.length && !done) {
  628. var check = arr.shift();
  629. if (check !== "") {
  630. t = t[check];
  631. }
  632. if (typeof t !== "object") {
  633. done = true;
  634. }
  635. }
  636. }
  637. return t;
  638. }
  639. function setpath(obj, path, value) {
  640. if (typeof obj !== "object" || !obj) {
  641. throw new Error("obj is not Object");
  642. }
  643. if (typeof path !== "string" || path === "") {
  644. throw new Error("path must be string with length > 0");
  645. }
  646. var arr = path.split(".");
  647. var done = false;
  648. var t = obj;
  649. if (arr.length > 1) {
  650. while (arr.length && t && !done) {
  651. var check = arr.shift();
  652. if (typeof t[check] === "object" && arr.length > 0) {
  653. t = t[check];
  654. } else {
  655. done = true;
  656. arr.unshift(check);
  657. }
  658. }
  659. var xt = t;
  660. while (arr.length) {
  661. var tt = arr.shift();
  662. if (arr.length) { //go deeper
  663. xt = xt[tt] = {};
  664. } else {
  665. //last
  666. xt[tt] = value;
  667. }
  668. }
  669. } else {
  670. if (arr.length === 1 && arr[0] !== "") {
  671. t[arr[0]] = value;
  672. }
  673. }
  674. }
  675. uberfactory.ignores = ignores = [
  676. "inherits",
  677. "uninherits",
  678. "unextends",
  679. "extends",
  680. "isa",
  681. "unisa",
  682. "relatesAsToWith",
  683. "test",
  684. "emita",
  685. "emitas",
  686. "data2",
  687. "getStuff",
  688. "pingup",
  689. "data",
  690. "metas2",
  691. "metas",
  692. "metas3",
  693. "exporta",
  694. "pickdeep",
  695. "withAllSync",
  696. "withAll",
  697. "innerExport",
  698. "exportFlatSync",
  699. "exportSync",
  700. "export2",
  701. "export",
  702. "domain",
  703. "_events",
  704. "rawListeners",
  705. "_maxListeners",
  706. "setMaxListeners",
  707. "getMaxListeners",
  708. "emit",
  709. "addListener",
  710. "on",
  711. "prependListener",
  712. "once",
  713. "prependOnceListener",
  714. "removeListener",
  715. "removeAllListeners",
  716. "listeners",
  717. "listenerCount",
  718. "eventNames",
  719. "_data", "path", "name", "children", "parents", "_inherits", "_extends", "_isa",
  720. "_hasa", "_relations", "_references", "_created", "_metas",
  721. "_rootname", "exportSerialised"
  722. ]
  723. module.exports = uberfactory;