initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
37
github/codeql-action-v1/node_modules/date-time/index.js
generated
vendored
Normal file
37
github/codeql-action-v1/node_modules/date-time/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
const timeZone = require('time-zone');
|
||||
|
||||
const dateTime = options => {
|
||||
options = Object.assign({
|
||||
date: new Date(),
|
||||
local: true,
|
||||
showTimeZone: false,
|
||||
showMilliseconds: false
|
||||
}, options);
|
||||
|
||||
let {date} = options;
|
||||
|
||||
if (options.local) {
|
||||
// Offset the date so it will return the correct value when getting the ISO string
|
||||
date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
|
||||
}
|
||||
|
||||
let end = '';
|
||||
|
||||
if (options.showTimeZone) {
|
||||
end = ' UTC' + (options.local ? timeZone(date) : '');
|
||||
}
|
||||
|
||||
if (options.showMilliseconds && date.getUTCMilliseconds() > 0) {
|
||||
end = ` ${date.getUTCMilliseconds()}ms${end}`;
|
||||
}
|
||||
|
||||
return date
|
||||
.toISOString()
|
||||
.replace(/T/, ' ')
|
||||
.replace(/\..+/, end);
|
||||
};
|
||||
|
||||
module.exports = dateTime;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = dateTime;
|
||||
Loading…
Add table
Add a link
Reference in a new issue