Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
configHash: function(webpackConfig) {
// Build a string value used by HardSource to determine which cache to
// use if [confighash] is in cacheDirectory or if the cache should be
// replaced if [confighash] does not appear in cacheDirectory.
//
// node-object-hash on npm can be used to build this.
return require('node-object-hash')({ sort: false }).hash(
webpackConfig
);
},
// This field determines when to throw away the whole cache if for
configHash: function(webpackConfig) {
// node-object-hash on npm can be used to build this.
return require('node-object-hash')({ sort: false }).hash(
webpackConfig
);
},
// Clean up large, old caches automatically.
configHash: function(webpackConfig) {
return require('node-object-hash')().hash(webpackConfig);
}
})
configHash: (webpackConfig) => (
require('node-object-hash')({
sort: false
}).hash(webpackConfig)
),
environmentHash: {
configHash: (config) => (new ObjectHash()).hash(config),
environmentPaths: {
this.get().forEach((style) => {
let hasher = objectHash({ sort: true, coerce: true }).hash
let hash = hasher(style)
if (typeof cssHashes[ hash ] !== 'undefined' && typeof cssHashes[ hash ].result !== 'undefined') {
return iterations.push(cssHashes[ hash ].result)
}
let use = []
if (style.hasOwnProperty('variables')) {
use.push(postcssAdvancedVars({
variables: style.variables
}))
use.push(postcssCustomProps(style.variables))
} else {
use.push(postcssAdvancedVars())
use.push(postcssCustomProps())
}
export const getCacheDir = (config: PhenomicConfig): string => {
return findCacheDir({
name: "phenomic/webpack-hard-source-cache/" +
(new ObjectHash()).hash(config),
})
}
configHash: (config) => (new ObjectHash()).hash(config),
environmentPaths: {
import objectSorter from 'node-object-hash/objectSorter';
import sha256 from 'hash.js/lib/hash/sha/256';
const sortObject = objectSorter();
const hashObject = (props) => (
sha256()
.update(sortObject(props))
.digest('hex')
);
/**
* Generate a <code>hydration</code> key based on an isomorphic component name and the props of one of its instances
* or nested isomorphic component instances.
*
* @param {string} name - isomorphic component name
* @param {Object} props - isomorphic component instance props
* @return {string} the hydration key
*/
export default function keyFor(name, props) {