{"_id":"pop-zip","_rev":"48840","name":"pop-zip","description":"Zip and unzip, also called matrix transpose","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"kriskowal","email":""}],"time":{"modified":"2021-06-03T10:14:59.000Z","created":"2015-02-02T01:26:14.586Z","1.0.0":"2015-02-02T01:26:14.586Z"},"users":{},"author":{"name":"Kris Kowal","email":"kris@cixar.com"},"repository":{"type":"git","url":"https://github.com/kriskowal/pop-zip.git"},"versions":{"1.0.0":{"name":"pop-zip","version":"1.0.0","description":"Zip and unzip, also called matrix transpose","main":"pop-zip.js","directories":{"test":"test"},"scripts":{"test":"jasminum test","lint":"lint-trap"},"repository":{"type":"git","url":"https://github.com/kriskowal/pop-zip.git"},"keywords":["zip","unzip","transpose","matrix","array","pop","polymorphic","operator"],"author":{"name":"Kris Kowal","email":"kris@cixar.com"},"license":"MIT","bugs":{"url":"https://github.com/kriskowal/pop-zip/issues"},"homepage":"https://github.com/kriskowal/pop-zip","devDependencies":{"jasminum":"0.0.4","lint-trap":"^1.0.0"},"gitHead":"7fb9e5525426b1aefdceea4936ffddde8d400d33","_id":"pop-zip@1.0.0","_shasum":"3dc114007b2cece74ff3b8cea73eb120c70db056","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"maintainers":[{"name":"kriskowal","email":""}],"dist":{"shasum":"3dc114007b2cece74ff3b8cea73eb120c70db056","size":3068,"noattachment":false,"key":"/pop-zip/-/pop-zip-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pop-zip/download/pop-zip-1.0.0.tgz"},"publish_time":1422840374586,"_cnpm_publish_time":1422840374586,"_hasShrinkwrap":false}},"readme":"\n# Zip and Unzip Transposition\n\nThis package provides zip, unzip, and \"polymorphic\" versions of these operators.\n\nZip is a function that accepts any number of arrays and returns an array of the\nrespective values from each of the given arrays.\n\n```js\nvar unzip = require(\"pop-zip/zip\");\nexpect(zip(\n    ['a', 'b', 'c'],\n    [1, 2, 3],\n    ['x', 'y', 'z']\n)).toEqual([\n    ['a', 1, 'x'],\n    ['b', 2, 'y'],\n    ['c', 3, 'z']\n]);\n```\n\nUnzip is identical but accepts an array of arrays.\nUnzip is behaviorally identical to a matrix transpose for matricies modeled as\nnested arrays.\n\n```js\nvar unzip = require(\"pop-zip/unzip\");\nexpect(unzip(\n    ['a', 'b', 'c'],\n    [1, 2, 3],\n    ['x', 'y', 'z']\n)).toEqual([\n    ['a', 1, 'x'],\n    ['b', 2, 'y'],\n    ['c', 3, 'z']\n]);\n```\n\n## Polymorphic operator\n\nA well-planned system of objects is beautiful: a system where every meaningful\nmethod for an object has been anticipated in the design.\nInevitably, another layer of architecture introduces a new concept and with it\nthe temptation to monkey-patch, dunk-punch, or otherwise cover-up the omission.\nBut reaching backward in time, up through the layers of architecture doesn't\nalways compose well, when different levels introduce concepts of the same name\nbut distinct behavior.\n\nA polymorphic operator is a function that accepts as its first argument an\nobject and varies its behavior depending on its type.\nSuch an operator has the benefit of covering for the types from higher layers of\narchitecture, but defers to the eponymous method name of types yet to be\ndefined.\n\nThis package also exports polymorphic versions of zip and unzip, on the\noff-chance you may be working with an array or some more sophisticated\ncollection.\n\nOther collection objects are expected to implement `toArray`, and both zip and\nunzip will use these methods to funnel the resulting object array of arrays into\nthe non-polymorphic unzip.\n\n## License and Copyright\n\nCopyright (c) 2015 by Kristopher Michael Kowal and contributors.\nAll rights reserved.\nMIT License.\n\n","_attachments":{},"homepage":"https://github.com/kriskowal/pop-zip","bugs":{"url":"https://github.com/kriskowal/pop-zip/issues"},"license":"MIT"}