We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3edd4c commit c1cfa16Copy full SHA for c1cfa16
src/library_fs.js
@@ -895,7 +895,7 @@ FS.staticInit();
895
}
896
#endif
897
},
898
- readlink(path) {
+ readlink(path, opts = {}) {
899
var lookup = FS.lookupPath(path);
900
var link = lookup.node;
901
if (!link) {
@@ -904,7 +904,11 @@ FS.staticInit();
904
if (!link.node_ops.readlink) {
905
throw new FS.ErrnoError({{{ cDefs.EINVAL }}});
906
907
- return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
+ const target = link.node_ops.readlink(link);
908
+ if (opts.noResolve) {
909
+ return target;
910
+ }
911
+ return PATH_FS.resolve(FS.getPath(link.parent), target);
912
913
stat(path, dontFollow) {
914
var lookup = FS.lookupPath(path, { follow: !dontFollow });
0 commit comments