{"_id":"d-dataweaver","_rev":"4-3bcffe7fdcac21fab8dcde5aab12cbee","name":"d-dataweaver","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"d-dataweaver","version":"0.0.1","description":"`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects toge","main":"build/index.js","scripts":{"build":"tsc -d","pretty":"prettier --write src/index.ts","lint":"eslint src/index.ts --fix","prepublish":"npm run build"},"author":{"name":"djansyle"},"license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.57.0","esbuild":"^0.17.14","eslint":"^8.37.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.7","typescript":"^5.0.2"},"types":"./build/index.d.ts","gitHead":"6d04c46d2cfb1de074ffb7be2d0a85361cae2f14","_id":"d-dataweaver@0.0.1","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-xvrmANR1P4LEb2gdqrjQgD4w+9JXpeOJbp/r5wW/AX45B+mcpDqWQI8lDrMofpn6Nd1TlQoDt4J/wP7YQqkPTw==","shasum":"33e064aa118f4e01e603a93ddb09c1cccfd4d48a","tarball":"https://registry.npmjs.org/d-dataweaver/-/d-dataweaver-0.0.1.tgz","fileCount":4,"unpackedSize":8476,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFx+zZI5X3JYb3iHbahdIQ2XecdjrwAnWW5MBbnGi8OAIgSneoOUu9ZUY8BwuwEzyiucoGGWF7KY1c7qa5+xOC9+U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJP63ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOEw/7B3Os08jvg+FOroTRKwONEyXF9NqjsBnwUlvY3MycJCsbwMAC\r\nAJGlukJQxHNiieiiZxap29nvHMBZ2SeWKVdsIMX8mao2O7Qcd4dV3NUx3AeD\r\nwGSWwIKm5n0UOpsQH8eiGjEQQbG15zWX+m12/k1OnegLBvaJzKMr0QiKZjtF\r\nbs8z98/RJtFZQ3zxjk4ZO4E0ZMWQWZRjaXpGZo6/09ypdXH596pHkFR+CJYU\r\nYwkXCKw5XwhQHs1i0gBu5ntLnsr3/+4yYudJfL7Zz0vb96HuD9qEnMQLLg96\r\nprNHK/IvXdZhukh4OQoa9YjtzNIW2BVK++BlsihHXxhn14+uyp0gTqn6GCRu\r\nxn+rM172F14sSqmcpHyQ4n8/waJfJs0G8+dYeUIjObZMUAhuNrOZA01KoerC\r\nnFPzZIbqF2meErf02udt3IYz+gMylbpMWn5tnJbWy3pHK2YWeNlGVB9yaFpw\r\nyWsCbAR7AMTwqdlrLY44SP1fj2hV4qjVXU6VHUjG15ADjCxufQ20MvBOuh2K\r\nY3MmBsrJB9INNyhW+w/wTS9o2Si7wd7tedUnIEcJJ87ZXs5G3oxGYPJdGJVa\r\nQ33P6/QFO6UL33ozMowHDUGUiKeZksPs3oouFqvvrgfflSC4R832WhbURjNO\r\ngoZef2reVhuMf2IRNmhG1ZX9qWOJXpXD5jI=\r\n=lYFA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"djansyle","email":"djansyledjans@gmail.com"},"directories":{},"maintainers":[{"name":"djansyle","email":"djansyledjans@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-dataweaver_0.0.1_1680146103669_0.31319722994405197"},"_hasShrinkwrap":false},"0.0.2":{"name":"d-dataweaver","version":"0.0.2","description":"`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects toge","main":"build/index.js","keywords":["dataweaver","data","relationship","data-relationship","data-relationship-graph","graph","data-graph","data-relationship-graph","object","object-relationship","object-relationship-graph"],"scripts":{"build":"tsc -d","pretty":"prettier --write src/index.ts","lint":"eslint src/index.ts --fix","prepublish":"npm run build"},"author":{"name":"djansyle"},"license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.57.0","esbuild":"^0.17.14","eslint":"^8.37.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.7","typescript":"^5.0.2"},"types":"./build/index.d.ts","gitHead":"7875210edaa3b34aa9e9d8b0325132df76b21311","_id":"d-dataweaver@0.0.2","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-rlXPGaqBRkvKKRCTQ+BODQMD0JZ5bYBdzKym5JwDdX06MiQmEBsX75m6XpvBLpOpYxULupzZMCcAfHHhtcSSPA==","shasum":"232253bf9270b80cea4287ec338346bc7e4cee0c","tarball":"https://registry.npmjs.org/d-dataweaver/-/d-dataweaver-0.0.2.tgz","fileCount":4,"unpackedSize":8732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLTDdDdKBydr80YClKvjnzRH/pWq3ziNrJIg+ZoDhX2wIhAM7DFj83/qm91JXkiehUjfghoyrokIQa38E/LrdYwyVa"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJSCYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr53Q/9HolE4emfM5UtK1wZpYTgOFURnNI2wGVExF30PvZ1o5MeiLlo\r\neQxVmlD1l74czLNWr7Q+yPceMezyCuIK9waGadpvLh+f9V+uiBcQnetfKkS6\r\nbrIh4VbH4FYKdsD+8s+pj/D4CmV4CjwB6lwK9p1YNJbV+cBnYWkkW5wdD8/j\r\nWL4THLT4k7RdZLMZokF9jfat83PMAW+XR7mPdrYC1M8rJVEjsgCNutXGOwZg\r\nlk6iUfQZUw2gYvAnMEHC6d8ZhKnkOkq5uRdXW+omGEY7QoIVeY/Ul3InT7px\r\npKboLmlV5TxEqXEGyibmaj0Ql5dFK+N9s8/ufwXMRHSDu/rZO1rd3JYeIHCn\r\nwqa4NrW0pVzuwabltc+ZQktYXx8o0NEZTW5yXFSZFj9RF/bxlfwTXCPYRyzH\r\nchaW9JioKl2V9vCtwNlQmDKBT4XgBHoq4PopUm7eDLqAEXYxjEWJpCqOjHoz\r\nSbyYxSPcn1C3jx5GKSFdTQOph7ToZlql+ITzkiFCG+SPv+plKxL8WbVklyxm\r\nM5m+bbKGdhMmyqRFIWaxlnSuB1KYEpUbigpx2DivH+SQMOM0Ut4Ys2RhTSfg\r\ndNptBO2j6siJy68GG4jNhqbyTCXDg3XtfsU+C0hRhZ3HRKicw5tz5ipDnR5t\r\n0TEXlnsHkix+6rTkHsWrEpGcU1cmoS6+QCo=\r\n=O30D\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"djansyle","email":"djansyledjans@gmail.com"},"directories":{},"maintainers":[{"name":"djansyle","email":"djansyledjans@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-dataweaver_0.0.2_1680154775989_0.421493883438093"},"_hasShrinkwrap":false},"0.0.3":{"name":"d-dataweaver","version":"0.0.3","description":"`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects toge","main":"build/index.js","keywords":["dataweaver","data","relationship","data-relationship","data-relationship-graph","graph","data-graph","data-relationship-graph","object","object-relationship","object-relationship-graph"],"scripts":{"build":"tsc -d","pretty":"prettier --write src/index.ts","lint":"eslint src/index.ts --fix","prepublish":"npm run build"},"author":{"name":"djansyle"},"license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.57.0","esbuild":"^0.17.14","eslint":"^8.37.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.7","typescript":"^5.0.2"},"types":"./build/index.d.ts","gitHead":"c935f6d78b20be7bf48bb6620380e49b76b6271f","_id":"d-dataweaver@0.0.3","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-nK5/vNgUsGvpp9jKdX9KX27Y7JpyZwZhRl3k2PPGDYwA4QGgSbaH0sFGQUPlOBIPwZIW4DWBogSzl7YoCKO4yQ==","shasum":"3ae69ca1d1b5973cbb2566f5950a98e94b8e3340","tarball":"https://registry.npmjs.org/d-dataweaver/-/d-dataweaver-0.0.3.tgz","fileCount":4,"unpackedSize":8732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGLtWpDUiE/9x7U95uFGnrZ+Rf4WOru910S1gd0PvbQUAiB6ZigkO+ZDtoCWXJOpMIA5Itq0MgOpF9Pf8djLcm03xg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJSgQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRPRAAm89lY9TE9idzGY/bCORZaG/+BJ2rQ97Qr5Zmwo/YkxnHGSpJ\r\nvzGRZuGZMJgGJbY3mdftBaHBzwhcWSKYLRBdsX8lVsiVe9kAuORt2D0OGH2Y\r\n30WcAlg24HWpNpnnBWZHntAX3ThWSUS0v8bXJbu0Hg3VWc5iOnLzu2qAcphc\r\nK9ifUS3hX9vZAoiWyoTIZcThHo0NPEUrIS5cEubZVLJzBrChnXCkxie4DOcH\r\nH32XiUMwI3N12v85WvAVxO/QvtPhQ3qj+bkMeWGKfXnLZCncwUM/E8wd07/j\r\nIqt6TI5f0U4OBDJOY+Mh6f6UOAcC65YhM5sIsuz/BwqwnDq0B0GIC3TJfSEA\r\n0vMS6+jRLGAzt6Hp+NFjwCenvrAGArTNg83Ft2YXsdPc2AlY80amTt5mmJ0T\r\nVJJ3PzMsTcyMAnswnoJ82vt5SrCuljjmZZyiw/GQF5FK7uDNEWEzA3XuY2vq\r\nEX7ohBLThfrlyyHNllcO0ZhOtIYAW+2otEDsuU5MtXTfZoFu2ky0rG/I95Hq\r\nhu7m5LRiaFE0J7OFdpabHtTB5z13Ib6lB6/MDPWlEiLctfFYGdGrA018QSxU\r\nT9di3lLIlPTAwJ9Yv/S3fuRid5CVBaz1DArIPvVnGe+jqzp4A0/JF2zNvJnR\r\n9NFuzrg3vFIkJfC2SIFyKhX189pTS905zcg=\r\n=xqqK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"djansyle","email":"djansyledjans@gmail.com"},"directories":{},"maintainers":[{"name":"djansyle","email":"djansyledjans@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-dataweaver_0.0.3_1680156687871_0.6808718796663256"},"_hasShrinkwrap":false},"0.0.4":{"name":"d-dataweaver","version":"0.0.4","description":"`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects toge","main":"build/index.js","types":"build/index.d.ts","keywords":["dataweaver","data","relationship","data-relationship","data-relationship-graph","graph","data-graph","data-relationship-graph","object","object-relationship","object-relationship-graph"],"scripts":{"build":"tsc","pretty":"prettier --write src/index.ts","lint":"eslint src/index.ts --fix","prepublish":"npm run build"},"author":{"name":"djansyle"},"license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.57.0","esbuild":"^0.17.14","eslint":"^8.37.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.7","typescript":"^5.0.2"},"gitHead":"76c3f7779c50a0cbc31f55227207ab44de860110","_id":"d-dataweaver@0.0.4","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-H6XGAh7UchXL4oXUqd+g5a327739mhfKcYE1NZbZsiwryNV12oB4CQz7J68a3uFhyLB7XyrFuuPhat2oU/YabQ==","shasum":"a1fc5dced2e8bfad3d0414518c6a571d74861347","tarball":"https://registry.npmjs.org/d-dataweaver/-/d-dataweaver-0.0.4.tgz","fileCount":5,"unpackedSize":9862,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmOWokh10kDp0XdBK44yhCRVTEBRpEEV5wRjYWsqtNUAiEAms4Y5fv2eqUntl4wx5O79j9W0DGEVuDA4ae1WOpxI/Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJXAQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjTBAAlHlsjSuLJ/g1fhH1WAcHraEjIwL1ZiyqbTPPbfW/LJJedJv8\r\n+bgDPZumJw6/JRh4CFNN4/ZGUIvwG3QhAB5rQZ/PjgfSVA8Yzoo1NNFTDqOs\r\nSiXXdjef6piEr/eO6N2pU+uaQPSyqi1O8ZQfMowH+REDnpkyAXcyt5vbRt+q\r\nqzk/rf0/2wWjzweRXW4ZRXP1SsiZQOw1rPgrGIQqePgfAnuK5oy5D3YescHN\r\ni7ml04Lzuyhero80GbSVvn0sXzR0T3m11bsLviUeHUkbFHGm47+WefJw7GIw\r\nKajRx/MG3j2TPjlVVfYoWCnnpQMnwfLQHiO+GVNTAsfSqVvwFH0Be2d+3yR9\r\nQPQpJlojJWEQLCUyqIwcwGDKQ2WHDcs+z54IitueXUUNjkFo1AM/mtNROQ/y\r\nEeSC4tAcUSFCFwfQr5QyXs9wSeC2MH8GXrLVVO8xM/OhqATfy2ccsXMLJ0el\r\nUuweJrlo8S2b7/djtHFyWHdk35DxwCRbMjC+wE0BZZzvJtBDX+JDsHjnBP5Q\r\n6I38qtXSP1iLzjCHCTTsnQEKDIm04FAhMWOBiA33Iqz9nOhFiMWDLeZ5N7JO\r\nUKtbQUscP5FSkytJbstn3Owru8f17OlyBhUrBQRl6EtIo94pjK+CBV70NU7M\r\nd0oB8gPKWEoLzZJ7jbRIPdaSyIK6zBXoKeE=\r\n=rwqb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"djansyle","email":"djansyledjans@gmail.com"},"directories":{},"maintainers":[{"name":"djansyle","email":"djansyledjans@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-dataweaver_0.0.4_1680175120619_0.027137671665329544"},"_hasShrinkwrap":false},"0.0.5":{"name":"d-dataweaver","version":"0.0.5","description":"`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects toge","main":"build/index.js","types":"build/index.d.ts","keywords":["dataweaver","data","relationship","data-relationship","data-relationship-graph","graph","data-graph","data-relationship-graph","object","object-relationship","object-relationship-graph"],"scripts":{"build":"rimraf build && tsc","pretty":"prettier --write src/index.ts","lint":"eslint src/index.ts --fix","prepublish":"npm run build","test":"jest"},"author":{"name":"djansyle"},"license":"MIT","devDependencies":{"@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.57.0","esbuild":"^0.17.14","eslint":"^8.37.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","prettier":"^2.8.7","rimraf":"^4.4.1","ts-jest":"^29.1.0","typescript":"^5.0.2"},"gitHead":"6c033bee707cc481379e4a5e84a1a3a00a75cd27","_id":"d-dataweaver@0.0.5","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-y8zjQcvs6i4QCmB3EYhvAJyMJ9GEiHKYe4ziUCItuQhEwfXMqM0s0et+X9Vawv3UoIcNxAsD0ktpTBTR3l4CzQ==","shasum":"fab467193abdebd33870b3683c7a9626f6af6c28","tarball":"https://registry.npmjs.org/d-dataweaver/-/d-dataweaver-0.0.5.tgz","fileCount":4,"unpackedSize":9122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIClRwVIf/xocAVe0Z/fZsppXSByAnozMcI+btMLSZ0mUAiEA1rwLcREwNhti7AuMoTyxFiFk0Mm/C7d8nVh/ZlNyur4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLC1pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRug//QFHRF7BxEKJfFSGS7Z0Z6PUKjaOowygqhxiU8XzSk5mlzkuE\r\n1yy/jkFHibilUtblE+2WRYFHg83oyfa8dU0wQfsuyGYrmjAI6uV2X7ImGWFk\r\nUzr5o6U4R+JkzLHi29rFkTnWRDfwWUuMjkn6cqNqbHkKjRv3zNB5qDrZfuhN\r\n2yj7TG/GGn33UsGyuir/u3XKdv6aTWyXA8jJIMjrgOhh/3HVIorMV1B644Uo\r\nzKaadtj3iYPdrCJNaI6r1Dth5Czdjh4+xbI6ZZJjkvBpITV0zPUof2QHGb3+\r\nn9ECLCy9Q1JD0ReEJmuuB0gesriASsfFHGoPKl9HZna4P7NPJTRsueckVPU/\r\ngxwNvg162OTO0LpTRpSgfEbI81dzUkGMPVCQRzFF9UZuaTc0YcNfPWDdrtO2\r\n4VyXos5dIBVrAWSJAF1LIqE1muhhULMy+SwcpLvr7Tt3eElQDXhK9LbrMFW2\r\nuqh7+IVNk1yqSZiWy9XJ3B6ETUlGfN035MuVKCvno/WRGje0XhvBDxPc45yy\r\nw9Eextlu2/8DW3FU7fGYdBL7bUSe+ZE1jsW6TqUTHnw9yF8oN87aRz3G44u3\r\n0nC4woVs24tRPD8j8WR2pyYT5Cywq4YYq26l2GO2FuxJf3Ds/Kneq8i0GMsb\r\n26GLz3+Rot97MG2SxtnYMkZCjInb4h9ime4=\r\n=9KsC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"djansyle","email":"djansyledjans@gmail.com"},"directories":{},"maintainers":[{"name":"djansyle","email":"djansyledjans@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-dataweaver_0.0.5_1680616809092_0.2550196740482791"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-30T03:15:03.669Z","0.0.1":"2023-03-30T03:15:03.814Z","modified":"2023-04-04T14:00:09.392Z","0.0.2":"2023-03-30T05:39:36.148Z","0.0.3":"2023-03-30T06:11:28.042Z","0.0.4":"2023-03-30T11:18:40.749Z","0.0.5":"2023-04-04T14:00:09.287Z"},"maintainers":[{"name":"djansyle","email":"djansyledjans@gmail.com"}],"description":"`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects toge","author":{"name":"djansyle"},"license":"MIT","readme":"# DataWeaver\n`DataWeaver` is a JavaScript library for weaving together multiple data objects into a single data structure. It provides a declarative way to define objects, link attributes between objects, and generate a final data structure by merging the objects together.\n\nIt allows you to keep your data modular and composed, while still generating flattened data structures for consumption. This enables loose coupling between data sources and flexible generation of customized data representations from a single data model.\n\n## Installation:\nTo install this module, you can use npm by running the following command in your terminal:\n\n```sh\nnpm install d-dataweaver\n```\n\nor with yarn:\n```sh\nyarn add d-dataweaver\n```\n\n## Usage:\nTo use this module, you will need to import it into your TypeScript file:\n\n```typescript\nimport { WeaveObject, DataWeaver } from 'd-dataweaver';\n```\n\nor using the `CommonJS`\n\n```javascript\nconst { WeaveObject, DataWeaver } = require('d-dataweaver');\n```\n\nHere is an example usage how you can utilize the classes.\n\n```typescript\nconst contact = WeaveObject.fromObject<{\n  full_contact: string;\n  name: string;\n}>(\n  {\n    full_contact: () => '+1234567890',\n    name: () => 'John Doe',\n  },\n  'contact',\n);\n\nconst user1 = WeaveObject.fromObject<{\n  phone_number: string;\n  user_id: string;\n}>(\n  {\n    phone_number: () => '', // will be overwritten upon linking\n    user_id: () => `${Math.random().toString(36).split('.')[1]}`,\n  },\n  'user1',\n);\n\nconst user2 = user1.__clone('user2');\nconst user3 = user1.__clone('user3');\n\nconst connection = WeaveObject.fromObject<{\n  user_1: string;\n  user_2: string;\n}>(\n  {\n    user_1: () => '', // will be overwritten upon linking\n    user_2: () => '', // will be overwritten upon linking\n  },\n  'user_mapping',\n);\n\nconst data = new DataWeaver()\n  .add(contact, user1, user2, user3, connection)\n  .link(contact.__attribute('full_contact'), user1.__attribute('phone_number'))\n  .link(user1.__attribute('user_id'), connection.__attribute('user_1'))\n  .link(user2.__attribute('user_id'), connection.__attribute('user_2'))\n  .link(user3.__attribute('user_id'), connection.__attribute('user_2'))\n  .weave();\n\nconsole.dir(data);\n\n// output:\n{\n  contact: { full_contact: '+1234567890', name: 'John Doe' },\n  user1: { phone_number: '+1234567890', user_id: 'hsv7o644gid' },\n  user2: { phone_number: '', user_id: 'byjjyyt4kwm' },\n  user3: { phone_number: '', user_id: 'zr3yz0hq4tc' },\n  user_mapping: { user_1: 'hsv7o644gid', user_2: [ 'byjjyyt4kwm', 'zr3yz0hq4tc' ] }\n}\n```\n\n## API\nThe DataWeaver class contains methods for adding objects, linking attributes, and generating the final data structure.\n\n\n### `WeaveObject<T>`\nA WeaveObject represents a data object that can be woven with other WeaveObjects.\n\n#### `Constructor(obj: WObjectParam<T>, name: string)`\nCreates a new `WeaveObject` instance from a `WObjectParam` and a name.\n\n\n#### `__clone(name: string): WeaveObject<T>`\nCreates a new `WeaveObject` instance with the same properties and values as the original `WeaveObject`.\n\n#### `__generate(): T`\nGenerates an object with the properties and values of the `WeaveObject`, calling each property function to obtain its value.\n\n#### `__attribute(path: StringKeys<T>): WeaveAttribute<T>`\nReturns a `WeaveAttribute` instance for the specified path in the `WeaveObject`.\n\n### Properties\n#### `__name: string` - The name of the WeaveObject.\n\n### DataWeaver\nThe DataWeaver class is the core of the Weave library. It is responsible for managing the objects and links in the data graph and generating the final data output.\n\n#### `add(...obj: WeaveObject<any>[]): DataWeaver`\nAdds one or more WeaveObject instances to the data graph.\nReturns a new instance of DataWeaver containing the added objects.\n\n#### `link(from: WeaveAttribute<any>, to: WeaveAttribute<any>): DataWeaver`\nLinks two WeaveAttribute instances in the data graph.\nReturns a new instance of DataWeaver containing the added link.\n\n#### `weave(): any`\nGenerates the final data output by generating the objects and resolving the links in the data graph.\n\nReturns the final data output.","readmeFilename":"README.md","keywords":["dataweaver","data","relationship","data-relationship","data-relationship-graph","graph","data-graph","data-relationship-graph","object","object-relationship","object-relationship-graph"]}