nuke-helper
Advanced tools
Comparing version 0.0.10 to 2.0.0
@@ -1,43 +0,46 @@ | ||
# Changelog | ||
# Changelog | ||
## 2.0.0 / 2018-03-21 | ||
## 0.0.10 / 2018-02-22 | ||
* [[525410b](http://gitlab.alibaba-inc.com/nuke/helper/commit/525410b3705f03f1b7ebd8a925c90a094d8d726a)] - `feat` support key object mode | ||
* [[2fa167a](http://gitlab.alibaba-inc.com/nuke/helper/commit/2fa167aab22e013cbaaccac0692a8c60bb57eb48)] - `fix` add width,height | ||
## 0.0.10 / 2018-02-22 | ||
## 0.0.9 / 2018-01-25 | ||
* [[2fa167a](http://gitlab.alibaba-inc.com/nuke/helper/commit/2fa167aab22e013cbaaccac0692a8c60bb57eb48)] - `fix` add width,height | ||
* [[5913444](http://gitlab.alibaba-inc.com/nuke/helper/commit/59134447c7653079f76ee925d497269f171371b1)] - `feat` add other components 's common function | ||
## 0.0.9 / 2018-01-25 | ||
## 0.0.8 / 2018-01-18 | ||
* [[5913444](http://gitlab.alibaba-inc.com/nuke/helper/commit/59134447c7653079f76ee925d497269f171371b1)] - `feat` add other components 's common function | ||
* [[3a355d3](http://gitlab.alibaba-inc.com/nuke/helper/commit/3a355d381aac94fbc596069ed64df2af43f5066b)] - `fix` fix wxenv not exist bug when debugging | ||
## 0.0.8 / 2018-01-18 | ||
## 0.0.7 / 2018-01-15 | ||
* [[3a355d3](http://gitlab.alibaba-inc.com/nuke/helper/commit/3a355d381aac94fbc596069ed64df2af43f5066b)] - `fix` fix wxenv not exist bug when debugging | ||
* [[a66c53d](http://gitlab.alibaba-inc.com/nuke/helper/commit/a66c53d317f0621ebf01805baf4a8be7363ba3e7)] - `feat` fit size for ipad | ||
## 0.0.7 / 2018-01-15 | ||
## 0.0.6 / 2018-01-05 | ||
* [[a66c53d](http://gitlab.alibaba-inc.com/nuke/helper/commit/a66c53d317f0621ebf01805baf4a8be7363ba3e7)] - `feat` fit size for ipad | ||
* [[49325be](http://gitlab.alibaba-inc.com/nuke/helper/commit/49325be08d85c4d7e24a1e3402f655ecbff14ab7)] - `feat` add fixsmallunit | ||
## 0.0.6 / 2018-01-05 | ||
## 0.0.5 / 2017-12-25 | ||
* [[49325be](http://gitlab.alibaba-inc.com/nuke/helper/commit/49325be08d85c4d7e24a1e3402f655ecbff14ab7)] - `feat` add fixsmallunit | ||
* [[e26c23c](http://gitlab.alibaba-inc.com/nuke/helper/commit/e26c23cfffee19800d0cc9773ddcd741af4ba8b0)] - `fix` add px string support | ||
## 0.0.5 / 2017-12-25 | ||
## 0.0.4 / 2017-12-18 | ||
* [[e26c23c](http://gitlab.alibaba-inc.com/nuke/helper/commit/e26c23cfffee19800d0cc9773ddcd741af4ba8b0)] - `fix` add px string support | ||
* [[2a07625](http://gitlab.alibaba-inc.com/nuke/helper/commit/2a076254467c62e045958d844a54f003e1e2494a)] - `fix` fix parse error | ||
## 0.0.4 / 2017-12-18 | ||
## 0.0.3 / 2017-12-18 | ||
* [[2a07625](http://gitlab.alibaba-inc.com/nuke/helper/commit/2a076254467c62e045958d844a54f003e1e2494a)] - `fix` fix parse error | ||
* [[a20a80d](http://gitlab.alibaba-inc.com/nuke/helper/commit/a20a80d10a39079f158126a703f1204a1b81825f)] - `feat` delete nuke-env ,use universal | ||
## 0.0.3 / 2017-12-18 | ||
## 0.0.2 / 2017-12-18 | ||
* [[a20a80d](http://gitlab.alibaba-inc.com/nuke/helper/commit/a20a80d10a39079f158126a703f1204a1b81825f)] - `feat` delete nuke-env ,use universal | ||
* [[ad3b36b](http://gitlab.alibaba-inc.com/nuke/helper/commit/ad3b36bc2b5b39ccc3084abae844ac02e1be2835)] - `feat` env downgrade to 0.x.x | ||
## 0.0.2 / 2017-12-18 | ||
## 0.0.1 / 2017-12-15 | ||
* [[ad3b36b](http://gitlab.alibaba-inc.com/nuke/helper/commit/ad3b36bc2b5b39ccc3084abae844ac02e1be2835)] - `feat` env downgrade to 0.x.x | ||
* [[61600f4](http://gitlab.alibaba-inc.com/nuke/helper/commit/61600f4d21945697b20be053c0b17fd9eb2e4aa5)] - `fix` bugfix | ||
* [[d328697](http://gitlab.alibaba-inc.com/nuke/helper/commit/d32869706f94973c85c4733871d5eb21714e164f)] - `feat` init helper | ||
## 0.0.1 / 2017-12-15 | ||
* [[61600f4](http://gitlab.alibaba-inc.com/nuke/helper/commit/61600f4d21945697b20be053c0b17fd9eb2e4aa5)] - `fix` bugfix | ||
* [[d328697](http://gitlab.alibaba-inc.com/nuke/helper/commit/d32869706f94973c85c4733871d5eb21714e164f)] - `feat` init helper |
@@ -1,3 +0,5 @@ | ||
"use strict"; | ||
'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/** | ||
@@ -7,2 +9,14 @@ * @param {*} hex | ||
*/ | ||
exports.valueToObj = function (obj) { | ||
Object.keys(obj).map(function (name) { | ||
if (_typeof(obj[name]) === 'object') { | ||
obj[name] = { | ||
name: name, | ||
raw: obj[name] | ||
}; | ||
} | ||
}); | ||
return obj; | ||
}; | ||
exports.hexToRgb = function (hex, opacity) { | ||
@@ -28,5 +42,14 @@ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; | ||
exports.rgba = function (hex, opacity) { | ||
if ((typeof hex === 'undefined' ? 'undefined' : _typeof(hex)) === 'object' && 'raw' in hex) { | ||
hex = hex.raw; | ||
} | ||
if ((typeof opacity === 'undefined' ? 'undefined' : _typeof(opacity)) === 'object' && 'raw' in opacity) { | ||
opacity = opacity.raw; | ||
} | ||
var result = exports.hexToRgb(hex); | ||
if (!result) return null; | ||
return "rgba(" + result.r + "," + result.g + "," + result.b + "," + opacity + ")"; | ||
// if ('raw' in hex) { | ||
// return { raw: `rgba(${result.r},${result.g},${result.b},${opacity})` }; | ||
// } | ||
return 'rgba(' + result.r + ',' + result.g + ',' + result.b + ',' + opacity + ')'; | ||
}; |
'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _universalEnv = require('universal-env'); | ||
@@ -12,2 +14,5 @@ | ||
// Default 1 rem to 1 px | ||
if ((typeof rem === 'undefined' ? 'undefined' : _typeof(rem)) === 'object' && 'raw' in rem) { | ||
rem = rem.raw; | ||
} | ||
if (_universalEnv.isWeex) return rem; | ||
@@ -14,0 +19,0 @@ rem = exports.removeRemUnit(rem); |
{ | ||
"name": "nuke-helper", | ||
"version": "0.0.10", | ||
"version": "2.0.0", | ||
"description": "辅助函数", | ||
"main": "lib/index", | ||
"files": [ | ||
"lib", | ||
"docs", | ||
"theme", | ||
"README.md", | ||
"HISTORY.md" | ||
], | ||
"keywords": [ | ||
"nuke", | ||
"nuke-helper" | ||
], | ||
"files": ["lib", "docs", "theme", "README.md", "HISTORY.md"], | ||
"keywords": ["nuke", "nuke-helper"], | ||
"author": { | ||
@@ -18,0 +9,0 @@ "name": "leanhunter", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
16439
310
1