nl_tokens: Return true if the urlNode is still current ( not stale ) by sitemap policy . If both lastmod and changefreq tags are supplied both are used . If only one of lastmod or changefreq are supplied then they are compared against previous output if it exists . If a test fails for any reason it is characterized as stale ( returns false ) .
pl_tokens: function stillCurrent ( urlNode , <mask> ) { var lesser , greater , oPath ; var now = Date . now ( ) ; var lMod = _ . first ( urlNode . lastmod ) ; var cFreq = _ . first ( urlNode . changefreq ) ? _ . first ( urlNode . changefreq ) . toLowerCase ( ) : null ; // only lastmod specified if ( lMod && ! cFreq ) { // if sitemap is malformed, just blow up oPath = base . outputFile ( options , urlNode . loc [ 0 ] ) ; lesser = now - ( ( fs . existsSync ( oPath ) && fs . statSync ( oPath ) . mtime . getTime ( ) ) || unixStart ) ; greater = now - Date . parse ( lMod ) ; } // only changefreq specified else if ( ! lMod && cFreq ) { // if sitemap is malformed, just blow up oPath = base . outputFile ( options , urlNode . loc [ 0 ] ) ; lesser = now - ( ( fs . existsSync ( oPath ) && fs . statSync ( oPath ) . mtime . getTime ( ) ) || unixStart ) ; greater = changeFreq [ cFreq ] || changeFreq . always ; } // both or neither were specified else { lesser = now - Date . parse ( lMod || unixStart ) ; greater = changeFreq [ cFreq ] || changeFreq . always ; } return lesser <= greater ; }