Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colors-tmpl

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colors-tmpl - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

colors-tmpl.js

@@ -27,5 +27,7 @@ /*!

, translators = types.map(function (type) {
var re = new RegExp('\\{' + type + '\\}(.*?)\\{/' + type + '\\}', 'g')
var re = new RegExp('\\{' + type + '\\}([\\s\\S]*?)\\{/' + type + '\\}', 'g')
return function (str) {
return str.replace(re, '$1'[type])
return str.replace(re, function (_, s) {
return s[type]
})
}

@@ -32,0 +34,0 @@ })

@@ -8,3 +8,3 @@ {

, "description": "Simple templating for applying colors.js to strings"
, "version": "0.0.2"
, "version": "0.0.3"
, "homepage": "https://github.com/rvagg/colors-tmpl"

@@ -11,0 +11,0 @@ , "keywords": [ "color", "colour", "colours", "colours", "colors.js", "templating", "templates" ]

@@ -116,1 +116,9 @@ #!/usr/bin/env node

)
assert(
colorsTmpl.render(
'\n{red}red1\nred2\nred3{/red}\n'
)
, '\n' + 'red1\nred2\nred3'.red + '\n'
, 'tags can surround multi-line strings'
)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc