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

contentful-parsers

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-parsers - npm Package Compare versions

Comparing version 1.2.16 to 1.2.17

6

es/parsers/graphqlParser.js

@@ -71,3 +71,3 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";

if (clone === null || clone === void 0 ? void 0 : (_clone$sys = clone.sys) === null || _clone$sys === void 0 ? void 0 : _clone$sys.createdAt) {
if (clone !== null && clone !== void 0 && (_clone$sys = clone.sys) !== null && _clone$sys !== void 0 && _clone$sys.createdAt) {
clone.sys.firstPublishedAt = clone.sys.createdAt;

@@ -77,3 +77,3 @@ delete clone.sys.createdAt;

if (clone === null || clone === void 0 ? void 0 : (_clone$sys2 = clone.sys) === null || _clone$sys2 === void 0 ? void 0 : _clone$sys2.updatedAt) {
if (clone !== null && clone !== void 0 && (_clone$sys2 = clone.sys) !== null && _clone$sys2 !== void 0 && _clone$sys2.updatedAt) {
clone.sys.publishedAt = clone.sys.updatedAt;

@@ -269,3 +269,3 @@ delete clone.sys.updatedAt;

if (data === null || data === void 0 ? void 0 : data.items) {
if (data !== null && data !== void 0 && data.items) {
var _ref;

@@ -272,0 +272,0 @@

{
"name": "contentful-parsers",
"version": "1.2.16",
"version": "1.2.17",
"description": "Library of useful parsers to use when working with Contentful API responses.",

@@ -59,14 +59,14 @@ "repository": "ryanhefner/contentful-parsers.git",

"dependencies": {
"@babel/runtime": "^7.12.1"
"@babel/runtime": "^7.12.5"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/cli": "^7.12.8",
"@babel/core": "^7.12.9",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^26.6.0",
"babel-jest": "^26.6.3",
"babel-plugin-dev-expression": "^0.2.2",

@@ -76,9 +76,9 @@ "babel-plugin-transform-react-remove-prop-types": "^0.4.24",

"coveralls": "^3.1.0",
"dtslint": "^4.0.4",
"dtslint": "^4.0.6",
"greenkeeper-lockfile": "^1.15.1",
"gzip-size": "^5.1.1",
"jest": "^26.6.0",
"gzip-size": "^6.0.0",
"jest": "^26.6.3",
"pretty-bytes": "^5.4.1",
"regenerator-runtime": "^0.13.7",
"rollup": "^2.32.0",
"rollup": "^2.33.3",
"rollup-plugin-babel": "^4.4.0",

@@ -89,3 +89,3 @@ "rollup-plugin-commonjs": "^10.1.0",

"rollup-plugin-uglify": "^6.0.4",
"typescript": "^4.0.3"
"typescript": "^4.1.2"
},

@@ -92,0 +92,0 @@ "jest": {

@@ -82,3 +82,3 @@ "use strict";

if (clone === null || clone === void 0 ? void 0 : (_clone$sys = clone.sys) === null || _clone$sys === void 0 ? void 0 : _clone$sys.createdAt) {
if (clone !== null && clone !== void 0 && (_clone$sys = clone.sys) !== null && _clone$sys !== void 0 && _clone$sys.createdAt) {
clone.sys.firstPublishedAt = clone.sys.createdAt;

@@ -88,3 +88,3 @@ delete clone.sys.createdAt;

if (clone === null || clone === void 0 ? void 0 : (_clone$sys2 = clone.sys) === null || _clone$sys2 === void 0 ? void 0 : _clone$sys2.updatedAt) {
if (clone !== null && clone !== void 0 && (_clone$sys2 = clone.sys) !== null && _clone$sys2 !== void 0 && _clone$sys2.updatedAt) {
clone.sys.publishedAt = clone.sys.updatedAt;

@@ -280,3 +280,3 @@ delete clone.sys.updatedAt;

if (data === null || data === void 0 ? void 0 : data.items) {
if (data !== null && data !== void 0 && data.items) {
var _ref;

@@ -283,0 +283,0 @@

@@ -1,2 +0,2 @@

/*! contentful-parsers v1.2.16 | (c) 2020 Ryan Hefner | MIT License | https://github.com/ryanhefner/contentful-parsers.git !*/
/*! contentful-parsers v1.2.17 | (c) 2020 Ryan Hefner | MIT License | https://github.com/ryanhefner/contentful-parsers.git !*/
(function (global, factory) {

@@ -213,3 +213,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

if (clone === null || clone === void 0 ? void 0 : (_clone$sys = clone.sys) === null || _clone$sys === void 0 ? void 0 : _clone$sys.createdAt) {
if (clone !== null && clone !== void 0 && (_clone$sys = clone.sys) !== null && _clone$sys !== void 0 && _clone$sys.createdAt) {
clone.sys.firstPublishedAt = clone.sys.createdAt;

@@ -219,3 +219,3 @@ delete clone.sys.createdAt;

if (clone === null || clone === void 0 ? void 0 : (_clone$sys2 = clone.sys) === null || _clone$sys2 === void 0 ? void 0 : _clone$sys2.updatedAt) {
if (clone !== null && clone !== void 0 && (_clone$sys2 = clone.sys) !== null && _clone$sys2 !== void 0 && _clone$sys2.updatedAt) {
clone.sys.publishedAt = clone.sys.updatedAt;

@@ -411,3 +411,3 @@ delete clone.sys.updatedAt;

if (data === null || data === void 0 ? void 0 : data.items) {
if (data !== null && data !== void 0 && data.items) {
var _ref;

@@ -414,0 +414,0 @@

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["contentful-parsers"]={})}(this,function(e){"use strict";function R(e,s,l){function o(e){return e&&"object"==typeof e&&e.hasOwnProperty("sys")&&1===Object.keys(e).length}function u(t,e,n,r){if(void 0===n&&(n={}),void 0===r&&(r=0),!t||"object"!=typeof t)return n;if(r>=s.include)return n;var i=Object.assign({},n);return Object.keys(t).forEach(function(e){i[e]=t[e]&&t[e].fields&&l.parseRefs?u(t[e].fields,t[e].sys,i[e],r+1):function t(e,n){return void 0===n&&(n=0),o(e)?null:Array.isArray(e)&&l.parseArrays?e.filter(function(e){return!o(e)}).map(function(e){return e&&"object"==typeof e&&e.fields?u(e.fields,e.sys,{},n+1):t(e,n+1)}):e}(t[e],r+1)}),e&&e.contentType&&e.contentType.sys&&e.contentType.sys.id&&(i.id=e.id,i.__typename=e.contentType.sys.id),e&&e.updatedAt&&(i.updatedAt=e.updatedAt),e&&e.createdAt&&(i.createdAt=e.createdAt),i}void 0===s&&(s={include:10}),void 0===l&&(l={parseArrays:!0,parseRefs:!0});var t=Object.assign({},e);return u(t.fields,t.sys)}var r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function S(e){return e.substring(0,1).toUpperCase()+e.substring(1)}e.contentfulResolver=function(e,t){return t&&t.hasOwnProperty(e)?t[e]:null},e.fieldsParser=R,e.graphqlParser=function(e,t,n,E){var r,i;function k(e,t){var n,r;return e&&(e.hasOwnProperty("__typename")&&e.__typename&&(e.__typename=S(e.__typename)),t&&t.sys?e.sys=s(s({},t.sys),{},{__typename:"Sys"}):t.id&&(e.sys={id:t.id,__typename:"Sys"}),null!=e&&(null!==(n=e.sys)&&void 0!==n&&n.createdAt)&&(e.sys.firstPublishedAt=e.sys.createdAt,delete e.sys.createdAt),null!=e&&(null!==(r=e.sys)&&void 0!==r&&r.updatedAt)&&(e.sys.publishedAt=e.sys.updatedAt,delete e.sys.updatedAt),e.id&&delete e.id,e.createdAt&&(e.sys.firstPublishedAt||(e.sys.firstPublishedAt=e.createdAt),delete e.createdAt),e.updatedAt&&(e.sys.publishedAt||(e.sys.publishedAt=e.updatedAt),delete e.updatedAt)),e}function C(i,s,l,o){var e;if(void 0===o&&(o=0),!i)return null;if(o>=E.include)return i;var u=Object.assign({},i.hasOwnProperty("sys")&&i.hasOwnProperty("fields")?R(i,E,{parseArrays:!1,parseRefs:!1}):i);Object.keys(u).forEach(function(n){var e=u[n];if(Array.isArray(e)){var t=!1;if(e.filter(function(e){return!!e}).forEach(function(e){(e.hasOwnProperty("sys")&&e.hasOwnProperty("fields")||e.hasOwnProperty("__typename"))&&(t=!0)}),t){var r=n+"Collection";u[r]=D(e,""+s+S(r),null==l?void 0:l[r],o+1),delete u[n]}else u[n]=e.map(function(e,t){return k(e,i&&i.fields&&i.fields[n][t])}).filter(function(e){return!!e})}else e&&"object"==typeof e&&(e.hasOwnProperty("__typename")||e.hasOwnProperty("sys")&&e.hasOwnProperty("fields"))?u[n]=C(e,s,null==l?void 0:l[n],o+1):u[n]=e});var t,n,r,d,a,f,y,c,p,v,h,b,O,A,m,_,j,P,g,w=k(u,i),T="Asset"===(null==w||null===(e=w.sys)||void 0===e?void 0:e.type)?(t=w,(g=Object.assign({},t)).__typename="Asset",g.url=null==g||null===(n=g.file)||void 0===n?void 0:n.url,g.contentType=null==g||null===(r=g.file)||void 0===r?void 0:r.contentType,g.size=null==g||null===(d=g.file)||void 0===d||null===(a=d.details)||void 0===a?void 0:a.size,g.width=(null==g||null===(f=g.file)||void 0===f||null===(y=f.details)||void 0===y||null===(c=y.image)||void 0===c?void 0:c.width)||(null==g||null===(p=g.file)||void 0===p||null===(v=p.details)||void 0===v||null===(h=v.video)||void 0===h?void 0:h.width),g.height=(null==g||null===(b=g.file)||void 0===b||null===(O=b.details)||void 0===O||null===(A=O.image)||void 0===A?void 0:A.height)||(null==g||null===(m=g.file)||void 0===m||null===(_=m.details)||void 0===_||null===(j=_.video)||void 0===j?void 0:j.height),g.fileName=null==g||null===(P=g.file)||void 0===P?void 0:P.fileName,g.url.startsWith("https:")||(g.url="https:"+g.url),delete g.file,g):w;return function r(e,i,s){if(!e||!s)return e;var l=Object.assign({},e||{});return Object.keys(s).forEach(function(e){if(!l.hasOwnProperty(e))if(e.endsWith("Collection")){var t=e.replace("Collection",""),n=l.hasOwnProperty(t)&&l[t];n?(l[e]=D(n,""+i+S(e),s[e]),delete l[t]):l[e]=D([],""+i+S(e),s[e])}else e.startsWith("...")&&l.__typename&&l.__typename===e.replace("...","")?Object.assign(l,r(l,i,s[e])):l[e]=null}),l}(T,T.__typename||s,l)}function D(e,t,n,r){return void 0===e&&(e=[]),void 0===r&&(r=0),{__typename:t,total:(e&&Array.isArray(e)?e:[]).length,items:(e&&Array.isArray(e)?e:[]).map(function(e){return C(e,t,null==n?void 0:n.items,r)}).filter(function(e){return!!e})}}return void 0===E&&(E={include:10}),null!=t&&t.items?((i={})[e]=D(t.items,S(e),null==n?void 0:n[e]),i):((r={})[e]=s({__typename:S(e)},C(t,S(e),null==n?void 0:n[e])),r)},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["contentful-parsers"]={})}(this,function(e){"use strict";function R(e,s,l){function o(e){return e&&"object"==typeof e&&e.hasOwnProperty("sys")&&1===Object.keys(e).length}function u(t,e,n,r){if(void 0===n&&(n={}),void 0===r&&(r=0),!t||"object"!=typeof t)return n;if(r>=s.include)return n;var i=Object.assign({},n);return Object.keys(t).forEach(function(e){i[e]=t[e]&&t[e].fields&&l.parseRefs?u(t[e].fields,t[e].sys,i[e],r+1):function t(e,n){return void 0===n&&(n=0),o(e)?null:Array.isArray(e)&&l.parseArrays?e.filter(function(e){return!o(e)}).map(function(e){return e&&"object"==typeof e&&e.fields?u(e.fields,e.sys,{},n+1):t(e,n+1)}):e}(t[e],r+1)}),e&&e.contentType&&e.contentType.sys&&e.contentType.sys.id&&(i.id=e.id,i.__typename=e.contentType.sys.id),e&&e.updatedAt&&(i.updatedAt=e.updatedAt),e&&e.createdAt&&(i.createdAt=e.createdAt),i}void 0===s&&(s={include:10}),void 0===l&&(l={parseArrays:!0,parseRefs:!0});var t=Object.assign({},e);return u(t.fields,t.sys)}var r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function S(e){return e.substring(0,1).toUpperCase()+e.substring(1)}e.contentfulResolver=function(e,t){return t&&t.hasOwnProperty(e)?t[e]:null},e.fieldsParser=R,e.graphqlParser=function(e,t,n,E){var r,i;function k(e,t){var n,r;return e&&(e.hasOwnProperty("__typename")&&e.__typename&&(e.__typename=S(e.__typename)),t&&t.sys?e.sys=s(s({},t.sys),{},{__typename:"Sys"}):t.id&&(e.sys={id:t.id,__typename:"Sys"}),null!=e&&null!==(n=e.sys)&&void 0!==n&&n.createdAt&&(e.sys.firstPublishedAt=e.sys.createdAt,delete e.sys.createdAt),null!=e&&null!==(r=e.sys)&&void 0!==r&&r.updatedAt&&(e.sys.publishedAt=e.sys.updatedAt,delete e.sys.updatedAt),e.id&&delete e.id,e.createdAt&&(e.sys.firstPublishedAt||(e.sys.firstPublishedAt=e.createdAt),delete e.createdAt),e.updatedAt&&(e.sys.publishedAt||(e.sys.publishedAt=e.updatedAt),delete e.updatedAt)),e}function C(i,s,l,o){var e;if(void 0===o&&(o=0),!i)return null;if(o>=E.include)return i;var u=Object.assign({},i.hasOwnProperty("sys")&&i.hasOwnProperty("fields")?R(i,E,{parseArrays:!1,parseRefs:!1}):i);Object.keys(u).forEach(function(n){var e=u[n];if(Array.isArray(e)){var t=!1;if(e.filter(function(e){return!!e}).forEach(function(e){(e.hasOwnProperty("sys")&&e.hasOwnProperty("fields")||e.hasOwnProperty("__typename"))&&(t=!0)}),t){var r=n+"Collection";u[r]=D(e,""+s+S(r),null==l?void 0:l[r],o+1),delete u[n]}else u[n]=e.map(function(e,t){return k(e,i&&i.fields&&i.fields[n][t])}).filter(function(e){return!!e})}else e&&"object"==typeof e&&(e.hasOwnProperty("__typename")||e.hasOwnProperty("sys")&&e.hasOwnProperty("fields"))?u[n]=C(e,s,null==l?void 0:l[n],o+1):u[n]=e});var t,n,r,d,a,f,y,c,p,v,h,b,O,A,m,_,j,P,g,w=k(u,i),T="Asset"===(null==w||null===(e=w.sys)||void 0===e?void 0:e.type)?(t=w,(g=Object.assign({},t)).__typename="Asset",g.url=null==g||null===(n=g.file)||void 0===n?void 0:n.url,g.contentType=null==g||null===(r=g.file)||void 0===r?void 0:r.contentType,g.size=null==g||null===(d=g.file)||void 0===d||null===(a=d.details)||void 0===a?void 0:a.size,g.width=(null==g||null===(f=g.file)||void 0===f||null===(y=f.details)||void 0===y||null===(c=y.image)||void 0===c?void 0:c.width)||(null==g||null===(p=g.file)||void 0===p||null===(v=p.details)||void 0===v||null===(h=v.video)||void 0===h?void 0:h.width),g.height=(null==g||null===(b=g.file)||void 0===b||null===(O=b.details)||void 0===O||null===(A=O.image)||void 0===A?void 0:A.height)||(null==g||null===(m=g.file)||void 0===m||null===(_=m.details)||void 0===_||null===(j=_.video)||void 0===j?void 0:j.height),g.fileName=null==g||null===(P=g.file)||void 0===P?void 0:P.fileName,g.url.startsWith("https:")||(g.url="https:"+g.url),delete g.file,g):w;return function r(e,i,s){if(!e||!s)return e;var l=Object.assign({},e||{});return Object.keys(s).forEach(function(e){if(!l.hasOwnProperty(e))if(e.endsWith("Collection")){var t=e.replace("Collection",""),n=l.hasOwnProperty(t)&&l[t];n?(l[e]=D(n,""+i+S(e),s[e]),delete l[t]):l[e]=D([],""+i+S(e),s[e])}else e.startsWith("...")&&l.__typename&&l.__typename===e.replace("...","")?Object.assign(l,r(l,i,s[e])):l[e]=null}),l}(T,T.__typename||s,l)}function D(e,t,n,r){return void 0===e&&(e=[]),void 0===r&&(r=0),{__typename:t,total:(e&&Array.isArray(e)?e:[]).length,items:(e&&Array.isArray(e)?e:[]).map(function(e){return C(e,t,null==n?void 0:n.items,r)}).filter(function(e){return!!e})}}return void 0===E&&(E={include:10}),null!=t&&t.items?((i={})[e]=D(t.items,S(e),null==n?void 0:n[e]),i):((r={})[e]=s({__typename:S(e)},C(t,S(e),null==n?void 0:n[e])),r)},Object.defineProperty(e,"__esModule",{value:!0})});
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