Comparing version 1.2.0-beta.1 to 1.2.0-introspect.0
@@ -222,2 +222,8 @@ export declare interface AccessAttributeNode extends BaseNode { | ||
export declare interface IntrospectableGroqType { | ||
[introspectGroqType]: GroqType | ||
} | ||
export declare const introspectGroqType: unique symbol | ||
export declare interface MapNode extends BaseNode { | ||
@@ -224,0 +230,0 @@ type: 'Map' |
@@ -222,2 +222,8 @@ export declare interface AccessAttributeNode extends BaseNode { | ||
export declare interface IntrospectableGroqType { | ||
[introspectGroqType]: GroqType | ||
} | ||
export declare const introspectGroqType: unique symbol | ||
export declare interface MapNode extends BaseNode { | ||
@@ -224,0 +230,0 @@ type: 'Map' |
@@ -8,3 +8,4 @@ 'use strict'; | ||
exports.evaluate = _1.evaluate; | ||
exports.introspectGroqType = _1.introspectGroqType; | ||
exports.parse = _1.parse; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "groq-js", | ||
"version": "1.2.0-beta.1", | ||
"version": "1.2.0-introspect.0", | ||
"keywords": [ | ||
@@ -54,2 +54,4 @@ "sanity", | ||
"src", | ||
"LICENSE", | ||
"API.md", | ||
"README.md" | ||
@@ -56,0 +58,0 @@ ], |
@@ -6,2 +6,3 @@ export {evaluate} from './evaluator' | ||
export type {Context, Executor} from './evaluator/types' | ||
export * from './introspection' | ||
export * from './nodeTypes' | ||
@@ -8,0 +9,0 @@ export {parse} from './parser' |
@@ -0,1 +1,2 @@ | ||
import {introspectGroqType} from '../introspection' | ||
import {formatRFC3339, parseRFC3339} from './dateHelpers' | ||
@@ -124,2 +125,7 @@ import {Path} from './Path' | ||
export function getType(data: any): GroqType { | ||
// Allow overriding the type durign introspection | ||
if (typeof data == 'object' && data !== null && introspectGroqType in data) { | ||
return data[introspectGroqType] | ||
} | ||
if (data === null || typeof data === 'undefined') { | ||
@@ -126,0 +132,0 @@ return 'null' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
718323
43
11538