PHP 7.4.33
Preview: loose-envify.js Size: 791 B
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/loose-envify/loose-envify.js
'use strict';

var stream = require('stream');
var util = require('util');
var replace = require('./replace');

var jsonExtRe = /\.json$/;

module.exports = function(rootEnv) {
  rootEnv = rootEnv || process.env;
  return function (file, trOpts) {
    if (jsonExtRe.test(file)) {
      return stream.PassThrough();
    }
    var envs = trOpts ? [rootEnv, trOpts] : [rootEnv];
    return new LooseEnvify(envs);
  };
};

function LooseEnvify(envs) {
  stream.Transform.call(this);
  this._data = '';
  this._envs = envs;
}
util.inherits(LooseEnvify, stream.Transform);

LooseEnvify.prototype._transform = function(buf, enc, cb) {
  this._data += buf;
  cb();
};

LooseEnvify.prototype._flush = function(cb) {
  var replaced = replace(this._data, this._envs);
  this.push(replaced);
  cb();
};

Directory Contents

Dirs: 0 × Files: 8
Name Size Perms Modified Actions
356 B lrwxr-xr-x 2025-03-28 11:04:34
Edit Download
83 B lrw-r--r-- 2025-03-28 11:04:34
Edit Download
72 B lrw-r--r-- 2025-03-28 11:04:34
Edit Download
1.07 KB lrw-r--r-- 2025-03-28 11:04:34
Edit Download
791 B lrw-r--r-- 2025-03-28 11:04:34
Edit Download
809 B lrw-r--r-- 2025-03-28 11:04:34
Edit Download
1.05 KB lrw-r--r-- 2025-03-28 11:04:34
Edit Download
1.50 KB lrw-r--r-- 2025-03-28 11:04:34
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).