Skip to content

Commit 813a75b

Browse files
committed
Fix variable renaming gone wrong
Closes GH-2
1 parent f60bd81 commit 813a75b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

build/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let code = `
2020
else if (typeof define == 'function' && typeof define.amd == 'object')
2121
define('json.sortify', factory);
2222
else
23-
JSON.sortify = definition();
23+
JSON.sortify = factory();
2424
})(this, function() {
2525
${factory.replace(/\bmodule\s*\.\s*exports\s*=/, 'return ')}
2626
});`;

dist/JSON.sortify.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "json.sortify",
33
"description": "A deterministic version of JSON.stringify that sorts object keys alphabetically.",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"engines": {
66
"node": ">=0.10.0"
77
},

test/smoke.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- TODO: More sophisticated tests for this - GH-3 -->
2+
<script src="../dist/JSON.sortify.js"></script>
3+
<script>
4+
try{
5+
var result = JSON.sortify({b:1,a:2});
6+
if (result !== '{"a":2,"b":1}') {
7+
throw new Error();
8+
}
9+
document.write('<p style="background:lime">PASS</p>');
10+
} catch(e) {
11+
document.write('<p style="background:orangered">FAIL</p>');
12+
}
13+
</script>

0 commit comments

Comments
 (0)