Socket
Book a DemoInstallSign in
Socket

@existdb/gulp-replace-tmpl

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@existdb/gulp-replace-tmpl - npm Package Compare versions

Comparing version

to
1.0.2

19

index.js

@@ -162,2 +162,3 @@ const replace = require('gulp-replace')

function GulpReplaceTmpl (replacements, options) {
const _options = options || {}
// required option missing

@@ -167,3 +168,3 @@ if (!replacements) {

}
if (options.prefix && options.prefix.match(/[^a-zA-Z0-9]/)) {
if (_options.prefix && _options.prefix.match(/[^a-zA-Z0-9]/)) {
throw new Error('Invalid prefix, only [a-zA-Z0-9] allowed')

@@ -176,3 +177,3 @@ }

if (!options.prefix && !options.unprefixed) {
if (!_options.prefix && !_options.unprefixed) {
prefix = defaultPrefix

@@ -182,14 +183,14 @@ pattern = defaultPattern

}
if (options.prefix) {
prefix = options.prefix
pattern = new RegExp(`@(${options.prefix}\.)?([a-zA-Z0-9]+)@`, 'g')
handler = getMatchHandlerWithPrefix(options.prefix, mergedReplacements)
if (_options.prefix) {
prefix = _options.prefix
pattern = new RegExp(`@(${_options.prefix}\.)?([a-zA-Z0-9]+)@`, 'g')
handler = getMatchHandlerWithPrefix(_options.prefix, mergedReplacements)
}
if (options.unprefixed) {
if (_options.unprefixed) {
prefix = undefined
pattern = /@([a-zA-Z0-9]+)@/g
handler = getMatchHandler(mergedReplacements, options)
handler = getMatchHandler(mergedReplacements, _options)
}
if (options.debug) {
if (_options.debug) {
console.log('Prefix:', prefix || 'unprefixed')

@@ -196,0 +197,0 @@ console.log('Replacements:', mergedReplacements)

{
"name": "@existdb/gulp-replace-tmpl",
"version": "1.0.1",
"version": "1.0.2",
"description": "Replace placeholders in files",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.