Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var fs = require('fs')
var gulp = require('gulp')
var $ = require('gulp-load-plugins')()
var del = require('del')
var browserSync = require('browser-sync')
var reload = browserSync.reload
var watchify = require('watchify')
var browserify = require('browserify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var sourcemaps = require('gulp-sourcemaps')
var gutil = require('gulp-util')
var exit = require('gulp-exit')
var rev = require('gulp-rev')
var revReplace = require('gulp-rev-replace')
var SassString = require('node-sass').types.String
var cp = require('child_process')
var notifier = require('node-notifier')
// /////////////////////////////////////////////////////////////////////////////
// --------------------------- Variables -------------------------------------//
// ---------------------------------------------------------------------------//
// The package.json
var pkg
// Environment
// Set the correct environment, which controls what happens in config.js
if (!process.env.DS_ENV) {
if (!process.env.TRAVIS_BRANCH || process.env.TRAVIS_BRANCH !== process.env.DEPLOY_BRANCH) {
process.env.DS_ENV = 'staging'
} else {
it("should stringify space delimited lists", function (done) {
var l = sass.types.List(3);
l.setSeparator(false);
l.setValue(0, sass.types.Number(5, "px"));
l.setValue(1, sass.types.Boolean(true));
l.setValue(2, sass.types.String("'asdf'"));
assert.equal("(5px true 'asdf')", sassUtils.sassString(l));
done();
});
it("should stringify empty maps", function (done) {
it("can remove keys", function (done) {
var map = new sassUtils.SassJsMap();
assert.equal(false, map.delete(sass.types.Number(2, "px")));
map.set(sass.types.Number(2, "px"), sass.types.String("hi"));
assert.equal(1, map.size);
assert.equal(true, map.delete(sass.types.Number(2, "px")));
assert.equal(0, map.size);
assert.equal(undefined, map.get(sass.types.Number(2, "px")));
done();
});
it("can check for a key", function(done) {
it("null.sassString()", function (done) {
assert.equal("null", sass.types.Null().sassString());
done();
});
it("boolean.sassString()", function (done) {
it("unquote handles sass strings", function(done) {
var s = sass.types.String;
assert.equal("asdf", unquote(s('"asdf"')).getValue());
assert.equal("asdf", unquote(s("'asdf'")).getValue());
assert.equal("\"asdf'", unquote(s("\"asdf'")).getValue());
assert.equal("'asdf\"", unquote(s("'asdf\"")).getValue());
assert.equal("asdf", unquote(s("asdf")).getValue());
done();
});
"hello($name: 'Sucker')": function(name) {
return sass.types.String("Goodbye, " + name.getValue() + "!");
}
},
"hexo-config($ckey)": function(ckey) {
var val = getProperty(self.config, ckey.getValue()),
sassVal = new sass.types.String(val);
if (userConfig.debug) {
console.log('hexo-config.' + ckey.getValue(), val);
}
return sassVal;
}
}
function makeValue(sassValue) {
switch(sassValue.constructor) {
case sass.types.String:
case sass.types.Boolean:
return { value: sassValue.getValue() };
case sass.types.Number:
return { value: sassValue.getValue(), unit: sassValue.getUnit() };
case sass.types.Color:
const r = Math.round(sassValue.getR());
const g = Math.round(sassValue.getG());
const b = Math.round(sassValue.getB());
return {
value: {
r, g, b,
a: sassValue.getA(),
hex: `#${toColorHex(r)}${toColorHex(g)}${toColorHex(b)}`
'encodebase64($string)': str => {
const buffer = Buffer.from(str.getValue());
return nodeSass.types.String(buffer.toString('base64'));
},
};
processor.image_url(filename.getValue(), function(url) {
if(!only_path.getValue()) url = 'url(\'' + url + '\')';
done(new sass.types.String(url));
});
},