Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env node
/* eslint-disable no-console */
import program from 'commander';
import pkginfo from 'pkginfo';
import fs from 'fs';
import resin from '../lib/index.js';
pkginfo(module, 'version', 'description');
function list(val) {
const result = val.replace(/(^(?:"|')?\[)|(](?:"|')?$)/g, '').split(',');
return result.map((item) => item.trim().replace(/(^(?:"|')?)|((?:"|')?$)/g, ''));
}
program
.description(module.exports.description)
.usage('[options] ')
.option('-v, --no-vars', 'Passing this flag will skip using the postcss-css-variables plugin.')
.option('-e, --no-extend', 'Passing this flag will skip using the postcss-inherit plugin.')
.option('-n, --namespace ', 'Namespace to use as a prefix for classes.', '')
.option('-u, --urlprefix ', 'String to prepend to urls.', '')
.option('-b, --browsers ', 'Browser string to pass to autoprefixer.', 'last 2 version')
.option('-a, --no-autoprefixer', 'Passing this flag will disable autoprefixer.')
.option('-d, --debug',
function read(pmodule, dir) {
var packageJson = pkginfo.read(pmodule, dir);
var pkgJsonFile = packageJson.dir; // misleading name from pkginfo library
var pkgJsonDir = path.dirname(pkgJsonFile);
var profile = _.get(packageJson['package'], 'jest-webpack-alias.profile');
var configFile = _.get(packageJson['package'], 'jest-webpack-alias.configFile', 'webpack.config.js');
var webpackFile = path.join(pkgJsonDir, configFile);
var webpackSettings = extractES6DefaultExportsObject(require(webpackFile));
if (profile) {
if (!_.isArray(webpackSettings)) {
throw new Error(genProfileError(profile, webpackFile + ' does not export an array'));
}
webpackSettings = _.find(webpackSettings, ['name', profile]);
if (!webpackSettings) {
throw new Error(genProfileError(profile, webpackFile + ' does not contain this profile'));
}
import Xejs from 'xejs';
import pkginfo from 'pkginfo';
pkginfo(module, "version");
const version = module.exports.version;
function getDate(): string {
const date = new Date();
const day = date.getDate();
const month = date.getMonth() + 1;
const year = date.getFullYear();
return day + "/" + month + "/" + year;
}
export default class XejsLoader {
public loadFile(file: string): Promise {
const options = this.generateOptions();
const loader = new Xejs(options);
return loader.render(file);
}