kopia lustrzana https://github.com/robinmoisson/staticrypt
handle spaces in {tag} placeholders when rendering - closes #148
rodzic
158668677d
commit
4fa627980c
|
@ -7,7 +7,7 @@
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
function renderTemplate(templateString, data) {
|
function renderTemplate(templateString, data) {
|
||||||
return templateString.replace(/{(.*?)}/g, function (_, key) {
|
return templateString.replace(/{\s*(\w+)\s*}/g, function (_, key) {
|
||||||
if (data && data[key] !== undefined) {
|
if (data && data[key] !== undefined) {
|
||||||
return data[key];
|
return data[key];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "staticrypt",
|
"name": "staticrypt",
|
||||||
"version": "2.3.3",
|
"version": "2.3.4",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "staticrypt",
|
"name": "staticrypt",
|
||||||
"version": "2.3.3",
|
"version": "2.3.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"crypto-js": "3.1.9-1",
|
"crypto-js": "3.1.9-1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "staticrypt",
|
"name": "staticrypt",
|
||||||
"version": "2.3.3",
|
"version": "2.3.4",
|
||||||
"description": "Based on the [crypto-js](https://github.com/brix/crypto-js) library, StatiCrypt uses AES-256 to encrypt your input with your passphrase and put it in a HTML file with a password prompt that can decrypted in-browser (client side).",
|
"description": "Based on the [crypto-js](https://github.com/brix/crypto-js) library, StatiCrypt uses AES-256 to encrypt your input with your passphrase and put it in a HTML file with a password prompt that can decrypted in-browser (client side).",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
Ładowanie…
Reference in New Issue