Skip to content

Commit

Permalink
feat: expose stringify() function
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 13, 2018
1 parent 7bac059 commit d4756d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions lib/hash.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
'use strict';

var stringify = require('fastest-stable-stringify');

exports.hash = function(styles) {
var str = stringify(styles);
exports.hash = function(str) {
var hash = 5381,
i = str.length;

Expand Down
8 changes: 5 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ exports.create = function (h) {
raw: '',
cns: {},
pfx: '_',
cnt: 0,
hash: hash,
decl: function (key, value) {
key = key.replace(KEBAB_REGEX, '-$&').toLowerCase();
return key + ':' + value + ';';
}
},
stringify: JSON.stringify,
hash: function (obj) {
return hash(renderer.stringify(obj));
},
};

var putRaw;
Expand Down

0 comments on commit d4756d8

Please sign in to comment.