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

@sanity/data-aspects

Package Overview
Dependencies
Maintainers
6
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 0.99.0 to 0.100.0

30

lib/DataAspectsResolver.js

@@ -13,6 +13,2 @@ 'use strict';

var _bundledTypes = require('part:@sanity/base/bundled-types');
var _bundledTypes2 = _interopRequireDefault(_bundledTypes);
var _lodash = require('lodash');

@@ -24,5 +20,3 @@

var bundledTypeNames = _bundledTypes2.default.types.map(function (baseType) {
return baseType.name;
});
var bundledTypeNames = ['geopoint'];

@@ -52,5 +46,3 @@ var DataAspectsResolver = function () {

value: function getType(typeName) {
return this.schema.types.find(function (currType) {
return currType.name === typeName;
});
return this.schema.get(typeName);
}

@@ -60,14 +52,20 @@ }, {

value: function getInferredTypes() {
var defaultTypes = this.schema.types || [];
defaultTypes = defaultTypes.filter(function (type) {
var _this = this;
var defaultTypes = this.schema.getTypeNames() || [];
defaultTypes = defaultTypes.filter(function (typeName) {
// Exclude types which come bundled with Sanity
return !bundledTypeNames.includes(type.name);
return !bundledTypeNames.includes(typeName);
});
if (this.config.hiddenTypes) {
// Exclude types which are explicitly named in hiddenTypes
defaultTypes = defaultTypes.filter(function (type) {
return !_dataAspects2.default.hiddenTypes.includes(type.name);
defaultTypes = defaultTypes.filter(function (typeName) {
return !_dataAspects2.default.hiddenTypes.includes(typeName);
});
}
return defaultTypes;
return defaultTypes.filter(function (typeName) {
var schemaType = _this.getType(typeName);
return schemaType.type !== null // this is the test for whether it is an toplevel type // todo: provide a better test
&& schemaType.type.name === 'object';
});
}

@@ -74,0 +72,0 @@ }, {

{
"name": "@sanity/data-aspects",
"version": "0.99.0",
"version": "0.100.0",
"description": "Sanity plugin which controls how your data is presented",

@@ -5,0 +5,0 @@ "main": "lib/DataAspectsResolver.js",

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