PageSourceSearch

https://transform.tools/_next/static/chunks/pages/json-to-graphql-a028871c4088647fc7a5.js

js transform.tools collected 2026-10-03 21:42:33 UTC 12,070 bytes, 1 lines download raw bytes

1_N_E=("object"!==typeof self?self:this.webpackJsonp_N_E="object"!==typeof self?self:this.webpackJsonp_N_E||[]).push([[59],{"74rG":function(t,e,r){"use strict";const n=r("TbSJ"),o=r("A1SM"),i=r("Z94/"),u=r("xQ8M"),c=r("9MQZ"),a=/[\W]+/g,s=t=>t.replace(a,"");t.exports={toSchema:t=>{const e={},r=[],a=[{obj:t,path:"",cleanedPath:""}];for(;a.length>0;){const{obj:t,path:f,cleanedPath:l}=a.pop();Object.keys(t).forEach((p=>{let h=t[p];if(!Array.isArray(h)&&!u(h)){const t=n(y=h)?"Int":o(y)?"Boolean":i(y)?"Float":"String";return void c(e,`${l?`${l}.`:""}${s(p)}`,t)}var y;if(r.some((t=>t===h)))return;r.push(h);const v=`${f?`${f}.`:""}${p}`,d=`${l?`${l}.`:""}${s(p)}`;Array.isArray(h)&&(h=[h[0]]),a.push({obj:h,path:v,cleanedPath:d})}))}return r.splice(0,r.length),e}}},"8oxB":function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"===typeof clearTimeout?clearTimeout:u}catch(t){n=u}}();var a,s=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?s=a.concat(s):l=-1,s.length&&h())}function h(){if(!f){var t=c(p);f=!0;for(var e=s.length;e;){for(a=s,s=[];++l<e;)a&&a[l].run();l=-1,e=s.length}a=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===u||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new y(t,e)),1!==s.length||f||c(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},"9MQZ":function(t,e,r){(function(e){var r="__lodash_hash_undefined__",n="[object Function]",o="[object GeneratorFunction]",i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,p="object"==typeof e&&e&&e.Object===Object&&e,h="object"==typeof self&&self&&self.Object===Object&&self,y=p||h||Function("return this")();var v=Array.prototype,d=Function.prototype,g=Object.prototype,_=y["__core-js_shared__"],b=function(){var t=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),m=d.toString,j=g.hasOwnProperty,$=g.toString,w=RegExp("^"+m.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=y.Symbol,O=v.splice,x=k(y,"Map"),A=k(Object,"create"),S=T?T.prototype:void 0,E=S?S.toString:void 0;function C(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function N(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function I(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function J(t,e,r){var n=t[e];j.call(t,e)&&G(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function L(t,e){for(var r=t.length;r--;)if(G(t[r][0],e))return r;return-1}function M(t){return!(!U(t)||(e=t,b&&b in e))&&(function(t){var e=U(t)?$.call(t):"";return e==n||e==o}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}(t)?w:f).test(function(t){if(null!=t){try{return m.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t));var e}function P(t,e,r,n){if(!U(t))return t;for(var o=-1,c=(e=function(t,e){if(B(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||z(t))return!0;return u.test(t)||!i.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return B(t)?t:F(t)}(e)).length,a=c-1,s=t;null!=s&&++o<c;){var f=Q(e[o]),l=r;if(o!=a){var p=s[f];void 0===(l=n?n(p,f,s):void 0)&&(l=U(p)?p:R(e[o+1])?[]:{})}J(s,f,l),s=s[f]}return t}function Z(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function k(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return M(r)?r:void 0}function R(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||l.test(t))&&t>-1&&t%1==0&&t<e}C.prototype.clear=function(){this.__data__=A?A(null):{}},C.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},C.prototype.get=function(t){var e=this.__data__;if(A){var n=e[t];return n===r?void 0:n}return j.call(e,t)?e[t]:void 0},C.prototype.has=function(t){var e=this.__data__;return A?void 0!==e[t]:j.call(e,t)},C.prototype.set=function(t,e){return this.__data__[t]=A&&void 0===e?r:e,this},N.prototype.clear=function(){this.__data__=[]},N.prototype.delete=function(t){var e=this.__data__,r=L(e,t);return!(r<0)&&(r==e.length-1?e.pop():O.call(e,r,1),!0)},N.prototype.get=function(t){var e=this.__data__,r=L(e,t);return r<0?void 0:e[r][1]},N.prototype.has=function(t){return L(this.__data__,t)>-1}
1,N.prototype.set=function(t,e){var r=this.__data__,n=L(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},I.prototype.clear=function(){this.__data__={hash:new C,map:new(x||N),string:new C}},I.prototype.delete=function(t){return Z(this,t).delete(t)},I.prototype.get=function(t){return Z(this,t).get(t)},I.prototype.has=function(t){return Z(this,t).has(t)},I.prototype.set=function(t,e){return Z(this,t).set(t,e),this};var F=q((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(z(t))return E?E.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return c.test(t)&&r.push(""),t.replace(a,(function(t,e,n,o){r.push(n?o.replace(s,"$1"):e||t)})),r}));function Q(t){if("string"==typeof t||z(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function q(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(q.Cache||I),r}function G(t,e){return t===e||t!==t&&e!==e}q.Cache=I;var B=Array.isArray;function U(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function z(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==$.call(t)}t.exports=function(t,e,r){return null==t?t:P(t,e,r)}}).call(this,r("ntbh"))},A1SM:function(t,e){var r=Object.prototype.toString;t.exports=function(t){return!0===t||!1===t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Boolean]"==r.call(t)}},R1JI:function(t,e,r){"use strict";const n=r("7tlc"),o=r("xQ8M"),{pascalCase:i}=r("T/E0"),{removeDuplicateTypes:u}=r("jqbw"),c=(t,e,r)=>{let u="";Object.keys(r).forEach((t=>{if(Array.isArray(r[t])){const n=r[t][0];if(1===n.length)return`${e}${i(t)}: [${n}]`;if(Array.isArray(n)||o(n)){const o=`${e}${i(t)}`;u+=c(o,e,n),r[t][0]=o}return""}if(o(r[t])){const n=`${e}${i(t)}`;u+=c(n,e,r[t]),r[t]=n}return""}));const a=n.inspect(r,{depth:null,compact:!1});return`${u}type ${t} ${a.replace(/'/g,"")} `.replace(/\[\n/g,"[").replace(/\[\s+/g,"[").replace(/\n\s+\]/g,"]").replace(/,/g,"").replace(/ {3,}/g,"  ")};t.exports={stringifySchema:(t,e,r)=>u(c(t,e,r))}},"T/E0":function(t,e,r){"use strict";r.r(e),r.d(e,"pascalCaseTransform",(function(){return a})),r.d(e,"pascalCaseTransformMerge",(function(){return s})),r.d(e,"pascalCase",(function(){return f}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t){return t.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],u=/[^A-Z0-9]+/gi;function c(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce((function(t,e){return t.replace(e,r)}),t)}function a(t,e){var r=t.charAt(0),n=t.substr(1).toLowerCase();return e>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function s(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function f(t,e){return void 0===e&&(e={}),function(t,e){void 0===e&&(e={});for(var r=e.splitRegexp,n=void 0===r?i:r,a=e.stripRegexp,s=void 0===a?u:a,f=e.transform,l=void 0===f?o:f,p=e.delimiter,h=void 0===p?" ":p,y=c(c(t,n,"$1\0$2"),s,"\0"),v=0,d=y.length;"\0"===y.charAt(v);)v++;for(;"\0"===y.charAt(d-1);)d--;return y.slice(v,d).split("\0").map(l).join(h)}(t,n({delimiter:"",transform:a},e))}},TbSJ:function(t,e){var r=1/0,n=17976931348623157e292,o=NaN,i="[object Symbol]",u=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,f=parseInt,l=Object.prototype.toString;function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){return"number"==typeof t&&t==function(t){var e=function(t){if(!t)return 0===t?t:0;if((t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&l.call(t)==i}(t))return o;if(p(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=p(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var r=a.test(t);return r||s.test(t)?f(t.slice(2),r?2:8):c.test(t)?o:+t}(t))===r||t===-1/0){return(t<0?-1:1)*n}return t===t?t:0}(t),h=e%1;return e===e?h?e-h:e:0}(t)}},"Z94/":function(t,e){var r=Object.prototype.toString;t.exports=function(t){return"number"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Number]"==r.call(t)}},d77I:function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return c}));var n=r("nKUr"),o=r("sN8P"),i=r("q1tI"),u=r("pZ2R");function c(){var t=Object(i.useCallback)((function(t){var e=t.value;
1return Object(u.jsonToSchema)({jsonInput:e}).value}),[]);return Object(n.jsx)(o.a,{transformer:t,editorTitle:"JSON",editorLanguage:"json",resultTitle:"GraphQL",resultLanguage:"graphql"})}},jqbw:function(t,e,r){"use strict";t.exports={removeDuplicateTypes:t=>{const e=Object.values((t=>` ${t}`.split(" type ").filter((t=>t)).reduce(((t,e,r)=>{const n=`type ${e}`.trim(),o=e.trim().split(" ").map((t=>t.trim())),i=o.shift(),u=o.filter((t=>t.indexOf(":")>-1)).length;return(!t[i]||t[i].amtFields<u)&&(t[i]={full:n,name:i,amtFields:u,idx:r}),t}),{}))(t)).sort(((t,e)=>t.idx-e.idx)).map((({full:t})=>t)).join("\n\n"),r=Object.values((t=>t.split("type ").filter((t=>t)).reduce(((t,e)=>{const r=e.trim().split(" ").map((t=>t.trim())),n=r.shift(),o=r.join(" ");return t[o]?(-1===t[o].indexOf(n)&&t[o].push(n),t):(t[o]=[n],t)}),{}))(e)).filter((t=>t.length>1)).map((t=>`# ${t.join(" ")}`)).join("\n");return`${e}${r?`\n\n# Types with identical fields:\n${r}`:""}`}}},mg9A:function(t,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/json-to-graphql",function(){return r("d77I")}])},pZ2R:function(t,e,r){"use strict";const{toSchema:n}=r("74rG"),{stringifySchema:o}=r("R1JI"),i=t=>{try{return{value:t()}}catch(e){return{error:e}}},u=t=>{const{error:e,value:r}=i((()=>JSON.parse(t)));return e?(e.message=`Invalid JSON received: ${t}, error: ${e.message}`,{error:e}):r?{value:r}:{error:new Error(`Invalid JSON received: ${t}`)}};t.exports={jsonToSchema:({baseType:t="AutogeneratedMainType",prefix:e="",jsonInput:r})=>{const{error:c,value:a}=u(r);return c?{error:c}:i((()=>o(t,e,n(a))))},validateJson:u}},xQ8M:function(t,e){t.exports=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}}},[["mg9A",1,2,0,3,17]]]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.