Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should render post title', () => {
const query = { complete: true, OK: true, entities: [postJson.id] }
state = merge({}, stateMultipleEntities, { wordpress: { queries: { 0: query } } })
rendered.update() // Fake store update from completed request
expect(rendered.html()).toEqual('<div>Architecto enim omnis repellendus</div>')
})
})
return (
includePatterns.some(pattern => minimatch(id, pattern)) &&
!excludePatterns
.concat("@environments/**/*")
.some(pattern => minimatch(id, pattern))
);
});
if (!includedPatterns.length) {
application.log.warn(
`No patterns to read for environment ${environment.name}. Check the .includes key of the environment configuration.`
);
}
// Merge environment config into transform config
const config = merge(
{},
{
patterns: settings.patterns,
transforms: settings.transforms
},
envConfig,
{
environments: [environment.name]
}
);
const filters = merge({}, settings.filters, {
inFormats: formats,
environments: [environment.name]
});
},
plugins: [
resolve(),
commonjs(),
json(),
eslint(pluginSettings.eslint)
],
watch: {
clearScreen: false
}
};
// Formats
// -----------------------------------------------------------------------------
// ES Module
const esm = merge({}, config, {
output: {
file : config.output.file.replace(/\.js$/, '.esm.js'),
format: 'esm'
},
plugins: config.plugins.concat([
babel(pluginSettings.babel.es6),
terser(pluginSettings.terser.beautify)
])
});
// ES Module (Minified)
const esmMinified = merge({}, config, {
output: {
file : esm.output.file.replace(/\.js$/, '.min.js'),
format: esm.output.format
},
function getOptions(options) {
return merge({
humanErrors: true, // Display human errors
stats: true, // Display output assets, can be `true`, `false` and `once`
statsOptions: { // Stats object to use for stats.toString(),
assets: true,
chunks: false,
version: false,
children: false,
modules: false,
timings: false,
hash: false,
colors: chalk.enabled,
},
output: process.stderr, // Writable stream to print stuff
}, options);
}
_registerPlugin(compiler: Compiler) {
const { reloadPage, port, entries } = merge(defaultOptions, this._opts);
this._eventAPI = new CompilerEventsFacade(compiler);
this._injector = middlewareInjector(entries, { port, reloadPage });
this._triggerer = changesTriggerer(port, reloadPage);
this._eventAPI.afterOptimizeChunkAssets((comp, chunks) => {
if (!compiler.options.entry || !compiler.options.entry["background"]) {
throw new TypeError(bgScriptRequiredMsg.get());
}
comp.assets = {
...comp.assets,
...this._injector(comp.assets, chunks)
};
});
this._eventAPI.afterEmit((comp, done) => {
if (this._contentOrBgChanged(comp.chunks, entries)) {
this._triggerer()
addDeck(specs){
const deck = specs.deck;
this.setState({
decks: _.merge(this.state.decks, { [deck.id]: deck })
});
}
if (
this.argv.project ||
(!this.argv.project &&
(has(this.project.config, "extensions.generate-fragments") ||
has(this.project.config, "extensions.fragments")))
) {
this.context.spinner.start(
`Generating fragments for project ${this.projectDisplayName()}...`
);
fragmentsExtensionConfig = this.processFragments(
this.fragmentsExtensionConfig
? this.fragmentsExtensionConfig["generate-fragments"]
: undefined
);
merge(this.project.extensions, fragmentsExtensionConfig);
this.context.spinner.succeed(
`Fragments for project ${this.projectDisplayName()} written to ${chalk.green(
fragmentsExtensionConfig["generate-fragments"].output
)}`
);
} else if (this.argv.verbose) {
this.context.spinner.info(
`Generate Fragments not configured for project ${this.projectDisplayName()}. Skipping`
);
}
}
function middleware(request, response, next) {
//2.1.0...obtain request params and query parameters
const params = _.merge({}, request.params);
const query = _.merge({}, request.query);
//2.1.1...obtain request body
const body = _.merge({}, request.body);
//2.1.2...obtain resource _id
const _id = (params.id || params._id) || (query.id || query._id);
//TODO pass edit options
//2.1.3...create resource(s)
findAndUpdate(_id, body, function afterUpdate(error, results) {
//2.2...handle error or not results
if (error || !results) {
//TODO notify error
//TODO notify no results
//ensure status
error.status = error.status || 500;
onSearch(searchString, filter) {
const f = new ChallengeFilterWithSearch();
_.merge(f, filter);
f.query = searchString;
this.setState({ searchQuery: searchString }, () => this.onFilterByTopFilter(f));
}