0.2.2 • Published 7 years ago

simple-swizzle v0.2.2

Weekly downloads
11,026,889
License
MIT
Repository
github
Last release
7 years ago

simple-swizzle Travis-CI.org Build Status Coveralls.io Coverage Rating

Swizzle your function arguments; pass in mixed arrays/values and get a clean array

Usage

var swizzle = require('simple-swizzle');

function myFunc() {
	var args = swizzle(arguments);
	// ...
	return args;
}

myFunc(1, [2, 3], 4); // [1, 2, 3, 4]
myFunc(1, 2, 3, 4);   // [1, 2, 3, 4]
myFunc([1, 2, 3, 4]); // [1, 2, 3, 4]

Functions can also be wrapped to automatically swizzle arguments and be passed the resulting array.

var swizzle = require('simple-swizzle');

var swizzledFn = swizzle.wrap(function (args) {
	// ...
	return args;
});

swizzledFn(1, [2, 3], 4); // [1, 2, 3, 4]
swizzledFn(1, 2, 3, 4);   // [1, 2, 3, 4]
swizzledFn([1, 2, 3, 4]); // [1, 2, 3, 4]

License

Licensed under the MIT License. You can find a copy of it in LICENSE.

color-stringcuc-gafeasy-select-rnvuedragdropuploadimagescloud-archive-s3bb-chat@ihikmawan/tailwindcss-multi-theme-l2@fundefund/funde_ckgql_din_mod@olivervorasai/sliderukor-remasterwilscanner@infinitebrahmanuniverse/nolb-simple-s@everything-registry/sub-chunk-2766p149-table@mmooccii/lazyload-loader@leiyulf/gantt-task-reactcourse-vue-tpl@ct-note/table@devorso/dcountdowncpcs6_loggersquashfold-uilitepie-datepicker-gabem2m-chartjs-plugin-crosshairlogin-encrypt-ziosticky-scroll-catchstock-ticker-react-widgetdiscord-pyrosequelcomponenttailwind-templatetailwind-vector-effectnglogger-acefonetingzi-vuepressng-search-dropdownnka-gantt-task-reactvue-button-test1teapackage-tatespoorman297mggauharvformlmqqjc2-block@shonaui/core@southcn/ckeditor5-build-inline@stansaal/ckeditor5-custom-build@oriduk/ckeditor5-rebuild-musicanote@oriduk/ckeditor5-rebuild-oriduk@react-18-pdf/root@react-native-ui-design/button@refactorpro/pixi-virtual-joystick@sak1sham/react-toc-highlight@kommunicate/kommunicate-chatbot-plugin@zebracompany/f_editor@vue-helper/vue-keep-alive@tonysusi/vapid@tillschweneker/ckeditor5-build-strapi-wysiwyg-markdown@yak-spirit/yak-swap-uiap-vue-captchaagcimawesome-cordova-plugins-retenoawesome-cordova-plugins-reteno-firebasegenerator-bootstrap-boilerplate-templatearvm-bestdeveloperappxgengaurav-react-native-loopreact-lightbox-pack-18supporthot-zone-vueclxcxl@contagt/metismenu@darwishdev/dash-devrefinejs-reporesponsis-gantt-task-reactjesusdemo@asiz33/smartblok-vendure-pluginbase-editorchain_diggercase-gg-editorcl-toolckeditor5-custom-ksckeditor5-custom-symmetreckeditor5-strapi-msg@carhoo/widget-dealersckeditor5-build-yektackeditor5-click-virtualckeditor5-custom-build-megampireckeditor5-custom-build-for-irrosoftckeditor5-build-custom-strapickeditor5-build-classic-ticketckeditor5-build-classic-v-edithive-multisig-sdkckeditor-5-imi-1cssesc-wbgts-color-stringnotion-database-exporterverify-img-codenove-repositoryvue-compmentexpo-renavigate@hazyflame/vue-jitsi-meetp147-tablep148-table@faizanhaider/iconsax
0.2.2

7 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago