Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ImportDeclaration({ node }, { file }) {
const sourceValue = node.source.value;
const extname = path.extname(sourceValue);
const cssIndex = cssSuffixs.indexOf(extname);
// Do not convert `import styles from './foo.css'` kind
if (node.specifiers.length === 0 && cssIndex > -1) {
let cssFileCount = file.get('cssFileCount') || 0;
let cssParamIdentifiers = file.get('cssParamIdentifiers') || [];
const cssFileBaseName = camelcase(path.basename(sourceValue, extname));
const styleSheetIdentifier = t.identifier(`${cssFileBaseName + NAME_SUFFIX}`);
node.specifiers = [t.importDefaultSpecifier(styleSheetIdentifier)];
cssParamIdentifiers.push(styleSheetIdentifier);
cssFileCount++;
file.set('cssParamIdentifiers', cssParamIdentifiers);
file.set('cssFileCount', cssFileCount);
}
}
}
describe('range queries', () => {
const aboveMethod = camelcase('above', name);
const belowMethod = camelcase('below', name);
const betweenMethod = camelcase('between', pluralise(name));
const atMethod = camelcase('at', name);
const atBreakpointMethod = camelcase('at', name, 'Breakpoint');
describe(`${aboveMethod}()`, () => {
runTests(tests.above, name, aboveMethod);
});
describe(`${belowMethod}()`, () => {
runTests(tests.below, name, belowMethod);
});
describe(`${betweenMethod}()`, () => {
runTests(tests.between, name, betweenMethod);
});
describe(`${atMethod}()`, () => {
runTests(tests.at, name, atMethod);
const split = key.split(splitter).filter(Boolean).map(k => camelcase(k));
const splitLen = split.length;
return new Promise((resolve, reject) => {
const camelizedName = camelCase(moduleName);
const API_URL = `https://www.brcdn.org/${moduleName}/latest?standalone=${camelizedName}`;
dispatch(startRequest(API_URL));
var script = document.createElement("script");
script.src = API_URL;
script.onload = () => {
console.log(camelizedName);
if (window[camelizedName]) {
dispatch(successResponse(API_URL));
window[moduleName] = window[camelizedName];
dispatch(addRule(moduleName, window[camelizedName]));
resolve(window[moduleName]);
} else {
const error = new Error(`Not use ${moduleName}`);
dispatch(failureResponse(API_URL, error));
reject(error);
}
files.forEach(function (file) {
var name = path.basename(file).split('.')[0];
var filePath = getFilePath(opts.sourcePath, file, subDir);
var dir = filePath.split('/')[0];
if (dir) {
if (!dirMap[dir]) {
dirMap[dir] = [];
if (shouldExport) {
var dirName = camelcase_1.default(dir, {
pascalCase: true
});
content += isES6
? "export * as " + dirName + " from './" + dir + "'\n"
: "module.exports." + dirName + " = require('./" + dir + "')\n";
}
else {
content += isES6
? "import './" + dir + "'\n"
: "require('./" + dir + "')\n";
}
}
dirMap[dir].push(file);
}
else {
if (shouldExport) {
const camel = (value) => camelcase(value);
const extractFlagName = flow(flags, extractLongTag, camel);
-d, --out-dir <output dir=""> Set output directory.
--flow Set babel plugin to use, like 'runtime' or
'strip-types' (default).
--help Print this help.
-w, --watch Watch files, recompile on change.
Visit https://github.com/andywer/gear for more information.
`, {
alias: {
d: 'out-dir',
w: 'watch'
}
})
const [ commandName, ...args ] = cli.input
const command = commandName ? commands[ camelcase(commandName.toLowerCase()) ] : null
if (!commandName || cli.flags.help) {
cli.showHelp()
} else if (command) {
command(args, cli.flags, createLogger())
} else {
throw new Error(`Unknown command: ${commandName}`)
}
</output>
return string => {
if (!cache[string]) {
cache[string] = camelCase(string)
}
return cache[string]
}
})()
Object.entries( state ).map( ( [ key ] ) => {
if ( ! reducers[ key ] ) {
const type = `SET_${ key.toUpperCase() }`
const action = camelCase( `set_${ key }` )
actions[ action ] = value => ( { type, value } )
}
} )
.on('data', function(data){
counter++;
if(counter === 1){
for(let prop in data){
if (validUrl.isUri(data[prop].toString()) && contextOptions['skippedColumns'].indexOf(camelCase(prop)) == -1){
if(contextOptions['customMappings'] && contextOptions['customMappings'][camelCase(prop)]){
contextObj[contextOptions['customMappings'][camelCase(prop)]] = {
'@type': '@id'
};
}else{
contextObj['v:' + camelCase(prop)] = {
'@type': '@id'
};
}
}
}
}
let tmpObj = {};
tmpObj['@type'] = contextOptions['entityType'];
for(let prop in data){
if(!prop.trim()){
continue;