@types/segment__isodate
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Installation

npm install --save @types/segment__isodate

Summary

This package contains type definitions for @segment/isodate (https://github.com/segmentio/isodate#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/segment__isodate.

index.d.ts

/**
 * Parse the given ISO date `string` into a native `Date` object.
 *
 * @example
 * import isodate = require('@segment/isodate');
 *
 * const date = isodate.parse('2013-09-04T00:57:26.434Z');
 * date.toISOString(); // "2013-09-04T00:57:26.434Z"
 */
export function parse(iso: string): Date;

/**
 * Check if the given `string` is an ISO date string. `strict` mode will return false for
 * strings without a year, month and date; for example `2013` would be `false`.
 *
 * @example
 * import isodate = require('@segment/isodate');
 *
 * isodate.is('2013-09-04T00:57:26.434Z'); // true
 * isodate.is('string'); // false
 */
export function is(string: string, strict?: boolean): boolean;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/segment__isodate

Weekly Downloads

74

Version

1.0.2

License

MIT

Unpacked Size

3.99 kB

Total Files

5

Last publish

Collaborators

  • types