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

graphql-timezone

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-timezone - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

1

dist/index.d.ts

@@ -8,2 +8,3 @@ import { GraphQLEnumType } from 'graphql';

export default _default;
export declare const enumToString: (enumik: string) => string | undefined;
export { timezones, timezoneOptions } from "./timezones";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.timezoneOptions = exports.timezones = void 0;
exports.timezoneOptions = exports.timezones = exports.enumToString = void 0;
var graphql_1 = require("graphql");

@@ -14,4 +14,10 @@ var timezones_1 = require("./timezones");

});
exports.enumToString = function (enumik) {
var object = timezones_1.timezoneOptions.find(function (item) { return item.value === enumik; });
if (object)
return object.label;
return undefined;
};
var timezones_2 = require("./timezones");
Object.defineProperty(exports, "timezones", { enumerable: true, get: function () { return timezones_2.timezones; } });
Object.defineProperty(exports, "timezoneOptions", { enumerable: true, get: function () { return timezones_2.timezoneOptions; } });
import { GraphQLEnumType } from 'graphql';
import { TimezoneValues as values } from './timezones';
import { timezoneOptions, TimezoneValues as values } from './timezones';

@@ -16,2 +16,10 @@ type Props = {

export const enumToString = (enumik: string) => {
const object = timezoneOptions.find((item) => item.value === enumik);
if (object) return object.label;
return undefined;
};
export { timezones, timezoneOptions } from "./timezones";

2

package.json
{
"name": "graphql-timezone",
"version": "2.0.1",
"version": "2.0.2",
"description": "Timezone enum type for GraphQL",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -27,2 +27,31 @@ # GraphQL Timezone

## Bonus - values for select
```
import { timezoneOptions } from 'graphql-timezone';
const options = timezoneOptions;
/*
export const timezoneOptions = [
{
label: "Africa/Abidjan",
value: "AfricaAbidjan",
},
...
]
*/
```
## Bonus - translate enum to string
```
import { enumToString } from 'graphql-timezone';
const label = enumToString("AfricaAbidjan"); // Africa/Abidjan
```
## Enum details

@@ -29,0 +58,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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