Files
sam-hotfix/research/flow-chart/node_modules/simple-swizzle
김보곤 d86b5851d0 chore: 프로젝트 설정 및 문서 파일 추가
- .agent/, .claude/, .vscode/ 설정 파일
- design/ 디자인 리소스
- reports/, research/ 분석 문서
- testcase/ 테스트 케이스 문서
- db_sync_chandj.bat, sam.code-workspace

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:51:43 +09:00
..

NOTE: ⚠️ Don't use this package in new projects. It is a huge anti-pattern and will only confuse and annoy people who use whatever code you write with it. I wrote this in a time when Javascript and Node.js were still pretty experimental and clever things like this weren't frowned upon. I've also learned a LOT about proper API design since I wrote this package. DO. NOT. USE. THIS. PACKAGE. If you're reaching for it, please really reconsider your API's design.


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.