Sha256: e55152eacc1f1ba76d6ac14a824535ea68851771466751ac80ff8b3f79077adf

Contents?: true

Size: 684 Bytes

Versions: 234

Compression:

Stored size: 684 Bytes

Contents

var test = require('tap').test
var sigmund = require('../sigmund.js')


// occasionally there are duplicates
// that's an acceptable edge-case.  JSON.stringify and util.inspect
// have some collision potential as well, though less, and collision
// detection is expensive.
var hash = '{abc/def/g{0h1i2{jkl'
var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}

var obj3 = JSON.parse(JSON.stringify(obj1))
obj3.c = /def/
obj3.g[2].cycle = obj3
var cycleHash = '{abc/def/g{0h1i2{jklcycle'

test('basic', function (t) {
    t.equal(sigmund(obj1), hash)
    t.equal(sigmund(obj2), hash)
    t.equal(sigmund(obj3), cycleHash)
    t.end()
})

Version data entries

234 entries across 151 versions & 15 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-sass/node_modules/node-sass/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.5 template/node_modules/babel-core/node_modules/regenerator/node_modules/commoner/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.4 template/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.4 template/node_modules/babel-core/node_modules/regenerator/node_modules/commoner/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-sass/node_modules/node-sass/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.4 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/readdirp/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.3 template/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.3 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/readdirp/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.3 template/node_modules/babel-core/node_modules/regenerator/node_modules/commoner/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-sass/node_modules/node-sass/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/minimatch/node_modules/sigmund/test/basic.js