From f26f29d84e0a68831a6af14dab3eec5500496d2e Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 28 五月 2025 16:48:52 +0800 Subject: [PATCH] 初始化项目 --- uni_modules/wu-ui-tools/libs/function/color/simple-swizzle/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/uni_modules/wu-ui-tools/libs/function/color/simple-swizzle/README.md b/uni_modules/wu-ui-tools/libs/function/color/simple-swizzle/README.md new file mode 100644 index 0000000..7624577 --- /dev/null +++ b/uni_modules/wu-ui-tools/libs/function/color/simple-swizzle/README.md @@ -0,0 +1,39 @@ +# simple-swizzle [](https://travis-ci.org/Qix-/node-simple-swizzle) [](https://coveralls.io/r/Qix-/node-simple-swizzle) + +> [Swizzle](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)) your function arguments; pass in mixed arrays/values and get a clean array + +## Usage + +```js +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. + +```js +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](http://opensource.org/licenses/MIT). +You can find a copy of it in [LICENSE](LICENSE). -- Gitblit v1.9.3