Skip to content

Commit a692f4d

Browse files
committed
demo enhancement
1 parent 4565879 commit a692f4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ <h1>Pickle Parser Demo</h1>
3333
reader.onload = function (event) {
3434
try {
3535
const buffer = new Uint8Array(event.target.result);
36-
const parser = new pickleparser.Parser();
36+
const parser = new pickleparser.Parser({
37+
unpicklingTypeOfSet: 'Set',
38+
unpicklingTypeOfDictionary: 'Map',
39+
});
3740
const obj = parser.parse(buffer);
3841
window.obj = obj;
3942
const replacer = (_, value) => {
@@ -46,6 +49,9 @@ <h1>Pickle Parser Demo</h1>
4649
if (typeof value === 'bigint') {
4750
return value.toString();
4851
}
52+
if (value?.constructor?.name === 'PFunction') {
53+
return value.args;
54+
}
4955
return value;
5056
};
5157
const json = JSON.stringify(obj, replacer, 4);

0 commit comments

Comments
 (0)