You've already forked setup-dotnet
mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-16 18:44:38 +07:00
GPR authentication support
This commit is contained in:

committed by
Alex Mullans

parent
6c0e2a2a6b
commit
6bd4969ec6
16
node_modules/nimn-date-parser/.vscode/launch.json
generated
vendored
Normal file
16
node_modules/nimn-date-parser/.vscode/launch.json
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Jasmine Tests",
|
||||
"program": "${workspaceFolder}/node_modules/jasmine/bin/jasmine.js",
|
||||
"args": [
|
||||
"${workspaceFolder}/test/dateparser_test.js"
|
||||
],
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
21
node_modules/nimn-date-parser/LICENSE
generated
vendored
Normal file
21
node_modules/nimn-date-parser/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
139
node_modules/nimn-date-parser/dateparser.js
generated
vendored
Normal file
139
node_modules/nimn-date-parser/dateparser.js
generated
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
var monthInitials = ["J","F","M","A","m","j","U","a","S","O","N","D"];
|
||||
|
||||
var initials = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
|
||||
var timeZone = [
|
||||
12*60,
|
||||
11*60,
|
||||
10*60,
|
||||
9.5*60,
|
||||
9*60,
|
||||
8*60,
|
||||
7*60,
|
||||
6*60,
|
||||
5*60,
|
||||
4*60,
|
||||
3.5*60,
|
||||
3*60,
|
||||
2*60,
|
||||
1*60,
|
||||
0*60,
|
||||
-1*60,
|
||||
-2*60,
|
||||
-3*60,
|
||||
-3.5*60,
|
||||
-4*60,
|
||||
-4.5*60,
|
||||
-5*60,
|
||||
-5.5*60,
|
||||
-5.75*60,
|
||||
-6*60,
|
||||
-6.5*60,
|
||||
-7*60,
|
||||
-8*60,
|
||||
-8.5*60,
|
||||
-8.75*60,
|
||||
-9*60,
|
||||
-9.5*60,
|
||||
-10*60,
|
||||
-10.5*60,
|
||||
-11*60,
|
||||
-12*60,
|
||||
-12.75*60,
|
||||
-13*60,
|
||||
-14*60
|
||||
];
|
||||
|
||||
function parseToUTC(dtObj, includeDate, includeCentury, includeTime){
|
||||
if(typeof dtObj === "string"){
|
||||
dtObj = new Date(dtObj);
|
||||
}
|
||||
var dtStr = "";
|
||||
if(includeCentury){
|
||||
dtStr += char(Math.floor(dtObj.getUTCFullYear()/100)) ;
|
||||
}
|
||||
if(includeDate){//3
|
||||
//year
|
||||
dtStr += char(dtObj.getUTCFullYear()%100);
|
||||
//month
|
||||
dtStr += monthInitials[dtObj.getUTCMonth()];
|
||||
//date
|
||||
dtStr += initials[dtObj.getUTCDate()]
|
||||
}
|
||||
|
||||
if(includeTime){//5
|
||||
//h
|
||||
dtStr += initials[dtObj.getUTCHours()]
|
||||
//m
|
||||
dtStr += initials[dtObj.getUTCMinutes()];
|
||||
//s
|
||||
dtStr += initials[dtObj.getUTCSeconds()];
|
||||
//ms
|
||||
var ms = dtObj.getUTCMilliseconds();
|
||||
dtStr += char(Math.floor(ms/10)) ;
|
||||
dtStr += char(ms%10) ;
|
||||
}
|
||||
|
||||
//zone
|
||||
//if(includeZone){//1
|
||||
dtStr += initials[timeZone.indexOf(dtObj.getTimezoneOffset() ) ]
|
||||
//}
|
||||
return dtStr;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} dtStr
|
||||
* @param {*} includeDate
|
||||
* @param {*} includeCentury
|
||||
* @param {*} includeTime
|
||||
* @param {*} includeZone
|
||||
*/
|
||||
function parseBackUTC(dtStr,includeDate, includeCentury, includeTime){
|
||||
|
||||
var century = 0;
|
||||
var startFrom = 0;
|
||||
var Y = 0, M = 0, D = 0, h = 0, m = 0, s = 0, ms = 0, z = 0;
|
||||
if(includeCentury){//1st digit is century
|
||||
century = 100 * ascii(dtStr[startFrom++]);
|
||||
}
|
||||
|
||||
if(includeDate){
|
||||
Y = century + ascii(dtStr[startFrom++]);
|
||||
M = monthInitials.indexOf(dtStr[startFrom++]);
|
||||
D = initials.indexOf(dtStr[startFrom++])
|
||||
//startFrom += 3;
|
||||
}
|
||||
|
||||
if(includeTime){
|
||||
h = initials.indexOf(dtStr[startFrom++]);
|
||||
m = initials.indexOf(dtStr[startFrom++]);
|
||||
s = initials.indexOf(dtStr[startFrom++]);
|
||||
|
||||
ms = ascii(dtStr[startFrom++])*10 + ascii(dtStr[startFrom++]);
|
||||
//startFrom += 5;
|
||||
}
|
||||
var dt = new Date(Y,M,D,h,m,s,ms);
|
||||
//if(includeZone){
|
||||
z = timeZone[initials.indexOf(dtStr[startFrom])];
|
||||
dt.setTime(dt.getTime() - z*60*1000);
|
||||
//}
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
function ascii(ch){
|
||||
return ch.charCodeAt(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* converts a ASCII number into equivalant ASCII char
|
||||
* @param {number} a
|
||||
* @returns ASCII char
|
||||
*/
|
||||
var char = function (a){
|
||||
return String.fromCharCode(a);
|
||||
}
|
||||
|
||||
exports.parse = parseToUTC;
|
||||
exports.parseBack = parseBackUTC;
|
63
node_modules/nimn-date-parser/package.json
generated
vendored
Normal file
63
node_modules/nimn-date-parser/package.json
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"nimn-date-parser@1.0.0",
|
||||
"C:\\dev\\repos\\actions\\setup-dotnet"
|
||||
]
|
||||
],
|
||||
"_from": "nimn-date-parser@1.0.0",
|
||||
"_id": "nimn-date-parser@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-1Nf+x3EeMvHUiHsVuEhiZnwA8RMeOBVTQWfB1S2n9+i6PYCofHd2HRMD+WOHIHYshy4T4Gk8wQoCol7Hq3av8Q==",
|
||||
"_location": "/nimn-date-parser",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "nimn-date-parser@1.0.0",
|
||||
"name": "nimn-date-parser",
|
||||
"escapedName": "nimn-date-parser",
|
||||
"rawSpec": "1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nimnjs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/nimn-date-parser/-/nimn-date-parser-1.0.0.tgz",
|
||||
"_spec": "1.0.0",
|
||||
"_where": "C:\\dev\\repos\\actions\\setup-dotnet",
|
||||
"author": {
|
||||
"name": "Amit Gupta",
|
||||
"url": "https://github.com/amitguptagwl"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/nimndata/nimnjs-date-parser/issues"
|
||||
},
|
||||
"description": "Compress date for nimnjs",
|
||||
"devDependencies": {
|
||||
"jasmine": "^3.0.0",
|
||||
"jasmine-core": "^2.99.1"
|
||||
},
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"homepage": "https://github.com/nimndata/nimnjs-date-parser#readme",
|
||||
"keywords": [
|
||||
"nimn",
|
||||
"nimnjs",
|
||||
"date",
|
||||
"parser"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dateparser.js",
|
||||
"name": "nimn-date-parser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nimndata/nimnjs-date-parser.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jasmine tests/*test.js"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
72
node_modules/nimn-date-parser/tests/dateparser_test.js
generated
vendored
Normal file
72
node_modules/nimn-date-parser/tests/dateparser_test.js
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
var parser = require("../dateparser.js");
|
||||
|
||||
describe("Date parser", function () {
|
||||
it(" should parse and parseback full date", function () {
|
||||
|
||||
var dt = new Date("Mon Feb 26 2018 17:42:17 GMT+0530 (IST)");
|
||||
//var dt = new Date("Tue May 15 2012 05:45:40 GMT-0500");
|
||||
//console.log(dt);
|
||||
|
||||
var nimnDt = parser.parse(dt,true,true,true);
|
||||
console.log(nimnDt);
|
||||
|
||||
var dt2 = parser.parseBack(nimnDt,true,true,true);
|
||||
//console.log(dt2);
|
||||
|
||||
expect(dt).toEqual(dt2);
|
||||
expect(10).toEqual(nimnDt.length);
|
||||
|
||||
});
|
||||
|
||||
it(" should parse and parseback only date part", function () {
|
||||
|
||||
var dt = new Date();
|
||||
//console.log(dt);
|
||||
|
||||
var nimnDt = parser.parse(dt,true,false);
|
||||
//console.log(nimnDt);
|
||||
|
||||
var dt2 = parser.parseBack(nimnDt,true,false);
|
||||
//console.log(dt2);
|
||||
|
||||
expect(4).toEqual(nimnDt.length);
|
||||
expect(dt.getFullYear()%100).toEqual(dt2.getFullYear()%100);
|
||||
expect(dt.getMonth()).toEqual(dt2.getMonth());
|
||||
expect(dt.getDate()).toEqual(dt2.getDate());
|
||||
|
||||
});
|
||||
|
||||
it(" should parse and parseback date part with century", function () {
|
||||
var dt = new Date();
|
||||
//console.log(dt);
|
||||
|
||||
var nimnDt = parser.parse(dt,true,true);
|
||||
//console.log(nimnDt);
|
||||
|
||||
var dt2 = parser.parseBack(nimnDt,true,true);
|
||||
//console.log(dt2);
|
||||
|
||||
expect(5).toEqual(nimnDt.length);
|
||||
expect(dt.getFullYear()).toEqual(dt2.getFullYear());
|
||||
expect(dt.getMonth()).toEqual(dt2.getMonth());
|
||||
expect(dt.getDate()).toEqual(dt2.getDate());
|
||||
});
|
||||
|
||||
it(" should parse and parseback time", function () {
|
||||
var dt = new Date();
|
||||
//console.log(dt);
|
||||
|
||||
var nimnDt = parser.parse(dt,false,false,true);
|
||||
//console.log(nimnDt);
|
||||
|
||||
var dt2 = parser.parseBack(nimnDt,false,false,true);
|
||||
//console.log(dt2);
|
||||
|
||||
expect(6).toEqual(nimnDt.length);
|
||||
expect(dt.getHours()).toEqual(dt2.getHours());
|
||||
expect(dt.getMinutes()).toEqual(dt2.getMinutes());
|
||||
expect(dt.getSeconds()).toEqual(dt2.getSeconds());
|
||||
expect(dt.getMilliseconds()).toEqual(dt2.getMilliseconds());
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user