Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@phensley/timezone

Package Overview
Dependencies
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phensley/timezone - npm Package Compare versions

Comparing version 0.26.0 to 1.0.0

46

lib-es/index.d.ts
import { RawData } from './types';
export { RawData } from './types';
/**
* Represents abbreviation, daylight savings and timezone offset for
* a single time zone.
*
* @public
*/
export interface ZoneInfo {
/**
* Time zone identifier.
*/
zoneid: string;
/**
* Time zone 3-character abbreviation.
*/
abbr: string;
/**
* Flag indicating the zone is currently in daylight savings time.
*/
dst: number;
/**
* Time zone offset from UTC.
*/
offset: number;
}
/**
* Interface to accessing time zone data.
*
* @public
*/
export interface Tz {
/**
* Get the info for a time zone using a UTC timestamp.
*/
fromUTC(zoneid: string, utc: number): ZoneInfo | undefined;
/**
* Resolve a lowercase time zone id or alias into the canonical proper-cased id.
*/
resolveId(id: string): string | undefined;
/**
* UTC zone info.
*/
utcZone(): ZoneInfo;
/**
* Returns an array of time zone ids.
*/
zoneIds(): string[];
}
/**
*
*
* @public
*/
export declare class TzImpl {

@@ -58,2 +99,7 @@ /** Mapping of canonical time zone ids to index */

}
/**
* Global instance for accessing time zones.
*
* @public
*/
export declare const TZ: Tz;

@@ -5,2 +5,7 @@ import { __assign } from "tslib";

var numarray = function (s) { return s ? s.split(' ').map(function (n) { return parseInt(n, 36); }) : []; };
/**
*
*
* @public
*/
var TzImpl = /** @class */ (function () {

@@ -117,2 +122,4 @@ function TzImpl(raw) {

* Information related to a single timezone.
*
* @internal
*/

@@ -163,3 +170,8 @@ var ZoneRecord = /** @class */ (function () {

}, {});
/**
* Global instance for accessing time zones.
*
* @public
*/
export var TZ = new TzImpl(rawdata);
//# sourceMappingURL=index.js.map

@@ -0,6 +1,23 @@

/**
* Interface for providing raw time zone data to a Tz instance.
*
* @public
*/
export interface RawData {
/**
* Compressed index of until deltas.
*/
index: string;
/**
* Time zone ids.
*/
zoneids: string;
/**
* Time zone links.
*/
links: string;
/**
* Array of packed zone infos sorted to match zone ids.
*/
zoneinfo: string[];
}
import { RawData } from './types';
export { RawData } from './types';
/**
* Represents abbreviation, daylight savings and timezone offset for
* a single time zone.
*
* @public
*/
export interface ZoneInfo {
/**
* Time zone identifier.
*/
zoneid: string;
/**
* Time zone 3-character abbreviation.
*/
abbr: string;
/**
* Flag indicating the zone is currently in daylight savings time.
*/
dst: number;
/**
* Time zone offset from UTC.
*/
offset: number;
}
/**
* Interface to accessing time zone data.
*
* @public
*/
export interface Tz {
/**
* Get the info for a time zone using a UTC timestamp.
*/
fromUTC(zoneid: string, utc: number): ZoneInfo | undefined;
/**
* Resolve a lowercase time zone id or alias into the canonical proper-cased id.
*/
resolveId(id: string): string | undefined;
/**
* UTC zone info.
*/
utcZone(): ZoneInfo;
/**
* Returns an array of time zone ids.
*/
zoneIds(): string[];
}
/**
*
*
* @public
*/
export declare class TzImpl {

@@ -58,2 +99,7 @@ /** Mapping of canonical time zone ids to index */

}
/**
* Global instance for accessing time zones.
*
* @public
*/
export declare const TZ: Tz;

@@ -7,2 +7,7 @@ "use strict";

var numarray = function (s) { return s ? s.split(' ').map(function (n) { return parseInt(n, 36); }) : []; };
/**
*
*
* @public
*/
var TzImpl = /** @class */ (function () {

@@ -119,2 +124,4 @@ function TzImpl(raw) {

* Information related to a single timezone.
*
* @internal
*/

@@ -165,3 +172,8 @@ var ZoneRecord = /** @class */ (function () {

}, {});
/**
* Global instance for accessing time zones.
*
* @public
*/
exports.TZ = new TzImpl(autogen_zonedata_1.rawdata);
//# sourceMappingURL=index.js.map

@@ -0,6 +1,23 @@

/**
* Interface for providing raw time zone data to a Tz instance.
*
* @public
*/
export interface RawData {
/**
* Compressed index of until deltas.
*/
index: string;
/**
* Time zone ids.
*/
zoneids: string;
/**
* Time zone links.
*/
links: string;
/**
* Array of packed zone infos sorted to match zone ids.
*/
zoneinfo: string[];
}

19

package.json
{
"name": "@phensley/timezone",
"version": "0.26.0",
"version": "1.0.0",
"description": "Compact timezone lib based on tz database",

@@ -19,2 +19,4 @@ "main": "lib/index.js",

"scripts": {
"api": "api-extractor run -c ./etc/api-extractor.json --verbose",
"api:local": "yarn api -l",
"bench": "ts-node __benchmarks__/",

@@ -39,7 +41,8 @@ "build": "yarn build:cj && yarn build:es",

"dependencies": {
"@phensley/cldr-utils": "0.26.0",
"tslib": "1.10.x"
"@phensley/cldr-utils": "1.0.0",
"tslib": "1.11.1"
},
"devDependencies": {
"@types/jest": "24.0.22",
"@microsoft/api-extractor": "^7.7.8",
"@types/jest": "25.1.3",
"@types/node": "^10.14.10",

@@ -52,9 +55,9 @@ "@types/rimraf": "^2.0.2",

"dts-bundle-generator": "^3.1.0",
"jest": "24.9.0",
"jest": "25.1.0",
"rimraf": "^3.0.0",
"ts-jest": "^24.0.2",
"ts-jest": "25.2.1",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"tslint-no-circular-imports": "^0.7.0",
"typescript": "3.7.x",
"typescript": "3.8.x",
"uglify-es": "^3.3.9",

@@ -80,3 +83,3 @@ "yargs": "14.2.0"

},
"gitHead": "94045abc4df86296281f3eefc7d5e4bd48636cbe"
"gitHead": "84adc62f4b277203b9252f5c7aef98130d2baa3a"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc