We could do return wP.indexOf(pNS) === 0 so that it has to begin with the same path.  It might be better to add a function to test this IsSameOrChildPath() which is more reusable.