common-types
Advanced tools
Comparing version 1.24.5 to 1.24.6
@@ -76,2 +76,16 @@ import { NumericCharacter } from "./stringAliases"; | ||
/** | ||
* An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) compliant | ||
* _date_ and _time_ string of the form: _YYYY-MM-DD**T**HH:mm:ss.sssZ_. | ||
* Apparently another format for year which is 6 characters long is also | ||
* allowed (this must be preceeded by a + or - character). | ||
* | ||
* Note: this is the format which you will get from JS with `.toISOString()` | ||
*/ | ||
export declare type Iso8601DateTime = `${string}${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`; | ||
/** | ||
* Type guard to determine if a given timestamp is a valid ISO 8601 | ||
* datetime stamp. | ||
*/ | ||
export declare function isIso8601DateTime(timestamp: unknown): timestamp is Iso8601DateTime; | ||
/** | ||
* a string of the format: "YYYY-MM-DD" | ||
@@ -78,0 +92,0 @@ */ |
@@ -493,2 +493,12 @@ 'use strict'; | ||
/** | ||
* Type guard to determine if a given timestamp is a valid ISO 8601 | ||
* datetime stamp. | ||
*/ | ||
function isIso8601DateTime(timestamp) { | ||
return (typeof timestamp === "string" && | ||
(timestamp.length === 24 || timestamp.length === 27) && | ||
/(\d{4}|[+-]\d{6})-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/.test(timestamp)); | ||
} | ||
const AWS_REGIONS = [ | ||
@@ -617,2 +627,3 @@ "us-east-1", | ||
exports.isEventBridgeArn = isEventBridgeArn; | ||
exports.isIso8601DateTime = isIso8601DateTime; | ||
exports.isLambdaArn = isLambdaArn; | ||
@@ -619,0 +630,0 @@ exports.isLambdaFunctionArn = isLambdaFunctionArn; |
@@ -76,2 +76,16 @@ import { NumericCharacter } from "./stringAliases"; | ||
/** | ||
* An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) compliant | ||
* _date_ and _time_ string of the form: _YYYY-MM-DD**T**HH:mm:ss.sssZ_. | ||
* Apparently another format for year which is 6 characters long is also | ||
* allowed (this must be preceeded by a + or - character). | ||
* | ||
* Note: this is the format which you will get from JS with `.toISOString()` | ||
*/ | ||
export declare type Iso8601DateTime = `${string}${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`; | ||
/** | ||
* Type guard to determine if a given timestamp is a valid ISO 8601 | ||
* datetime stamp. | ||
*/ | ||
export declare function isIso8601DateTime(timestamp: unknown): timestamp is Iso8601DateTime; | ||
/** | ||
* a string of the format: "YYYY-MM-DD" | ||
@@ -78,0 +92,0 @@ */ |
@@ -489,2 +489,12 @@ /** | ||
/** | ||
* Type guard to determine if a given timestamp is a valid ISO 8601 | ||
* datetime stamp. | ||
*/ | ||
function isIso8601DateTime(timestamp) { | ||
return (typeof timestamp === "string" && | ||
(timestamp.length === 24 || timestamp.length === 27) && | ||
/(\d{4}|[+-]\d{6})-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/.test(timestamp)); | ||
} | ||
const AWS_REGIONS = [ | ||
@@ -600,3 +610,3 @@ "us-east-1", | ||
export { AWS_REGIONS, AwsRegionName, HttpStatusCodes, LambdaEventParser, StepFunctionMissingDataTreatment, createBindDeploymentConfig, getBodyFromPossibleLambdaProxyRequest, isArn, isArnPartition, isArnResource, isArnService, isAwsAccountId, isAwsRegion, isAwsStage, isBearerToken, isEventBridgeArn, isLambdaArn, isLambdaFunctionArn, isLambdaProxyRequest, isNonNullObject, isNpmInfoRepository, isProxyRequestContextV2, isServerlessFunctionHandler, isServerlessFunctionImage, isStepFunctionArn, isTypeSubtype, parseStack, wait }; | ||
export { AWS_REGIONS, AwsRegionName, HttpStatusCodes, LambdaEventParser, StepFunctionMissingDataTreatment, createBindDeploymentConfig, getBodyFromPossibleLambdaProxyRequest, isArn, isArnPartition, isArnResource, isArnService, isAwsAccountId, isAwsRegion, isAwsStage, isBearerToken, isEventBridgeArn, isIso8601DateTime, isLambdaArn, isLambdaFunctionArn, isLambdaProxyRequest, isNonNullObject, isNpmInfoRepository, isProxyRequestContextV2, isServerlessFunctionHandler, isServerlessFunctionImage, isStepFunctionArn, isTypeSubtype, parseStack, wait }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "common-types", | ||
"version": "1.24.5", | ||
"version": "1.24.6", | ||
"description": "Common Types for Typescript", | ||
@@ -34,3 +34,3 @@ "repository": "https://github.com/lifegadget/common-types", | ||
"chai": "^4.2.0", | ||
"do-devops": "^0.6.1", | ||
"do-devops": "^0.9.0", | ||
"json-schema": "^0.3.0", | ||
@@ -37,0 +37,0 @@ "mocha": "^8.2.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
364516
8615