From e85032bef5e234ec911fdb5844f6bc605766e19e Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 2 Mar 2023 16:39:36 -0800 Subject: [PATCH] bug in readme example code --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef821aca..c62c164a 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,8 @@ const folderNamedModules = await glob('**/*.{ts,js}', { } }) -// find all files edited in the last hour +// find all files edited in the last hour, to do this, we ignore +// all of them that are more than an hour old const newFiles = await glob('**', { // need stat so we have mtime stat: true, @@ -126,7 +127,7 @@ const newFiles = await glob('**', { nodir: true, ignore: { ignored: (p) => { - return (new Date() - p.mtime) <= (60 * 60 * 1000) + return (new Date() - p.mtime) > (60 * 60 * 1000) }, // could add similar childrenIgnored here as well, but // directory mtime is inconsistent across platforms, so