How to use the value-or-function.date function in value-or-function

To help you get started, we’ve selected a few value-or-function examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gulpjs / vinyl-fs / lib / file-operations.js View on Github external
function getTimesDiff(fsStat, vinylStat) {

  var mtime = date(vinylStat.mtime) || 0;
  if (!mtime) {
    return;
  }

  var atime = date(vinylStat.atime) || 0;
  if (+mtime === +fsStat.mtime &&
      +atime === +fsStat.atime) {
    return;
  }

  if (!atime) {
    atime = date(fsStat.atime) || undefined;
  }

  var timesDiff = {
    mtime: vinylStat.mtime,
github gulpjs / vinyl-fs / lib / file-operations.js View on Github external
function getTimesDiff(fsStat, vinylStat) {

  var mtime = date(vinylStat.mtime) || 0;
  if (!mtime) {
    return;
  }

  var atime = date(vinylStat.atime) || 0;
  if (+mtime === +fsStat.mtime &&
      +atime === +fsStat.atime) {
    return;
  }

  if (!atime) {
    atime = date(fsStat.atime) || undefined;
  }

  var timesDiff = {
    mtime: vinylStat.mtime,
    atime: atime,
  };

  return timesDiff;
}
github gulpjs / vinyl-fs / lib / file-operations.js View on Github external
function getTimesDiff(fsStat, vinylStat) {

  var mtime = date(vinylStat.mtime) || 0;
  if (!mtime) {
    return;
  }

  var atime = date(vinylStat.atime) || 0;
  if (+mtime === +fsStat.mtime &&
      +atime === +fsStat.atime) {
    return;
  }

  if (!atime) {
    atime = date(fsStat.atime) || undefined;
  }

  var timesDiff = {
    mtime: vinylStat.mtime,
    atime: atime,
  };

  return timesDiff;
}

value-or-function

Normalize a value or function, applying extra args to the function

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis