template-file
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -1,3 +0,3 @@ | ||
declare type DataValue = string | number | Data | (() => string | number | Data); | ||
interface Data extends Record<string | number | symbol, DataValue | DataValue[]> { | ||
export declare type DataValue = string | number | Data | (() => string | number | Data); | ||
export interface Data extends Record<string | number | symbol, DataValue | DataValue[]> { | ||
} | ||
@@ -8,2 +8,1 @@ export declare function renderGlob(sourceGlob: string, data: Data, onFileCallback: (filename: string, contents: string) => void): Promise<void>; | ||
export declare function renderToFolder(sourceGlob: string, destination: string, data: Data): Promise<void>; | ||
export {}; |
@@ -35,10 +35,10 @@ "use strict"; | ||
function getTemplateRegEx() { | ||
const anything = '([\\s\\S]*?)'; | ||
const optionalNewLines = '\\n*'; | ||
const optionalWhitespace = '\\s*'; | ||
const spaceNotNewLines = `[ \t]*`; | ||
const anything = String.raw `([\s\S]*?)`; | ||
const optionalNewLines = String.raw `\n*`; | ||
const optionalWhitespace = String.raw `\s*`; | ||
const spaceNotNewLines = String.raw `[ \t]*`; | ||
const tagStart = `{{${optionalWhitespace}`; | ||
const tagEnd = `${optionalWhitespace}}}`; | ||
const sectionStart = `${spaceNotNewLines}${tagStart}(?:#(.*?))${tagEnd}${optionalNewLines}`; | ||
const sectionEnd = `${optionalWhitespace}${tagStart}\\/\\1${tagEnd}`; | ||
const sectionEnd = String.raw `${optionalWhitespace}${tagStart}/\1${tagEnd}`; | ||
const repeatingSectionTag = `${sectionStart}${anything}${sectionEnd}`; | ||
@@ -45,0 +45,0 @@ const replacementTag = `${tagStart}(.*?)${tagEnd}`; |
{ | ||
"name": "template-file", | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "description": "🔀 Replace {{ variables }} in all your files", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
84634
171