Socket
Socket
Sign inDemoInstall

simple-graphql

Package Overview
Dependencies
Maintainers
1
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-graphql - npm Package Compare versions

Comparing version 4.0.6 to 4.0.7

36

dist/build/type/graphql/Date.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const graphql_1 = require("graphql");
const moment_1 = __importDefault(require("moment"));
exports.default = new graphql_1.GraphQLScalarType({

@@ -12,6 +8,9 @@ name: 'Date',

if (typeof value === 'string') {
const nValue = moment_1.default(value, 'YYYY-MM-DD HH:mm:ss.SSS ZZ');
if (nValue.isValid()) {
value = nValue.toDate();
const dataTime = Date.parse(value);
if (isNaN(dataTime)) {
throw new TypeError('Field error: value is not an instance of Date');
}
else {
value = new Date(dataTime);
}
}

@@ -28,7 +27,9 @@ if (!(value instanceof Date)) {

if (typeof value === 'string') {
const result = moment_1.default(value);
if (!result.isValid()) {
throw new graphql_1.GraphQLError('Query error: Invalid date');
const dataTime = Date.parse(value);
if (isNaN(dataTime)) {
throw new TypeError('Query error: Invalid date');
}
return result.toDate();
else {
return new Date(dataTime);
}
}

@@ -43,12 +44,11 @@ else {

}
const result = moment_1.default(ast.value);
if (!result.isValid()) {
throw new graphql_1.GraphQLError('Query error: Invalid date', [ast]);
const dataTime = Date.parse(ast.value);
if (isNaN(dataTime)) {
throw new TypeError('Query error: Invalid date');
}
return result.toDate();
// if (ast.value !== result.toJSON()) {
// throw new GraphQLError('Query error: Invalid date format, only accepts: YYYY-MM-DDTHH:MM:SS.SSSZ', [ast])
// }
else {
return new Date(dataTime);
}
}
});
//# sourceMappingURL=Date.js.map
import { CountOptions, FindOptions } from 'sequelize';
declare const _default: (dbModel: any, options: FindOptions | CountOptions) => any;
declare const _default: (dbModel: any, options: FindOptions | CountOptions) => string;
export default _default;

@@ -17,3 +17,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const md5_1 = __importDefault(require("md5"));
const crypto_1 = __importDefault(require("crypto"));
function md5(source) {
return crypto_1.default.createHash('md5').update(source).digest('hex');
}
exports.default = (dbModel, options) => {

@@ -43,4 +46,4 @@ options = options || {};

const include = getInclude().map((i) => formatInclude(i));
return md5_1.default(JSON.stringify(Object.assign(Object.assign({}, options), { include: include, where: dbModel.queryGenerator.whereQuery(options.where) })));
return md5(JSON.stringify(Object.assign(Object.assign({}, options), { include: include, where: dbModel.queryGenerator.whereQuery(options.where) })));
};
//# sourceMappingURL=getFindOptionsKey.js.map
{
"name": "simple-graphql",
"version": "4.0.6",
"version": "4.0.7",
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.",

@@ -39,4 +39,2 @@ "main": "dist/index.js",

"lru_map": "^0.3.3",
"md5": "^2.3.0",
"moment": "^2.29.1",
"sequelize": "^6.5.0"

@@ -43,0 +41,0 @@ },

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