appsync-template-tester
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -31,3 +31,3 @@ "use strict"; | ||
const res = util_time_1.parseFormattedToEpochMilliSecond(time, format); | ||
expect(res.toString().length); | ||
expect(res.toString().length).toBe(13); | ||
}); | ||
@@ -38,5 +38,31 @@ test('time and format and timezone', () => { | ||
const res = util_time_1.parseFormattedToEpochMilliSecond(time, format, 'Australia/Perth'); | ||
expect(res.toString().length); | ||
expect(res.toString().length).toBe(13); | ||
}); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC10aW1lLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdHMvdXRpbC10aW1lLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw0Q0FNc0I7QUFFdEIsSUFBSSxDQUFDLFlBQVksRUFBRSxHQUFHLEVBQUU7SUFDdEIsTUFBTSxHQUFHLEdBQUcsc0JBQVUsRUFBRSxDQUFDO0lBQ3pCLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxPQUFPLENBQUMsOENBQThDLENBQUMsQ0FBQztBQUN0RSxDQUFDLENBQUMsQ0FBQztBQUVILElBQUksQ0FBQyxpQkFBaUIsRUFBRSxHQUFHLEVBQUU7SUFDM0IsTUFBTSxHQUFHLEdBQUcsMkJBQWUsRUFBRSxDQUFDO0lBQzlCLE1BQU0sQ0FBQyxHQUFHLENBQUMsUUFBUSxFQUFFLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ3pDLENBQUMsQ0FBQyxDQUFDO0FBRUgsSUFBSSxDQUFDLHNCQUFzQixFQUFFLEdBQUcsRUFBRTtJQUNoQyxNQUFNLEdBQUcsR0FBRyxnQ0FBb0IsRUFBRSxDQUFDO0lBQ25DLE1BQU0sQ0FBQyxHQUFHLENBQUM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zc1onO1xuICAgIGNvbnN0IHRpbWUgPSBub3dGb3JtYXR0ZWQoZm9ybWF0KTtcbiAgICBjb25zdCByZXMgPSBwYXJzZUZvcm1hdHRlZFRvRXBvY2hNaWxsaVNlY29uZChcbiAgICAgIHRpbWUsXG4gICAgICBmb3JtYXQsXG4gICAgICAnQXVzdHJhbGlhL1BlcnRoJ1xuICAgICk7XG4gICAgZXhwZWN0KHJlcy50b1N0cmluZygpLmxlbmd0aCk7XG4gIH0pO1xufSk7XG4iXX0= | ||
test('parseISO8601ToEpochMilliSeconds', () => { | ||
const time = '2018-02-01T17:21:05.180+08:00'; | ||
const res = util_time_1.parseISO8601ToEpochMilliSeconds(time); | ||
expect(res.toString().length).toBe(13); | ||
}); | ||
test('epochMilliSecondsToSeconds', () => { | ||
const time = 1517943695750; | ||
const expected = 1517943695; | ||
const res = util_time_1.epochMilliSecondsToSeconds(time); | ||
expect(res).toBe(expected); | ||
}); | ||
test('epochMilliSecondsToISO8601', () => { | ||
const time = 1517943695750; | ||
const expected = '2018-02-06T19:01:35.750Z'; | ||
const res = util_time_1.epochMilliSecondsToISO8601(time); | ||
expect(res).toBe(expected); | ||
}); | ||
describe('epochMilliSecondsToFormatted', () => { | ||
test('time & format', () => { | ||
const time = 1417943695859; | ||
const format = 'yyyy-MM-dd HH:mm:ssZ'; | ||
const expected = '2014-12-07 00:00:00+0000'; | ||
const res = util_time_1.epochMilliSecondsToFormatted(time, format); | ||
expect(res).toBe(expected); | ||
}); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC10aW1lLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdHMvdXRpbC10aW1lLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw0Q0FVc0I7QUFFdEIsSUFBSSxDQUFDLFlBQVksRUFBRSxHQUFHLEVBQUU7SUFDd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MpLnRvQmUoZXhwZWN0ZWQpO1xufSk7XG5cbmRlc2NyaWJlKCdlcG9jaE1pbGxpU2Vjb25kc1RvRm9ybWF0dGVkJywgKCkgPT4ge1xuICB0ZXN0KCd0aW1lICYgZm9ybWF0JywgKCkgPT4ge1xuICAgIGNvbnN0IHRpbWUgPSAxNDE3OTQzNjk1ODU5O1xuICAgIGNvbnN0IGZvcm1hdCA9ICd5eXl5LU1NLWRkIEhIOm1tOnNzWic7XG4gICAgY29uc3QgZXhwZWN0ZWQgPSAnMjAxNC0xMi0wNyAwMDowMDowMCswMDAwJztcbiAgICBjb25zdCByZXMgPSBlcG9jaE1pbGxpU2Vjb25kc1RvRm9ybWF0dGVkKHRpbWUsIGZvcm1hdCk7XG4gICAgZXhwZWN0KHJlcykudG9CZShleHBlY3RlZCk7XG4gIH0pO1xufSk7XG4iXX0= |
@@ -13,3 +13,3 @@ "use strict"; | ||
var _a; | ||
return (_a = format) === null || _a === void 0 ? void 0 : _a.replace('d', 'D').replace('Z', 'ZZ'); | ||
return (_a = format) === null || _a === void 0 ? void 0 : _a.replace('dd', 'DD').replace('Z', 'ZZ'); | ||
} | ||
@@ -34,14 +34,10 @@ function nowISO8601() { | ||
function parseFormattedToEpochMilliSecond(time, formatFrom, timezone = 'utc') { | ||
var _a; | ||
// Check the formatFrom at least is roughly right | ||
const regex = RegExp((_a = formatFrom) === null || _a === void 0 ? void 0 : _a.replace('Z', '\\+d{4}').replace(/[a-zA-S U-Z]/g, '\\d')); | ||
if (!time.match(regex) || time.includes('-DD-')) { | ||
throw Error('Format does not match time'); | ||
} | ||
// Return as epoch millisecond | ||
return moment_timezone_1.default(time).tz(timezone).valueOf(); | ||
const reverseFormat = vtlToMomentFormat(formatFrom); | ||
// AppSync does not parse in strict mode | ||
return moment_timezone_1.default(time, reverseFormat).tz(timezone).valueOf(); | ||
} | ||
exports.parseFormattedToEpochMilliSecond = parseFormattedToEpochMilliSecond; | ||
function parseISO8601ToEpochMilliSeconds(time) { | ||
return moment_timezone_1.default(time).valueOf(); | ||
// AppSync does not parse in strict mode | ||
return moment_timezone_1.default(time, 'YYYY-MM-DDTHH:mm:ssZ').valueOf(); | ||
} | ||
@@ -54,3 +50,3 @@ exports.parseISO8601ToEpochMilliSeconds = parseISO8601ToEpochMilliSeconds; | ||
function epochMilliSecondsToISO8601(time) { | ||
return moment_timezone_1.default(time).utc().format(); | ||
return moment_timezone_1.default(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); | ||
} | ||
@@ -63,2 +59,2 @@ exports.epochMilliSecondsToISO8601 = epochMilliSecondsToISO8601; | ||
exports.epochMilliSecondsToFormatted = epochMilliSecondsToFormatted; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC10aW1lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3V0aWwtdGltZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGlEQUFpRDtBQUNqRCxzRUFBcUM7QUFFckM7O0dBRUc7QUFDSCxTQUFTLGlCQUFpQixDQUFDLE1BQWU7O0lBQ3hDLGFBQU8sTUFBTSwwQ0FBRSxPQUFPLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRTtBQUN0RCxDQUFDO0FBRUQsU0FBZ0IsVUFBVTtJQUN4QixPQUFPLHlCQUFNLENBQUMsR0FBRyxFQUFFLENBQUMsV0FBVyxFQUFFLENBQUM7QUFDcEMsQ0FBQztBQUZELGdDQUVDO0FBRUQsU0FBZ0IsZUFBZTtJQUM3QixPQUFPLHlCQUFNLEVBQUUsQ0FBQyxJQUFJLEVBQUUsQ0FBQztBQUN6QixDQUFDO0FBRkQsMENBRUM7QUFFRCxTQUFnQixvQkFBb0I7SUFDbEMsT0FBTyx5QkFBTSxFQUFFLENBQUMsT0FBTyxFQUFFLENBQUM7QUFDN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c3RyaWN0IG1vZGVcbiAgcmV0dXJuIG1vbWVudCh0aW1lLCAnWVlZWS1NTS1ERFRISDptbTpzc1onKS52YWx1ZU9mKCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBlcG9jaE1pbGxpU2Vjb25kc1RvU2Vjb25kcyh0aW1lOiBudW1iZXIpIHtcbiAgcmV0dXJuIG1vbWVudCh0aW1lKS51bml4KCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBlcG9jaE1pbGxpU2Vjb25kc1RvSVNPODYwMSh0aW1lOiBudW1iZXIpIHtcbiAgcmV0dXJuIG1vbWVudCh0aW1lKS51dGMoKS5mb3JtYXQoJ1lZWVktTU0tRERUSEg6bW06c3MuU1NTW1pdJyk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBlcG9jaE1pbGxpU2Vjb25kc1RvRm9ybWF0dGVkKFxuICB0aW1lOiBudW1iZXIsXG4gIGZvcm1hdD86IHN0cmluZyxcbiAgdGltZXpvbmU6IHN0cmluZyA9ICd1dGMnXG4pIHtcbiAgY29uc3QgdnRsRm9ybWF0Q29udmVydGVkID0gdnRsVG9Nb21lbnRGb3JtYXQoZm9ybWF0KTtcbiAgcmV0dXJuIG1vbWVudCh0aW1lKS50eih0aW1lem9uZSkuZm9ybWF0KHZ0bEZvcm1hdENvbnZlcnRlZCk7XG59XG4iXX0= |
@@ -23,3 +23,3 @@ { | ||
"license": "MIT", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "dist/index.js", | ||
@@ -26,0 +26,0 @@ "scripts": { |
@@ -47,6 +47,6 @@ # appsync-template-tester | ||
This module supports all the core provided \$util methods, which can be seen in the [Resolver Mapping Template Utility Reference | ||
This module supports all the provided core & time \$util methods, which can be seen in the [Resolver Mapping Template Utility Reference | ||
docs](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-util-reference.html). | ||
Note: The errors list is not exported (and cannot be without modifying the velocityjs compiler). | ||
Note: The errors list is also not returned (but \$util.error will throw an error). | ||
@@ -53,0 +53,0 @@ ## Built by Skyhook |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68280
632