{"name":"chimee-helper-utils","version":"0.1.2","description":"utils of chimee","main":"lib/index.js","module":"lib/index.mjs","jsnext:main":"lib/index.mjs","browser":"lib/index.browser.js","scripts":{"test":"jest --coverage && flow","start":"jest --coverage --watch","flow":"flow","lint":"flow && eslint ./src --fix","precommit":"npm run lint","prepush":"npm run test","build":"npm run b-common && npm run b-es && npm run b-umd && npm run b-min","b-common":"rollup -c build/rollup.config.common.js","b-es":"rollup -c build/rollup.config.es.js","b-umd":"rollup -c build/rollup.config.umd.js","b-min":"rollup -c build/rollup.config.min.js"},"repository":{"type":"git","url":"git+https://github.com/Chimeejs/chimee-helper-utils.git"},"keywords":["utils","chimee","video"],"author":{"name":"toxic-johann"},"license":"MIT","bugs":{"url":"https://github.com/Chimeejs/chimee-helper-utils/issues"},"homepage":"https://github.com/Chimeejs/chimee-helper-utils#readme","dependencies":{"babel-runtime":"^6.23.0","toxic-predicate-functions":"^0.1.2"},"devDependencies":{"babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015-rollup":"^3.0.0","babel-preset-flow":"^6.23.0","babel-preset-latest":"^6.24.1","eslint":"^4.0.0","eslint-plugin-flowtype":"^2.34.0","eslint-plugin-jest":"^20.0.3","flow-bin":"^0.49.1","husky":"^0.14.1","jest":"^20.0.4","nyc":"^11.0.2","rollup":"^0.43.0","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-flow-no-whitespace":"^1.0.0","rollup-plugin-includepaths":"^0.2.2","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-uglify":"^2.0.1","toxic-utils":"^0.1.3"},"jest":{"modulePaths":["src"],"moduleFileExtensions":["js"],"moduleDirectories":["node_modules","bower_components"],"transform":{".*":"babel-jest"}},"gitHead":"d70a45690ea3e11438b098538007c68823c9e4e7","_id":"chimee-helper-utils@0.1.2","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"huzunjie","email":"huzunjie@pyzy.net"},"dist":{"integrity":"sha512-3tDVcGvQR1zD59a+FzGA68p6HXXetWIKMv8vEthUyOQZ7ecF5/mvf1B6sVCBa7TkbTaiS6mNZvABtFbpd5X2NQ==","shasum":"0b65635dbef476ce625791e43b69b7531cc1252d","tarball":"http://registry-npm.ywwl.com/chimee-helper-utils/download/chimee-helper-utils-0.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGg1x1H1YkrzKLHUanWMasK4AEGdlA+oVD3yeI6e2O/2AiBTVIpPHV+7Aqhh8sm8lmNzeWT5I4AHo1vbUiZB6VZiRw=="}],"size":44123,"noattachment":false,"key":"/chimee-helper-utils/-/chimee-helper-utils-0.1.2.tgz"},"maintainers":[{"name":"huzunjie","email":"huzunjie@pyzy.net"},{"name":"toxicjohann","email":"353904974@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chimee-helper-utils-0.1.2.tgz_1499393272408_0.8446128591895103"},"directories":{},"readme":"# chimee-helper-utils\n\n[![Build Status](https://img.shields.io/travis/Chimeejs/chimee-helper-utils/master.svg?style=flat-square)](https://travis-ci.org/Chimeejs/chimee-helper-utils.svg?branch=master)\n[![Coverage Status](https://img.shields.io/coveralls/Chimeejs/chimee-helper-utils/master.svg?style=flat-square)](https://coveralls.io/github/Chimeejs/chimee-helper-utils?branch=master)\n[![npm](https://img.shields.io/npm/v/chimee-helper-utils.svg?colorB=brightgreen&style=flat-square)](https://www.npmjs.com/package/chimee-helper-utils)\n[![dependency Status](https://david-dm.org/Chimeejs/chimee-helper-utils.svg)](https://david-dm.org/Chimeejs/chimee-helper-utils)\n[![devDependency Status](https://david-dm.org/Chimeejs/chimee-helper-utils/dev-status.svg)](https://david-dm.org/Chimeejs/chimee-helper-utils?type=dev)\n\nutils of chimee\n\n## get started\n\n```shell\nnpm install chimee-helper-utils --save\n```\n\nif you are using `flow`, you should import our flow defination, by adding this to your `.flowconfig`.\n\n    [ignore]\n\n    [include]\n\n    [libs]\n    ./node_modules/chimee-helper-utils/lib/index.flow.js\n    [options]\n\n    [lints]\n\n## doc\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### inBrowser\n\n[src/index.js:8-10](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L8-L10 \"Source code on GitHub\")\n\ncheck if the code running in browser environment (not include worker env)\n\nReturns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### makeArray\n\n[src/index.js:16-18](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L16-L18 \"Source code on GitHub\")\n\n转变一个类数组对象为数组\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;any>** \n\n### transObjectAttrIntoArray\n\n[src/index.js:27-33](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L27-L33 \"Source code on GitHub\")\n\nsort Object attributes by function\nand transfer them into array\n\n**Parameters**\n\n-   `obj` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object form from numric\n-   `fn` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** sort function (optional, default `(a,b)=>+a-+b`)\n\nReturns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the sorted attirbutes array\n\n### runRejectableQueue\n\n[src/index.js:39-56](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L39-L56 \"Source code on GitHub\")\n\nrun a queue one by one.If include function reject or return false it will stop\n\n**Parameters**\n\n-   `queue` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the queue which we want to run one by one\n-   `args` **...any** \n\nReturns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** tell us whether a queue run finished\n\n### runStoppableQueue\n\n[src/index.js:62-74](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L62-L74 \"Source code on GitHub\")\n\nrun a queue one by one.If include function return false it will stop\n\n**Parameters**\n\n-   `queue` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the queue which we want to run one by one\n-   `args` **...any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tell the user if the queue run finished\n\n### throttle\n\n[src/index.js:186-234](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L186-L234 \"Source code on GitHub\")\n\n函数节流（控制函数执行频率）\n\n**Parameters**\n\n-   `func` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** 要节流控制的函数，必填\n-   `wait` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** \n-   `options` **any** \n-   `cxt` **any** \n\nReturns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** wait 等待时长\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options {\n                     leading&lt;是否首次调用立即执行，否：则按wait设定等待到期后调用才执行>:false,\n                     trailing&lt;是否在调用并未到期时启用定时器，以保证一定执行>:true\n                   }\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** cxt 上下文对象\n\nReturns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** \n\n### appendCSS\n\n[src/index.js:278-288](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L278-L288 \"Source code on GitHub\")\n\n追加样式代码到head的style标签，不存在则创建\n\n**Parameters**\n\n-   `cssText` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 样式文本\n\nReturns **[HTMLElement](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)** \n\n### formatDate\n\n[src/index.js:296-314](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L296-L314 \"Source code on GitHub\")\n\n格式化日期对象为：年-月-日 时:分:秒.毫秒\n\n**Parameters**\n\n-   `date` **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** Date日期对象 (optional, default `new Date()`)\n-   `pattern` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 要输出的日期格式，默认：`yyyy-MM-dd hh:mm:ss.i` (optional, default `'yyyy-MM-dd hh:mm:ss.i'`)\n\nReturns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n\n### getLocalStorage\n\n[src/index.js:321-332](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L321-L332 \"Source code on GitHub\")\n\n读取本地存储的值（不支持localStorage则降级到cookie）\n\n**Parameters**\n\n-   `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 目标数据key\n\nReturns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n\n### setLocalStorage\n\n[src/index.js:339-350](https://github.com/Chimeejs/chimee-helper-utils/blob/bbecaf917f2d9b21704bfae1a25ebe4a10383200/src/index.js#L339-L350 \"Source code on GitHub\")\n\n将指定key对应值写入本地存储（不支持localStorage则降级到cookie）\n\n**Parameters**\n\n-   `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n-   `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n\nReturns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n","publish_time":1499393272498,"_cnpm_publish_time":1499393272498,"dist-tags":{"latest":"0.2.1"}}