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

@sanity/data-aspects

Package Overview
Dependencies
Maintainers
34
Versions
700
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/data-aspects - npm Package Compare versions

Comparing version 2.21.12-purple-unicorn.1300 to 2.21.12-purple-unicorn.1302

28

lib/cjs/DataAspectsResolver.js

@@ -16,4 +16,4 @@ "use strict";

var bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset'];
var BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset'];
const bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset'];
const BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset'];

@@ -38,3 +38,3 @@ function isDocumentType(type) {

var hasWarned = false;
let hasWarned = false;

@@ -94,4 +94,4 @@ function warnAboutHiddenTypes() {

getDisplayName(typeName) {
var typeOption = this.config.typeOptions[typeName] || {};
var type = this.getType(typeName);
const typeOption = this.config.typeOptions[typeName] || {};
const type = this.getType(typeName);
return typeOption.displayName || type.title || (0, _startCase2.default)(typeName);

@@ -105,3 +105,3 @@ }

getListConstraints(typeName) {
var typeOption = this.config.typeOptions[typeName];
const typeOption = this.config.typeOptions[typeName];

@@ -112,3 +112,3 @@ if (!typeOption) {

var constraints = [];
const constraints = [];

@@ -131,8 +131,10 @@ if (typeOption.order) {// prefix order items with . because that's what gql requires

getListQuery(options) {
var typeName = options.typeName,
keyForId = options.keyForId,
keyForDisplayFieldName = options.keyForDisplayFieldName;
var fieldName = this.getItemDisplayField(typeName);
var constraints = this.getListConstraints(typeName);
var selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName);
const {
typeName,
keyForId,
keyForDisplayFieldName
} = options;
const fieldName = this.getItemDisplayField(typeName);
const constraints = this.getListConstraints(typeName);
const selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName);
return "".concat(this.schema.name, ".").concat(typeName, " [").concat(constraints, "] {").concat(selection, "}");

@@ -139,0 +141,0 @@ }

import _startCase from "lodash/startCase";
import config from 'config:@sanity/data-aspects';
import { generateHelpUrl } from '@sanity/generate-help-url';
var bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset'];
var BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset'];
const bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset'];
const BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset'];

@@ -25,3 +25,3 @@ function isDocumentType(type) {

var hasWarned = false;
let hasWarned = false;

@@ -81,4 +81,4 @@ function warnAboutHiddenTypes() {

getDisplayName(typeName) {
var typeOption = this.config.typeOptions[typeName] || {};
var type = this.getType(typeName);
const typeOption = this.config.typeOptions[typeName] || {};
const type = this.getType(typeName);
return typeOption.displayName || type.title || _startCase(typeName);

@@ -92,3 +92,3 @@ }

getListConstraints(typeName) {
var typeOption = this.config.typeOptions[typeName];
const typeOption = this.config.typeOptions[typeName];

@@ -99,3 +99,3 @@ if (!typeOption) {

var constraints = [];
const constraints = [];

@@ -118,8 +118,10 @@ if (typeOption.order) {// prefix order items with . because that's what gql requires

getListQuery(options) {
var typeName = options.typeName,
keyForId = options.keyForId,
keyForDisplayFieldName = options.keyForDisplayFieldName;
var fieldName = this.getItemDisplayField(typeName);
var constraints = this.getListConstraints(typeName);
var selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName);
const {
typeName,
keyForId,
keyForDisplayFieldName
} = options;
const fieldName = this.getItemDisplayField(typeName);
const constraints = this.getListConstraints(typeName);
const selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName);
return "".concat(this.schema.name, ".").concat(typeName, " [").concat(constraints, "] {").concat(selection, "}");

@@ -126,0 +128,0 @@ }

{
"name": "@sanity/data-aspects",
"version": "2.21.12-purple-unicorn.1300+abdd014728",
"version": "2.21.12-purple-unicorn.1302+847175b7f3",
"description": "Sanity plugin which controls how your data is presented",

@@ -39,3 +39,3 @@ "main": "lib/DataAspectsResolver.js",

"homepage": "https://www.sanity.io/",
"gitHead": "abdd014728981dd514951705252054db61bcd3f4"
"gitHead": "847175b7f3ddc82e4a956ab4e0dbb74a4dff41b8"
}
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