colors-tmpl
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -1,23 +0,4 @@ | ||
/*! | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2012 Rod Vagg <rod@vagg.org> @rvagg | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
* persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
* Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
var colors = require('colors/safe') | ||
var colors = require('colors') | ||
, types = Object.keys(colors).filter(function (k) { | ||
, types = Object.getOwnPropertyNames(colors).filter(function (k) { | ||
return /^[a-z]+$/.test(k) && typeof colors[k] == 'function' | ||
@@ -30,3 +11,3 @@ }) | ||
return str.replace(re, function (_, s) { | ||
return s[type] | ||
return colors[type](s) | ||
}) | ||
@@ -36,11 +17,11 @@ } | ||
, render = function (str) { | ||
return translators.reduce( | ||
function (str, fn) { return fn(str) } | ||
, str | ||
) | ||
} | ||
module.exports = render | ||
// old style: | ||
module.exports.render = render | ||
function render (str) { | ||
return translators.reduce( | ||
function (str, fn) { return fn(str) } | ||
, str | ||
) | ||
} | ||
module.exports = render |
@@ -8,3 +8,3 @@ { | ||
"description": "Simple templating for applying colors.js to strings", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/rvagg/colors-tmpl", | ||
@@ -18,3 +18,4 @@ "keywords": [ | ||
"templating", | ||
"templates" | ||
"templates", | ||
"goatscale" | ||
], | ||
@@ -30,4 +31,4 @@ "repository": { | ||
"dependencies": { | ||
"colors": "~0.6.2" | ||
"colors": "~1.0.2" | ||
} | ||
} |
@@ -21,2 +21,4 @@ # colors-tmpl - Super-simple templating for [colors.js](https://github.com/Marak/colors.js) | ||
*Copyright (c) 2012 [Rod Vagg](https://github.com/rvagg) ([@rvagg](https://twitter.com/rvagg))* | ||
## License | ||
**colors-tmpl** is Copyright (c) 2014 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10585
8
0
23
260
+ Addedcolors@1.0.3(transitive)
- Removedcolors@0.6.2(transitive)
Updatedcolors@~1.0.2