How to use node-object-hash - 10 common examples

To help you get started, we’ve selected a few node-object-hash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chrisblossom / react-universal-starter / tools / webpack / dll.js View on Github external
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
github zuzucheFE / guido / lib / config / webpack.config.prod.js View on Github external
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.
github MattSurabian / DuckHunt-JS / webpack.config.js View on Github external
configHash: function(webpackConfig) {
        return require('node-object-hash')().hash(webpackConfig);
      }
    })
github lnked / react-starter / webpack / plugins / hard-cache.js View on Github external
configHash: (webpackConfig) => (
            require('node-object-hash')({
                sort: false
            }).hash(webpackConfig)
        ),
        environmentHash: {
github phenomic / phenomic / src / _utils / cache / webpack.js View on Github external
      configHash: (config) => (new ObjectHash()).hash(config),
      environmentPaths: {
github VisualComposer / builder / public / editor / services / stylesManager / service.js View on Github external
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())
      }
github phenomic / phenomic / src / _utils / hard-source-webpack-plugin / index.js View on Github external
export const getCacheDir = (config: PhenomicConfig): string => {
  return findCacheDir({
    name: "phenomic/webpack-hard-source-cache/" +
    (new ObjectHash()).hash(config),
  })
}
github phenomic / phenomic / src / _utils / cache / webpack.js View on Github external
      configHash: (config) => (new ObjectHash()).hash(config),
      environmentPaths: {
github isoreact / core / src / key-for.js View on Github external
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) {

node-object-hash

Node.js object hash library with properties/arrays sorting to provide constant hashes

MIT
Latest version published 5 days ago

Package Health Score

89 / 100
Full package analysis