{"_id":"@dannywrayuk/describe-shape","_rev":"7-98ec8713504694c95defbd370a4396b9","name":"@dannywrayuk/describe-shape","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@dannywrayuk/describe-shape","description":"Runtime object shape descriptions","author":{"name":"dannywrayuk"},"version":"1.0.0","license":"ISC","main":"dist/index.js","homepage":"https://github.com/dannywrayuk/utilities/packages/describe-shape#readme","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilites.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.0","dist":{"shasum":"121cf0148b89c78682a7a13c678bf575524fc6ad","integrity":"sha512-uWsRS+tEqeV0z9NsQBoT6fUP9mte2z/8K7NrXv2oGjv7oM0xMCOMTCYFK9ulzDqQEG3YgLc7plJJE2R9NOotkQ==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.0.tgz","fileCount":12,"unpackedSize":6443,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFyg1sPXy/+L1HLxRbjRaFwqvhURGap4OE2+0QAW1dM+AiA6w5yh20OQ8FLs+UPEWQPsocFxKucRi9CyWxDOuxDHyQ=="}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.0_1685849598331_0.39886689886185756"},"_hasShrinkwrap":false},"1.0.1":{"name":"@dannywrayuk/describe-shape","description":"Runtime object shape descriptions","author":{"name":"dannywrayuk"},"version":"1.0.1","license":"ISC","main":"dist/index.js","homepage":"https://github.com/dannywrayuk/utilities/packages/describe-shape#readme","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilites.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.1","dist":{"shasum":"4371bcc35c1d11a4c1f7bf9af8468346ddb80ea2","integrity":"sha512-6ZoMgmMZ9iVL+Ko0P9ITNrUz7a653Dy1+tNiktdjqylOE3qnL9w/zSuIvfkuTxcPgp8L0a9DlJ4MrASjNB7XNw==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.1.tgz","fileCount":12,"unpackedSize":6444,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbgjpSNnGvQ+yerV2yI8DWCN4b1X3vRMGiU5VVRWnCyAIgd/5hqfDWaiqloSbF9suktwbhRRKIAXtiwm8H09d6wyk="}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.1_1685852375241_0.49305348054009657"},"_hasShrinkwrap":false},"1.0.2":{"name":"@dannywrayuk/describe-shape","description":"Simple object descriptions, perfect for your logs","author":{"name":"dannywrayuk"},"version":"1.0.2","license":"MIT","keywords":["object","types","shape","logs"],"main":"dist/index.js","types":"dist/index.d.ts","homepage":"https://github.com/dannywrayuk/utilities/packages/describe-shape#readme","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.2","dist":{"shasum":"9f92ad326c9a698379710fd79b7f9926c95faa3f","integrity":"sha512-4f5yRaXYnRoC0UcfbyOSSbnMm5WsLh8ki5NlzQhX1buqoAF+KAOoC3YdDqjlnBn1AyTgHT7xpLKaK1Vtg/8zVw==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.2.tgz","fileCount":8,"unpackedSize":6417,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYqLzA4Hp3lZrLh0SPzNvOGz0/HxQNnxTsGGKMz8fciQIgKi+PpFqwgUufxtm8EZzOnHWIERpjnYeH6WVrdpo9qkM="}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.2_1687056483364_0.6239907955851332"},"_hasShrinkwrap":false},"1.0.3":{"name":"@dannywrayuk/describe-shape","description":"Simple object descriptions, perfect for your logs","author":{"name":"dannywrayuk"},"version":"1.0.3","license":"MIT","keywords":["object","types","shape","logs"],"main":"dist/index.js","types":"dist/index.d.ts","homepage":"https://github.com/dannywrayuk/utilities/tree/main/packages/describe-shape","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.3","dist":{"shasum":"53857f22266f76fcbea01843925e523312d956a9","integrity":"sha512-yL5izWmXET0j3LjvTpJ0H67BwO44l4FsAD3MrAcQtYn78Gj+KdQnQrG3JPNfmFZ3arzfwF0qDN85NQBKWRGPOQ==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.3.tgz","fileCount":8,"unpackedSize":6420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDB4Qoy/nvkqYz4bogOXde4jqHL8Yii3ZTN9b4qUckn2AiEA8yDKLy87lWJkRbqfm8Uk1+hKvePkfP2U9VlKytrCb7I="}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.3_1687056741051_0.040970349919527305"},"_hasShrinkwrap":false},"1.0.4":{"name":"@dannywrayuk/describe-shape","description":"Simple object descriptions, perfect for your logs","author":{"name":"dannywrayuk"},"version":"1.0.4","license":"MIT","keywords":["object","types","shape","logs"],"main":"dist/index.js","types":"dist/index.d.ts","homepage":"https://github.com/dannywrayuk/utilities/tree/main/packages/describe-shape","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.4","dist":{"shasum":"c7b5484478b8e44414a8e6c08a341896348de07f","integrity":"sha512-s0LJ7FS4RKMtq630RX6dNgrt8NA1+7eGhQGRJJt92GhhXHVIyhkbTDZDKLonBhAJinQ9ofPdyUJMUGaiYFzHPw==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.4.tgz","fileCount":8,"unpackedSize":6579,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCafdDL1g1HhyJy356MVK4dX7t4Feq8uT2AZTN1Pp/7ogIhANzDvjM6DwwIGruSIn7vEz6SPrTkg8NFxFvcOTH692xp"}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.4_1687120520893_0.1991491929451603"},"_hasShrinkwrap":false},"1.0.5":{"name":"@dannywrayuk/describe-shape","description":"Simple object descriptions, perfect for your logs","author":{"name":"dannywrayuk"},"version":"1.0.5","license":"MIT","keywords":["object","types","shape","logs"],"main":"dist/index.js","types":"dist/index.d.ts","homepage":"https://github.com/dannywrayuk/utilities/tree/main/packages/describe-shape","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.5","dist":{"shasum":"cf68b5c8198ef761302c29276425fd9bf6ca8c2d","integrity":"sha512-0PGV3P9vbH6dKfwP1+vm6JPe2NEATDD249N1HEWBfgc3BCrFcmSSZ3lWnf7Uch2Bjb5acSxq8f0kpvjZ24Qf0Q==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.5.tgz","fileCount":8,"unpackedSize":6579,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDda0e+4X/em3rCXL9L1HIrpyMRzyH+2YRSyAPv1OLuoAiEAiLVCiqi8/5SEIi1l7lsN9KTiFuPScmfBtk60kV5Bsxs="}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.5_1687120834936_0.679607748004496"},"_hasShrinkwrap":false},"1.0.6":{"name":"@dannywrayuk/describe-shape","description":"Simple object descriptions, perfect for your logs","author":{"name":"dannywrayuk"},"version":"1.0.6","license":"MIT","keywords":["object","types","shape","logs"],"main":"dist/index.js","types":"dist/index.d.ts","homepage":"https://github.com/dannywrayuk/utilities/tree/main/packages/describe-shape","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.6","dist":{"shasum":"95038e42ca27be30feaf76a6ca4c8d6e27ec92b6","integrity":"sha512-EWJ8MJWKQVIU3Z4q8AvWTgTumi2H1fBtjhPD+U+s41nBtN5xjFjZ8bg21CtIli7k9OEZBowHhriq0nCSYk/Tfg==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.6.tgz","fileCount":8,"unpackedSize":6552,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKmluhWuSSuKRVXxk40bt9I0h8ckc+qm2+5AYPJHWgiQIhAO8l8ADCobHR+3KN3qBqJVOCVDtIoUzZzhL9qaEFticp"}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.6_1687145791732_0.2314624395102749"},"_hasShrinkwrap":false},"1.0.7":{"name":"@dannywrayuk/describe-shape","description":"Simple object descriptions, perfect for your logs","author":{"name":"dannywrayuk"},"version":"1.0.7","license":"MIT","keywords":["object","types","shape","logs"],"main":"dist/index.js","types":"dist/index.d.ts","homepage":"https://github.com/dannywrayuk/utilities/tree/main/packages/describe-shape","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"scripts":{"test":"jest","build":"tsc","lint":"eslint \"**/*.ts*\""},"devDependencies":{"@types/jest":"^29.5.2","@types/node":"^20.2.5","eslint-config-custom":"*","jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"*","typescript":"^5.0.4"},"dependencies":{},"_id":"@dannywrayuk/describe-shape@1.0.7","dist":{"shasum":"482229a3a0755cc8d7ac520c9d48b8c6e79cc30e","integrity":"sha512-6mFPwUj2muYSzCjl3qKSsw/AMTRO+GqkqFP8xw/eOjeVtvUN+s+mhOCPW7jyQb6fjrCRhUuxE5Jsslow4TeCKA==","tarball":"https://registry.npmjs.org/@dannywrayuk/describe-shape/-/describe-shape-1.0.7.tgz","fileCount":8,"unpackedSize":6559,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHorkDbNA+kl/CaxIGgT47qh7Vvos6pRVf+va4YX0A0wAiBBbFob/jlyoTR7C3fM3AjuB4uTQfvNIJXNuZo/kHRixA=="}]},"_npmUser":{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"},"directories":{},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/describe-shape_1.0.7_1687741984085_0.473395231214341"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-04T03:33:18.237Z","1.0.0":"2023-06-04T03:33:18.482Z","modified":"2023-06-26T01:13:04.303Z","1.0.1":"2023-06-04T04:19:35.388Z","1.0.2":"2023-06-18T02:48:03.513Z","1.0.3":"2023-06-18T02:52:21.242Z","1.0.4":"2023-06-18T20:35:21.061Z","1.0.5":"2023-06-18T20:40:35.150Z","1.0.6":"2023-06-19T03:36:31.892Z","1.0.7":"2023-06-26T01:13:04.207Z"},"maintainers":[{"name":"dannywrayuk","email":"dannywrayuk@gmail.com"}],"description":"Simple object descriptions, perfect for your logs","homepage":"https://github.com/dannywrayuk/utilities/tree/main/packages/describe-shape","repository":{"type":"git","url":"git+https://github.com/dannywrayuk/utilities.git"},"author":{"name":"dannywrayuk"},"license":"MIT","readme":"<p align=\"center\" >\n <img src=\"https://github.com/dannywrayuk/utilities/raw/main/packages/describe-shape/assets/logo.svg\" alt=\"Text Logo\" width=\"250\" />\n</p>\n\n<h1 align=\"center\">Describe Shape</h1>\n<p align=\"center\">Simple object descriptions, perfect for your logs</p>\n<p align=\"center\">\n  <a href=\"https://npmjs.org/package/@dannywrayuk/describe-shape\">\n    <img src=\"https://img.shields.io/npm/v/@dannywrayuk/describe-shape.svg\" alt=\"version\" />\n  </a>\n   <a href=\"https://bundlephobia.com/package/@dannywrayuk/describe-shape\">\n    <img src=\"https://img.shields.io/bundlephobia/min/@dannywrayuk/describe-shape.svg\" alt=\"install size\" />\n  </a>\n  <a href=\"https://npmjs.org/package/@dannywrayuk/describe-shape\">\n    <img src=\"https://img.shields.io/npm/dm/@dannywrayuk/describe-shape.svg\" alt=\"downloads\" />\n  </a>\n</p>\n\n<br />\n\nUse this library to create a description of an input using only [primitive data types](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) and class names. This is useful for debugging and logging where using the full object could reveal sensitive information.\n\n## Install\n\nUse your favourite package manager\n\nUsing npm:\n\n```\n$ npm install @dannywrayuk/describe-shape\n```\n\nUsing yarn:\n\n```\n$ yarn add @dannywrayuk/describe-shape\n```\n\nUsing pnpm:\n\n```\n$ pnpm add @dannywrayuk/describe-shape\n```\n\n## Usage\n\n```js\nimport { describeShape } from \"@dannywrayuk/describe-shape\";\n\nconst objectShape = describeShape(someObject);\n\nconsole.log(objectShape);\n```\n\nThis package only exports one function, super simple!\n\n## Examples\n\n### Simple Primitive\n\nFor a simple primitive, the output of describeShape is the same as that of the built in `typeof`:\n\n```js\ndescribeShape(\"Hello World!\");\n```\n\nReturns:\n\n```json\n\"string\"\n```\n\n### Objects and Arrays\n\nWhen describing an object, keys will be maintained and the values replaced with their types. Arrays will maintain their length, with each elements being described in full:\n\n```js\ndescribeShape({\n  id: 1234,\n  secretInformation: [\"this is a secret\", \"do not log me\"],\n  otherData: {\n    awesome: true,\n  },\n});\n```\n\nReturns:\n\n```js\n{\n  id: \"number\",\n  secretInformation: [\"string\", \"string\"],\n  otherData: {\n    awesome: \"boolean\",\n  },\n}\n```\n\n### Classes\n\nInstances of classes are described by the constructor name used to create them:\n\n```js\nclass SomeClass {}\n\ndescribeShape({\n    message: new SomeClass();\n    date: new Date();\n    filter: new RegExp(\"^ThatsCool$\")\n});\n```\n\nReturns:\n\n```js\n{\n  message: \"SomeClass\",\n  date: \"Date\",\n  filter: \"RegExp\"\n}\n```\n\n## Options\n\nCurrently there is only one option available for use, this is an optional check for cyclic objects before describing the object. This check can be useful, since the internals of this library operate recursively and circular references would result in an infinite loop.\n\nYou can enable this check by calling the function with `{ enableCyclicCheck: true }`.\n\n```js\nconst circular = {};\ncircular.loop = circular;\n\ndescribeShape(circular, { enableCyclicCheck: true });\n// Throws, no infinite loop!\n```\n\n## Contribution\n\nIf there is an option or feature you would like to see, please feel free to raise an issue or open a pull request. Contributions are welcome :)\n\n## License\n\nMIT © [Danny Wray](https://github.com/dannywrayuk/utilities/blob/main/packages/describe-shape/LICENCE)\n","readmeFilename":"README.md","keywords":["object","types","shape","logs"]}