Comparing version 3.1.2 to 3.2.0
/*! | ||
* Hjson v3.1.2 | ||
* Hjson v3.2.0 | ||
* http://hjson.org | ||
@@ -951,2 +951,3 @@ * | ||
var dsfDef = null; | ||
var sortProps = false; | ||
var token = plainToken; | ||
@@ -967,2 +968,3 @@ | ||
dsfDef = opt.dsf; | ||
sortProps = opt.sortProps; | ||
@@ -1230,7 +1232,12 @@ // If the space parameter is a number, make an indent string containing that | ||
// Otherwise, iterate through all of the keys in the object. | ||
var keys = comments ? comments.o.slice() : []; | ||
var commentKeys = comments ? comments.o.slice() : []; | ||
var objectKeys = []; | ||
for (k in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, k) && keys.indexOf(k) < 0) | ||
keys.push(k); | ||
if (Object.prototype.hasOwnProperty.call(value, k) && objectKeys.indexOf(k) < 0) | ||
objectKeys.push(k); | ||
} | ||
if(sortProps) { | ||
objectKeys.sort(); | ||
} | ||
var keys = commentKeys.concat(objectKeys); | ||
@@ -1312,7 +1319,7 @@ for (i = 0, length = keys.length; i < length; i++) { | ||
},{"./hjson-common":2,"./hjson-dsf":3}],6:[function(require,module,exports){ | ||
module.exports="3.1.2"; | ||
module.exports="3.2.0"; | ||
},{}],7:[function(require,module,exports){ | ||
/*! | ||
* Hjson v3.1.2 | ||
* Hjson v3.2.0 | ||
* http://hjson.org | ||
@@ -1395,2 +1402,6 @@ * | ||
obsolete: will always emit braces | ||
sortProps | ||
When serializing objects into hjson, order the keys based on | ||
their UTF-16 code units order | ||
} | ||
@@ -1397,0 +1408,0 @@ |
/*! | ||
* Hjson v3.1.2 | ||
* Hjson v3.2.0 | ||
* http://hjson.org | ||
@@ -12,4 +12,4 @@ * | ||
*/ | ||
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Hjson=n()}}(function(){return function(){function n(e,r,t){function o(a,u){if(!r[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(n){return o(e[a][1][n]||n)},c,c.exports,n,e,r,t)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<t.length;a++)o(t[a]);return o}return n}()({1:[function(n,e,r){"use strict";function t(n,e,r){var t;return n&&(t={b:n}),e&&((t=t||{}).a=e),r&&((t=t||{}).x=r),t}function o(n,e){if(null!==n&&"object"==typeof n){var r=h.getComment(n);r&&h.removeComment(n);var i,a,s,f;if("[object Array]"===Object.prototype.toString.apply(n)){for(f={a:{}},i=0,a=n.length;i<a;i++)u(f.a,i,r.a[i],o(n[i]))&&(s=!0);!s&&r.e&&(f.e=t(r.e[0],r.e[1]),s=!0)}else{f={s:{}};var c,l=Object.keys(n);for(r&&r.o?(c=[],r.o.concat(l).forEach(function(e){Object.prototype.hasOwnProperty.call(n,e)&&c.indexOf(e)<0&&c.push(e)})):c=l,f.o=c,i=0,a=c.length;i<a;i++){var p=c[i];u(f.s,p,r.c[p],o(n[p]))&&(s=!0)}!s&&r.e&&(f.e=t(r.e[0],r.e[1]),s=!0)}return e&&r&&r.r&&(f.r=t(r.r[0],r.r[1])),s?f:void 0}}function i(){var n="";return[].forEach.call(arguments,function(e){e&&""!==e.trim()&&(n&&(n+="; "),n+=e.trim())}),n}function a(n,e){var r=[];if(c(n,e,r,[]),r.length>0){var t=l(e,null,1);t+="\n# Orphaned comments:\n",r.forEach(function(n){t+=("# "+n.path.join("/")+": "+i(n.b,n.a,n.e)).replace("\n","\\n ")+"\n"}),l(e,t,1)}}function u(n,e,r,o){var i=t(r?r[0]:void 0,r?r[1]:void 0,o);return i&&(n[e]=i),i}function s(n,e){var r=t(e.b,e.a);return r.path=n,r}function f(n,e,r){if(n){var t,o;if(n.a)for(t=0,o=n.a.length;t<o;t++){var i=r.slice().concat([t]),a=n.a[t];a&&(e.push(s(i,a)),f(a.x,e,i))}else n.o&&n.o.forEach(function(t){var o=r.slice().concat([t]),i=n.s[t];i&&(e.push(s(o,i)),f(i.x,e,o))});n.e&&e.push(s(r,n.e))}}function c(n,e,r,t){if(n){if(null===e||"object"!=typeof e)return void f(n,r,t);var o,i=h.createComment(e);if(0===t.length&&n.r&&(i.r=[n.r.b,n.r.a]),"[object Array]"===Object.prototype.toString.apply(e)){i.a=[];var a=n.a||{};for(var u in a)if(a.hasOwnProperty(u)){o=parseInt(u);var l=n.a[u];if(l){var p=t.slice().concat([o]);o<e.length?(i.a[o]=[l.b,l.a],c(l.x,e[o],r,p)):(r.push(s(p,l)),f(l.x,r,p))}}0===o&&n.e&&(i.e=[n.e.b,n.e.a])}else i.c={},i.o=[],(n.o||[]).forEach(function(o){var a=t.slice().concat([o]),u=n.s[o];Object.prototype.hasOwnProperty.call(e,o)?(i.o.push(o),u&&(i.c[o]=[u.b,u.a],c(u.x,e[o],r,a))):u&&(r.push(s(a,u)),f(u.x,r,a))}),n.e&&(i.e=[n.e.b,n.e.a])}}function l(n,e,r){var t=h.createComment(n,h.getComment(n));return t.r||(t.r=["",""]),(e||""===e)&&(t.r[r]=h.forceComment(e)),t.r[r]||""}var h=n("./hjson-common");e.exports={extract:function(n){return o(n,!0)},merge:a,header:function(n,e){return l(n,e,0)},footer:function(n,e){return l(n,e,1)}}},{"./hjson-common":2}],2:[function(n,e,r){"use strict";function t(n,e){function r(){return o=n.charAt(s),s++,o}var t,o,i="",a=0,u=!0,s=0;for(r(),"-"===o&&(i="-",r());o>="0"&&o<="9";)u&&("0"==o?a++:u=!1),i+=o,r();if(u&&a--,"."===o)for(i+=".";r()&&o>="0"&&o<="9";)i+=o;if("e"===o||"E"===o)for(i+=o,r(),"-"!==o&&"+"!==o||(i+=o,r());o>="0"&&o<="9";)i+=o,r();for(;o&&o<=" ";)r();return e&&(","!==o&&"}"!==o&&"]"!==o&&"#"!==o&&("/"!==o||"/"!==n[s]&&"*"!==n[s])||(o=0)),t=+i,o||a||!isFinite(t)?void 0:t}function o(n,e){return Object.defineProperty&&Object.defineProperty(n,"__COMMENTS__",{enumerable:!1,writable:!0}),n.__COMMENTS__=e||{}}function i(n){Object.defineProperty(n,"__COMMENTS__",{value:void 0})}function a(n){return n.__COMMENTS__}function u(n){if(!n)return"";var e,r,t,o,i=n.split("\n");for(t=0;t<i.length;t++)for(e=i[t],o=e.length,r=0;r<o;r++){var a=e[r];if("#"===a)break;if("/"===a&&("/"===e[r+1]||"*"===e[r+1])){"*"===e[r+1]&&(t=i.length);break}if(a>" "){i[t]="# "+e;break}}return i.join("\n")}var s=n("os");e.exports={EOL:s.EOL||"\n",tryParseNumber:t,createComment:o,removeComment:i,getComment:a,forceComment:u}},{os:8}],3:[function(n,e,r){"use strict";function t(n,e){function r(n){return"[object Function]"==={}.toString.call(n)}if("[object Array]"!==Object.prototype.toString.apply(n)){if(n)throw new Error("dsf option must contain an array!");return i}if(0===n.length)return i;var t=[];return n.forEach(function(n){if(!n.name||!r(n.parse)||!r(n.stringify))throw new Error("extension does not match the DSF interface");t.push(function(){try{if("parse"==e)return n.parse.apply(null,arguments);if("stringify"==e){var r=n.stringify.apply(null,arguments);if(void 0!==r&&("string"!=typeof r||0===r.length||'"'===r[0]||[].some.call(r,function(n){return a(n)})))throw new Error("value may not be empty, start with a quote or contain a punctuator character except colon: "+r);return r}throw new Error("Invalid type")}catch(e){throw new Error("DSF-"+n.name+" failed; "+e.message)}})}),o.bind(null,t)}function o(n,e){if(n)for(var r=0;r<n.length;r++){var t=n[r](e);if(void 0!==t)return t}}function i(){}function a(n){return"{"===n||"}"===n||"["===n||"]"===n||","===n}function u(){return{name:"math",parse:function(n){switch(n){case"+inf":case"inf":case"+Inf":case"Inf":return 1/0;case"-inf":case"-Inf":return-1/0;case"nan":case"NaN":return NaN}},stringify:function(n){if("number"==typeof n)return 1/n==-1/0?"-0":n===1/0?"Inf":n===-1/0?"-Inf":isNaN(n)?"NaN":void 0}}}function s(n){var e=n&&n.out;return{name:"hex",parse:function(n){if(/^0x[0-9A-Fa-f]+$/.test(n))return parseInt(n,16)},stringify:function(n){if(e&&Number.isInteger(n))return"0x"+n.toString(16)}}}function f(){return{name:"date",parse:function(n){if(/^\d{4}-\d{2}-\d{2}$/.test(n)||/^\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}(?:.\d+)(?:Z|[+-]\d{2}:\d{2})$/.test(n)){var e=Date.parse(n);if(!isNaN(e))return new Date(e)}},stringify:function(n){if("[object Date]"===Object.prototype.toString.call(n)){var e=n.toISOString();return-1!==e.indexOf("T00:00:00.000Z",e.length-14)?e.substr(0,10):e}}}}u.description="support for Inf/inf, -Inf/-inf, Nan/naN and -0",s.description="parse hexadecimal numbers prefixed with 0x",f.description="support ISO dates",e.exports={loadDsf:t,std:{math:u,hex:s,date:f}}},{}],4:[function(n,e,r){"use strict";e.exports=function(e,r){function t(){j=0,w=" "}function o(n){return"{"===n||"}"===n||"["===n||"]"===n||","===n||":"===n}function i(n){var e,r=0,t=1;for(e=j-1;e>0&&"\n"!==b[e];e--,r++);for(;e>0;e--)"\n"===b[e]&&t++;throw new Error(n+" at line "+t+","+r+" >>>"+b.substr(j-r,20)+" ...")}function a(){return w=b.charAt(j),j++,w}function u(n){return b.charAt(j+n)}function s(n){for(var e="",r=w;a();){if(w===r)return a(),n&&"'"===r&&"'"===w&&0===e.length?(a(),f()):e;if("\\"===w)if(a(),"u"===w){for(var t=0,o=0;o<4;o++){a();var u,s=w.charCodeAt(0);w>="0"&&w<="9"?u=s-48:w>="a"&&w<="f"?u=s-97+10:w>="A"&&w<="F"?u=s-65+10:i("Bad \\u char "+w),t=16*t+u}e+=String.fromCharCode(t)}else{if("string"!=typeof C[w])break;e+=C[w]}else"\n"===w||"\r"===w?i("Bad string containing newline"):e+=w}i("Bad string")}function f(){function n(){for(var n=t;w&&w<=" "&&"\n"!==w&&n-- >0;)a()}for(var e="",r=0,t=0;;){var o=u(-t-5);if(!o||"\n"===o)break;t++}for(;w&&w<=" "&&"\n"!==w;)a();for("\n"===w&&(a(),n());;){if(w){if("'"===w){if(r++,a(),3===r)return"\n"===e.slice(-1)&&(e=e.slice(0,-1)),e;continue}for(;r>0;)e+="'",r--}else i("Bad multiline string");"\n"===w?(e+="\n",a(),n()):("\r"!==w&&(e+=w),a())}}function c(){if('"'===w||"'"===w)return s(!1);for(var n="",e=j,r=-1;;){if(":"===w)return n?r>=0&&r!==n.length&&(j=e+r,i("Found whitespace in your key name (use quotes to include)")):i("Found ':' but no key name (for an empty key name use quotes)"),n;w<=" "?w?r<0&&(r=n.length):i("Found EOF while looking for a key name (check your syntax)"):o(w)?i("Found '"+w+"' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace)"):n+=w,a()}}function l(){for(;w;){for(;w&&w<=" ";)a();if("#"===w||"/"===w&&"/"===u(0))for(;w&&"\n"!==w;)a();else{if("/"!==w||"*"!==u(0))break;for(a(),a();w&&("*"!==w||"/"!==u(0));)a();w&&(a(),a())}}}function h(){var n=w;for(o(w)&&i("Found a punctuator character '"+w+"' when expecting a quoteless string (check your syntax)");;){a();var e="\r"===w||"\n"===w||""===w;if(e||","===w||"}"===w||"]"===w||"#"===w||"/"===w&&("/"===u(0)||"*"===u(0))){var r=n[0];switch(r){case"f":if("false"===n.trim())return!1;break;case"n":if("null"===n.trim())return null;break;case"t":if("true"===n.trim())return!0;break;default:if("-"===r||r>="0"&&r<="9"){var t=k.tryParseNumber(n);if(void 0!==t)return t}}if(e){n=n.trim();var s=O(n);return void 0!==s?s:n}}n+=w}}function p(n,e){var r;for(n--,r=j-2;r>n&&b[r]<=" "&&"\n"!==b[r];r--);"\n"===b[r]&&r--,"\r"===b[r]&&r--;var t=b.substr(n,r-n+1);for(r=0;r<t.length;r++)if(t[r]>" "){var o=t.indexOf("\n");if(o>=0){var i=[t.substr(0,o),t.substr(o+1)];return e&&0===i[0].trim().length&&i.shift(),i}return[t]}return[]}function m(n){function e(n,r){var t,o,i,a;switch(typeof n){case"string":n.indexOf(r)>=0&&(a=n);break;case"object":if("[object Array]"===Object.prototype.toString.apply(n))for(t=0,i=n.length;t<i;t++)a=e(n[t],r)||a;else for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&(a=e(n[o],r)||a)}return a}function r(r){var t=e(n,r);return t?"found '"+r+"' in a string value, your mistake could be with:\n > "+t+"\n (unquoted strings contain everything up to the next line!)":""}return r("}")||r("]")}function d(){var n,e,r,t=[];try{if(x&&(n=k.createComment(t,{a:[]})),a(),e=j,l(),n&&(r=p(e,!0).join("\n")),"]"===w)return a(),n&&(n.e=[r]),t;for(;w;){if(t.push(y()),e=j,l(),","===w&&(a(),e=j,l()),n){var o=p(e);n.a.push([r||"",o[0]||""]),r=o[1]}if("]"===w)return a(),n&&(n.a[n.a.length-1][1]+=r||""),t;l()}i("End of input while parsing an array (missing ']')")}catch(n){throw n.hint=n.hint||m(t),n}}function g(n){var e,r,t,o="",u={};try{if(x&&(e=k.createComment(u,{c:{},o:[]})),n?r=1:(a(),r=j),l(),e&&(t=p(r,!0).join("\n")),"}"===w&&!n)return e&&(e.e=[t]),a(),u;for(;w;){if(o=c(),l(),":"!==w&&i("Expected ':' instead of '"+w+"'"),a(),u[o]=y(),r=j,l(),","===w&&(a(),r=j,l()),e){var s=p(r);e.c[o]=[t||"",s[0]||""],t=s[1],e.o.push(o)}if("}"===w&&!n)return a(),e&&(e.c[o][1]+=t||""),u;l()}if(n)return u;i("End of input while parsing an object (missing '}')")}catch(n){throw n.hint=n.hint||m(u),n}}function y(){switch(l(),w){case"{":return g();case"[":return d();case"'":case'"':return s(!0);default:return h()}}function v(n,e){var r=j;if(l(),w&&i("Syntax error, found trailing characters"),x){var t=e.join("\n"),o=p(r).join("\n");if(o||t){k.createComment(n,k.getComment(n)).r=[t,o]}}return n}var b,j,w,x,O,k=n("./hjson-common"),E=n("./hjson-dsf"),C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};if("string"!=typeof e)throw new Error("source is not a string");var q=null,S=!0;return r&&"object"==typeof r&&(x=r.keepWsc,q=r.dsf,S=!1!==r.legacyRoot),O=E.loadDsf(q,"parse"),b=e,t(),S?function(){l();var n=x?p(1):null;switch(w){case"{":return v(g(),n);case"[":return v(d(),n)}try{return v(g(!0),n)}catch(e){t();try{return v(y(),n)}catch(n){throw e}}}():function(){l();var n=x?p(1):null;switch(w){case"{":return v(g(),n);case"[":return v(d(),n);default:return v(y(),n)}}()}},{"./hjson-common":2,"./hjson-dsf":3}],5:[function(n,e,r){"use strict";e.exports=function(e,r){function t(n,e){return D+=n[0].length+n[1].length-n[2]-n[3],n[0]+e+n[1]}function o(n){return n.replace(S,function(n){var e=F[n];return"string"==typeof e?t(x.esc,e):t(x.uni,("0000"+n.charCodeAt(0).toString(16)).slice(-4))})}function i(n,e,r,i){return n?(N.lastIndex=0,_.lastIndex=0,y||r||N.test(n)||void 0!==f.tryParseNumber(n,!0)||_.test(n)?(S.lastIndex=0,I.lastIndex=0,S.test(n)?I.test(n)||i||!b?t(x.qstr,o(n)):a(n,e):t(x.qstr,n)):t(x.str,n)):t(x.qstr,"")}function a(n,e){var r,o=n.replace(/\r/g,"").split("\n");if(e+=p,1===o.length)return t(x.mstr,o[0]);var i=h+e+x.mstr[0];for(r=0;r<o.length;r++)i+=h,o[r]&&(i+=e+o[r]);return i+h+e+x.mstr[1]}function u(n){return n?g||A.test(n)?(S.lastIndex=0,t(x.qkey,S.test(n)?o(n):n)):t(x.key,n):'""'}function s(n,e,r,o){function a(n){return n&&"\n"===n["\r"===n[0]?1:0]}function c(n){return n&&!a(n)}function l(n,e,r){if(!n)return"";n=f.forceComment(n);var o,i=n.length;for(o=0;o<i&&n[o]<=" ";o++);return r&&o>0&&(n=n.substr(o)),o<i?e+t(x.rem,n):n}var g=C(n);if(void 0!==g)return t(x.dsf,g);switch(typeof n){case"string":return i(n,P,e,o);case"number":return isFinite(n)?t(x.num,String(n)):t(x.lit,"null");case"boolean":return t(x.lit,String(n));case"object":if(!n)return t(x.lit,"null");var w;m&&(w=f.getComment(n));var O="[object Array]"===Object.prototype.toString.apply(n),k=P;P+=p;var E,q,S,N,I,_,F,A,L,M,T=h+k,$=h+P,R=r||d?"":T,B=[],W=v?[]:null,U=y,Z=b,H=j?"":x.com[0],z=0;if(O){for(q=0,S=n.length;q<S;q++){if(E=q<S-1,w?(F=w.a[q]||[],A=c(F[1]),B.push(l(F[0],"\n")+$),W&&(F[0]||F[1]||A)&&(W=null)):B.push($),D=0,I=n[q],B.push(s(I,!!w&&A,!0)+(E?j:"")),W){switch(typeof I){case"string":D=0,y=!0,b=0,W.push(s(I,!1,!0)+(E?x.com[0]:"")),y=U,b=Z;break;case"object":if(I){W=null;break}default:W.push(B[B.length-1]+(E?H:""))}E&&(D+=x.com[0].length-x.com[2]),z+=D}w&&F[1]&&B.push(l(F[1],A?" ":"\n",A))}0===S?w&&w.e&&B.push(l(w.e[0],"\n")+T):B.push(T),0===B.length?L=t(x.arr,""):(L=R+t(x.arr,B.join("")),W&&(M=W.join(" "),M.length-z<=v&&(L=t(x.arr,M))))}else{var G=w?w.o.slice():[];for(N in n)Object.prototype.hasOwnProperty.call(n,N)&&G.indexOf(N)<0&&G.push(N);for(q=0,S=G.length;q<S;q++)if(E=q<S-1,N=G[q],w?(F=w.c[N]||[],A=c(F[1]),B.push(l(F[0],"\n")+$),W&&(F[0]||F[1]||A)&&(W=null)):B.push($),D=0,I=n[N],_=s(I,w&&A),B.push(u(N)+x.col[0]+(a(_)?"":" ")+_+(E?j:"")),w&&F[1]&&B.push(l(F[1],A?" ":"\n",A)),W){switch(typeof I){case"string":D=0,y=!0,b=0,_=s(I,!1),y=U,b=Z,W.push(u(N)+x.col[0]+" "+_+(E?x.com[0]:""));break;case"object":if(I){W=null;break}default:W.push(B[B.length-1]+(E?H:""))}D+=x.col[0].length-x.col[2],E&&(D+=x.com[0].length-x.com[2]),z+=D}0===S?w&&w.e&&B.push(l(w.e[0],"\n")+T):B.push(T),0===B.length?L=t(x.obj,""):(L=R+t(x.obj,B.join("")),W&&(M=W.join(" "),M.length-z<=v&&(L=t(x.obj,M))))}return P=k,L}}var f=n("./hjson-common"),c=n("./hjson-dsf"),l={obj:["{","}"],arr:["[","]"],key:["",""],qkey:['"','"'],col:[":",""],com:[",",""],str:["",""],qstr:['"','"'],mstr:["'''","'''"],num:["",""],lit:["",""],dsf:["",""],esc:["\\",""],uni:["\\u",""],rem:["",""]},h=f.EOL,p=" ",m=!1,d=!1,g=!1,y=!1,v=0,b=1,j="",w=null,x=l;if(r&&"object"==typeof r){r.quotes="always"===r.quotes?"strings":r.quotes,"\n"!==r.eol&&"\r\n"!==r.eol||(h=r.eol),m=r.keepWsc,v=r.condense||0,d=r.bracesSameLine,g="all"===r.quotes||"keys"===r.quotes,y="all"===r.quotes||"strings"===r.quotes||!0===r.separator,b=y||"off"==r.multiline?0:"no-tabs"==r.multiline?2:1,j=!0===r.separator?x.com[0]:"",w=r.dsf,"number"==typeof r.space?p=new Array(r.space+1).join(" "):"string"==typeof r.space&&(p=r.space),!0===r.colors&&(x={obj:["[37m{[0m","[37m}[0m"],arr:["[37m[[0m","[37m][0m"],key:["[33m","[0m"],qkey:['[33m"','"[0m'],col:["[37m:[0m",""],com:["[37m,[0m",""],str:["[37;1m","[0m"],qstr:['[37;1m"','"[0m'],mstr:["[37;1m'''","'''[0m"],num:["[36;1m","[0m"],lit:["[36m","[0m"],dsf:["[37m","[0m"],esc:["[31m\\","[0m"],uni:["[31m\\u","[0m"],rem:["[35m","[0m"]});var O,k=Object.keys(l);for(O=k.length-1;O>=0;O--){var E=k[O];x[E].push(l[E][0].length,l[E][1].length)}}var C,q="--឴឵-\u2028- -\ufeff-",S=new RegExp('[\\\\\\"\0-'+q+"]","g"),N=new RegExp("^\\s|^\"|^'|^#|^\\/\\*|^\\/\\/|^\\{|^\\}|^\\[|^\\]|^:|^,|\\s$|[\0-"+q+"]","g"),I=new RegExp("'''|^[\\s]+$|[\0-"+(2===b?"\t":"\b")+"\v\f-"+q+"]","g"),_=new RegExp("^(true|false|null)\\s*((,|\\]|\\}|#|//|/\\*).*)?$"),F={"\b":"b","\t":"t","\n":"n","\f":"f","\r":"r",'"':'"',"\\":"\\"},A=/[,\{\[\}\]\s:#"']|\/\/|\/\*/,P="",D=0;C=c.loadDsf(w,"stringify");var L="",M=m?M=(f.getComment(e)||{}).r:null;return M&&M[0]&&(L=M[0]+"\n"),L+=s(e,null,!0,!0),M&&(L+=M[1]||""),L}},{"./hjson-common":2,"./hjson-dsf":3}],6:[function(n,e,r){e.exports="3.1.2"},{}],7:[function(n,e,r){/*! | ||
* Hjson v3.1.2 | ||
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.Hjson=n()}}(function(){return function(){function n(r,e,t){function o(a,s){if(!e[a]){if(!r[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=e[a]={exports:{}};r[a][0].call(c.exports,function(n){return o(r[a][1][n]||n)},c,c.exports,n,r,e,t)}return e[a].exports}for(var i="function"==typeof require&&require,a=0;a<t.length;a++)o(t[a]);return o}return n}()({1:[function(n,r,e){"use strict";function t(n,r,e){var t;return n&&(t={b:n}),r&&((t=t||{}).a=r),e&&((t=t||{}).x=e),t}function o(n,r){if(null!==n&&"object"==typeof n){var e=h.getComment(n);e&&h.removeComment(n);var i,a,u,f;if("[object Array]"===Object.prototype.toString.apply(n)){for(f={a:{}},i=0,a=n.length;i<a;i++)s(f.a,i,e.a[i],o(n[i]))&&(u=!0);!u&&e.e&&(f.e=t(e.e[0],e.e[1]),u=!0)}else{f={s:{}};var c,l=Object.keys(n);for(e&&e.o?(c=[],e.o.concat(l).forEach(function(r){Object.prototype.hasOwnProperty.call(n,r)&&c.indexOf(r)<0&&c.push(r)})):c=l,f.o=c,i=0,a=c.length;i<a;i++){var p=c[i];s(f.s,p,e.c[p],o(n[p]))&&(u=!0)}!u&&e.e&&(f.e=t(e.e[0],e.e[1]),u=!0)}return r&&e&&e.r&&(f.r=t(e.r[0],e.r[1])),u?f:void 0}}function i(){var n="";return[].forEach.call(arguments,function(r){r&&""!==r.trim()&&(n&&(n+="; "),n+=r.trim())}),n}function a(n,r){var e=[];if(c(n,r,e,[]),e.length>0){var t=l(r,null,1);t+="\n# Orphaned comments:\n",e.forEach(function(n){t+=("# "+n.path.join("/")+": "+i(n.b,n.a,n.e)).replace("\n","\\n ")+"\n"}),l(r,t,1)}}function s(n,r,e,o){var i=t(e?e[0]:void 0,e?e[1]:void 0,o);return i&&(n[r]=i),i}function u(n,r){var e=t(r.b,r.a);return e.path=n,e}function f(n,r,e){if(n){var t,o;if(n.a)for(t=0,o=n.a.length;t<o;t++){var i=e.slice().concat([t]),a=n.a[t];a&&(r.push(u(i,a)),f(a.x,r,i))}else n.o&&n.o.forEach(function(t){var o=e.slice().concat([t]),i=n.s[t];i&&(r.push(u(o,i)),f(i.x,r,o))});n.e&&r.push(u(e,n.e))}}function c(n,r,e,t){if(n){if(null===r||"object"!=typeof r)return void f(n,e,t);var o,i=h.createComment(r);if(0===t.length&&n.r&&(i.r=[n.r.b,n.r.a]),"[object Array]"===Object.prototype.toString.apply(r)){i.a=[];var a=n.a||{};for(var s in a)if(a.hasOwnProperty(s)){o=parseInt(s);var l=n.a[s];if(l){var p=t.slice().concat([o]);o<r.length?(i.a[o]=[l.b,l.a],c(l.x,r[o],e,p)):(e.push(u(p,l)),f(l.x,e,p))}}0===o&&n.e&&(i.e=[n.e.b,n.e.a])}else i.c={},i.o=[],(n.o||[]).forEach(function(o){var a=t.slice().concat([o]),s=n.s[o];Object.prototype.hasOwnProperty.call(r,o)?(i.o.push(o),s&&(i.c[o]=[s.b,s.a],c(s.x,r[o],e,a))):s&&(e.push(u(a,s)),f(s.x,e,a))}),n.e&&(i.e=[n.e.b,n.e.a])}}function l(n,r,e){var t=h.createComment(n,h.getComment(n));return t.r||(t.r=["",""]),(r||""===r)&&(t.r[e]=h.forceComment(r)),t.r[e]||""}var h=n("./hjson-common");r.exports={extract:function(n){return o(n,!0)},merge:a,header:function(n,r){return l(n,r,0)},footer:function(n,r){return l(n,r,1)}}},{"./hjson-common":2}],2:[function(n,r,e){"use strict";function t(n,r){function e(){return o=n.charAt(u),u++,o}var t,o,i="",a=0,s=!0,u=0;for(e(),"-"===o&&(i="-",e());o>="0"&&o<="9";)s&&("0"==o?a++:s=!1),i+=o,e();if(s&&a--,"."===o)for(i+=".";e()&&o>="0"&&o<="9";)i+=o;if("e"===o||"E"===o)for(i+=o,e(),"-"!==o&&"+"!==o||(i+=o,e());o>="0"&&o<="9";)i+=o,e();for(;o&&o<=" ";)e();return r&&(","!==o&&"}"!==o&&"]"!==o&&"#"!==o&&("/"!==o||"/"!==n[u]&&"*"!==n[u])||(o=0)),t=+i,o||a||!isFinite(t)?void 0:t}function o(n,r){return Object.defineProperty&&Object.defineProperty(n,"__COMMENTS__",{enumerable:!1,writable:!0}),n.__COMMENTS__=r||{}}function i(n){Object.defineProperty(n,"__COMMENTS__",{value:void 0})}function a(n){return n.__COMMENTS__}function s(n){if(!n)return"";var r,e,t,o,i=n.split("\n");for(t=0;t<i.length;t++)for(r=i[t],o=r.length,e=0;e<o;e++){var a=r[e];if("#"===a)break;if("/"===a&&("/"===r[e+1]||"*"===r[e+1])){"*"===r[e+1]&&(t=i.length);break}if(a>" "){i[t]="# "+r;break}}return i.join("\n")}var u=n("os");r.exports={EOL:u.EOL||"\n",tryParseNumber:t,createComment:o,removeComment:i,getComment:a,forceComment:s}},{os:8}],3:[function(n,r,e){"use strict";function t(n,r){function e(n){return"[object Function]"==={}.toString.call(n)}if("[object Array]"!==Object.prototype.toString.apply(n)){if(n)throw new Error("dsf option must contain an array!");return i}if(0===n.length)return i;var t=[];return n.forEach(function(n){if(!n.name||!e(n.parse)||!e(n.stringify))throw new Error("extension does not match the DSF interface");t.push(function(){try{if("parse"==r)return n.parse.apply(null,arguments);if("stringify"==r){var e=n.stringify.apply(null,arguments);if(void 0!==e&&("string"!=typeof e||0===e.length||'"'===e[0]||[].some.call(e,function(n){return a(n)})))throw new Error("value may not be empty, start with a quote or contain a punctuator character except colon: "+e);return e}throw new Error("Invalid type")}catch(r){throw new Error("DSF-"+n.name+" failed; "+r.message)}})}),o.bind(null,t)}function o(n,r){if(n)for(var e=0;e<n.length;e++){var t=n[e](r);if(void 0!==t)return t}}function i(){}function a(n){return"{"===n||"}"===n||"["===n||"]"===n||","===n}function s(){return{name:"math",parse:function(n){switch(n){case"+inf":case"inf":case"+Inf":case"Inf":return 1/0;case"-inf":case"-Inf":return-1/0;case"nan":case"NaN":return NaN}},stringify:function(n){if("number"==typeof n)return 1/n==-1/0?"-0":n===1/0?"Inf":n===-1/0?"-Inf":isNaN(n)?"NaN":void 0}}}function u(n){var r=n&&n.out;return{name:"hex",parse:function(n){if(/^0x[0-9A-Fa-f]+$/.test(n))return parseInt(n,16)},stringify:function(n){if(r&&Number.isInteger(n))return"0x"+n.toString(16)}}}function f(){return{name:"date",parse:function(n){if(/^\d{4}-\d{2}-\d{2}$/.test(n)||/^\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}(?:.\d+)(?:Z|[+-]\d{2}:\d{2})$/.test(n)){var r=Date.parse(n);if(!isNaN(r))return new Date(r)}},stringify:function(n){if("[object Date]"===Object.prototype.toString.call(n)){var r=n.toISOString();return-1!==r.indexOf("T00:00:00.000Z",r.length-14)?r.substr(0,10):r}}}}s.description="support for Inf/inf, -Inf/-inf, Nan/naN and -0",u.description="parse hexadecimal numbers prefixed with 0x",f.description="support ISO dates",r.exports={loadDsf:t,std:{math:s,hex:u,date:f}}},{}],4:[function(n,r,e){"use strict";r.exports=function(r,e){function t(){j=0,w=" "}function o(n){return"{"===n||"}"===n||"["===n||"]"===n||","===n||":"===n}function i(n){var r,e=0,t=1;for(r=j-1;r>0&&"\n"!==b[r];r--,e++);for(;r>0;r--)"\n"===b[r]&&t++;throw new Error(n+" at line "+t+","+e+" >>>"+b.substr(j-e,20)+" ...")}function a(){return w=b.charAt(j),j++,w}function s(n){return b.charAt(j+n)}function u(n){for(var r="",e=w;a();){if(w===e)return a(),n&&"'"===e&&"'"===w&&0===r.length?(a(),f()):r;if("\\"===w)if(a(),"u"===w){for(var t=0,o=0;o<4;o++){a();var s,u=w.charCodeAt(0);w>="0"&&w<="9"?s=u-48:w>="a"&&w<="f"?s=u-97+10:w>="A"&&w<="F"?s=u-65+10:i("Bad \\u char "+w),t=16*t+s}r+=String.fromCharCode(t)}else{if("string"!=typeof C[w])break;r+=C[w]}else"\n"===w||"\r"===w?i("Bad string containing newline"):r+=w}i("Bad string")}function f(){function n(){for(var n=t;w&&w<=" "&&"\n"!==w&&n-- >0;)a()}for(var r="",e=0,t=0;;){var o=s(-t-5);if(!o||"\n"===o)break;t++}for(;w&&w<=" "&&"\n"!==w;)a();for("\n"===w&&(a(),n());;){if(w){if("'"===w){if(e++,a(),3===e)return"\n"===r.slice(-1)&&(r=r.slice(0,-1)),r;continue}for(;e>0;)r+="'",e--}else i("Bad multiline string");"\n"===w?(r+="\n",a(),n()):("\r"!==w&&(r+=w),a())}}function c(){if('"'===w||"'"===w)return u(!1);for(var n="",r=j,e=-1;;){if(":"===w)return n?e>=0&&e!==n.length&&(j=r+e,i("Found whitespace in your key name (use quotes to include)")):i("Found ':' but no key name (for an empty key name use quotes)"),n;w<=" "?w?e<0&&(e=n.length):i("Found EOF while looking for a key name (check your syntax)"):o(w)?i("Found '"+w+"' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace)"):n+=w,a()}}function l(){for(;w;){for(;w&&w<=" ";)a();if("#"===w||"/"===w&&"/"===s(0))for(;w&&"\n"!==w;)a();else{if("/"!==w||"*"!==s(0))break;for(a(),a();w&&("*"!==w||"/"!==s(0));)a();w&&(a(),a())}}}function h(){var n=w;for(o(w)&&i("Found a punctuator character '"+w+"' when expecting a quoteless string (check your syntax)");;){a();var r="\r"===w||"\n"===w||""===w;if(r||","===w||"}"===w||"]"===w||"#"===w||"/"===w&&("/"===s(0)||"*"===s(0))){var e=n[0];switch(e){case"f":if("false"===n.trim())return!1;break;case"n":if("null"===n.trim())return null;break;case"t":if("true"===n.trim())return!0;break;default:if("-"===e||e>="0"&&e<="9"){var t=k.tryParseNumber(n);if(void 0!==t)return t}}if(r){n=n.trim();var u=O(n);return void 0!==u?u:n}}n+=w}}function p(n,r){var e;for(n--,e=j-2;e>n&&b[e]<=" "&&"\n"!==b[e];e--);"\n"===b[e]&&e--,"\r"===b[e]&&e--;var t=b.substr(n,e-n+1);for(e=0;e<t.length;e++)if(t[e]>" "){var o=t.indexOf("\n");if(o>=0){var i=[t.substr(0,o),t.substr(o+1)];return r&&0===i[0].trim().length&&i.shift(),i}return[t]}return[]}function m(n){function r(n,e){var t,o,i,a;switch(typeof n){case"string":n.indexOf(e)>=0&&(a=n);break;case"object":if("[object Array]"===Object.prototype.toString.apply(n))for(t=0,i=n.length;t<i;t++)a=r(n[t],e)||a;else for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&(a=r(n[o],e)||a)}return a}function e(e){var t=r(n,e);return t?"found '"+e+"' in a string value, your mistake could be with:\n > "+t+"\n (unquoted strings contain everything up to the next line!)":""}return e("}")||e("]")}function d(){var n,r,e,t=[];try{if(x&&(n=k.createComment(t,{a:[]})),a(),r=j,l(),n&&(e=p(r,!0).join("\n")),"]"===w)return a(),n&&(n.e=[e]),t;for(;w;){if(t.push(v()),r=j,l(),","===w&&(a(),r=j,l()),n){var o=p(r);n.a.push([e||"",o[0]||""]),e=o[1]}if("]"===w)return a(),n&&(n.a[n.a.length-1][1]+=e||""),t;l()}i("End of input while parsing an array (missing ']')")}catch(n){throw n.hint=n.hint||m(t),n}}function g(n){var r,e,t,o="",s={};try{if(x&&(r=k.createComment(s,{c:{},o:[]})),n?e=1:(a(),e=j),l(),r&&(t=p(e,!0).join("\n")),"}"===w&&!n)return r&&(r.e=[t]),a(),s;for(;w;){if(o=c(),l(),":"!==w&&i("Expected ':' instead of '"+w+"'"),a(),s[o]=v(),e=j,l(),","===w&&(a(),e=j,l()),r){var u=p(e);r.c[o]=[t||"",u[0]||""],t=u[1],r.o.push(o)}if("}"===w&&!n)return a(),r&&(r.c[o][1]+=t||""),s;l()}if(n)return s;i("End of input while parsing an object (missing '}')")}catch(n){throw n.hint=n.hint||m(s),n}}function v(){switch(l(),w){case"{":return g();case"[":return d();case"'":case'"':return u(!0);default:return h()}}function y(n,r){var e=j;if(l(),w&&i("Syntax error, found trailing characters"),x){var t=r.join("\n"),o=p(e).join("\n");if(o||t){k.createComment(n,k.getComment(n)).r=[t,o]}}return n}var b,j,w,x,O,k=n("./hjson-common"),E=n("./hjson-dsf"),C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};if("string"!=typeof r)throw new Error("source is not a string");var q=null,S=!0;return e&&"object"==typeof e&&(x=e.keepWsc,q=e.dsf,S=!1!==e.legacyRoot),O=E.loadDsf(q,"parse"),b=r,t(),S?function(){l();var n=x?p(1):null;switch(w){case"{":return y(g(),n);case"[":return y(d(),n)}try{return y(g(!0),n)}catch(r){t();try{return y(v(),n)}catch(n){throw r}}}():function(){l();var n=x?p(1):null;switch(w){case"{":return y(g(),n);case"[":return y(d(),n);default:return y(v(),n)}}()}},{"./hjson-common":2,"./hjson-dsf":3}],5:[function(n,r,e){"use strict";r.exports=function(r,e){function t(n,r){return L+=n[0].length+n[1].length-n[2]-n[3],n[0]+r+n[1]}function o(n){return n.replace(N,function(n){var r=A[n];return"string"==typeof r?t(O.esc,r):t(O.uni,("0000"+n.charCodeAt(0).toString(16)).slice(-4))})}function i(n,r,e,i){return n?(I.lastIndex=0,F.lastIndex=0,v||e||I.test(n)||void 0!==f.tryParseNumber(n,!0)||F.test(n)?(N.lastIndex=0,_.lastIndex=0,N.test(n)?_.test(n)||i||!b?t(O.qstr,o(n)):a(n,r):t(O.qstr,n)):t(O.str,n)):t(O.qstr,"")}function a(n,r){var e,o=n.replace(/\r/g,"").split("\n");if(r+=p,1===o.length)return t(O.mstr,o[0]);var i=h+r+O.mstr[0];for(e=0;e<o.length;e++)i+=h,o[e]&&(i+=r+o[e]);return i+h+r+O.mstr[1]}function s(n){return n?g||P.test(n)?(N.lastIndex=0,t(O.qkey,N.test(n)?o(n):n)):t(O.key,n):'""'}function u(n,r,e,o){function a(n){return n&&"\n"===n["\r"===n[0]?1:0]}function c(n){return n&&!a(n)}function l(n,r,e){if(!n)return"";n=f.forceComment(n);var o,i=n.length;for(o=0;o<i&&n[o]<=" ";o++);return e&&o>0&&(n=n.substr(o)),o<i?r+t(O.rem,n):n}var g=q(n);if(void 0!==g)return t(O.dsf,g);switch(typeof n){case"string":return i(n,D,r,o);case"number":return isFinite(n)?t(O.num,String(n)):t(O.lit,"null");case"boolean":return t(O.lit,String(n));case"object":if(!n)return t(O.lit,"null");var w;m&&(w=f.getComment(n));var k="[object Array]"===Object.prototype.toString.apply(n),E=D;D+=p;var C,S,N,I,_,F,A,P,M,T,$=h+E,R=h+D,B=e||d?"":$,W=[],U=y?[]:null,Z=v,H=b,z=j?"":O.com[0],G=0;if(k){for(S=0,N=n.length;S<N;S++){if(C=S<N-1,w?(A=w.a[S]||[],P=c(A[1]),W.push(l(A[0],"\n")+R),U&&(A[0]||A[1]||P)&&(U=null)):W.push(R),L=0,_=n[S],W.push(u(_,!!w&&P,!0)+(C?j:"")),U){switch(typeof _){case"string":L=0,v=!0,b=0,U.push(u(_,!1,!0)+(C?O.com[0]:"")),v=Z,b=H;break;case"object":if(_){U=null;break}default:U.push(W[W.length-1]+(C?z:""))}C&&(L+=O.com[0].length-O.com[2]),G+=L}w&&A[1]&&W.push(l(A[1],P?" ":"\n",P))}0===N?w&&w.e&&W.push(l(w.e[0],"\n")+$):W.push($),0===W.length?M=t(O.arr,""):(M=B+t(O.arr,W.join("")),U&&(T=U.join(" "),T.length-G<=y&&(M=t(O.arr,T))))}else{var J=w?w.o.slice():[],K=[];for(I in n)Object.prototype.hasOwnProperty.call(n,I)&&K.indexOf(I)<0&&K.push(I);x&&K.sort();var Q=J.concat(K);for(S=0,N=Q.length;S<N;S++)if(C=S<N-1,I=Q[S],w?(A=w.c[I]||[],P=c(A[1]),W.push(l(A[0],"\n")+R),U&&(A[0]||A[1]||P)&&(U=null)):W.push(R),L=0,_=n[I],F=u(_,w&&P),W.push(s(I)+O.col[0]+(a(F)?"":" ")+F+(C?j:"")),w&&A[1]&&W.push(l(A[1],P?" ":"\n",P)),U){switch(typeof _){case"string":L=0,v=!0,b=0,F=u(_,!1),v=Z,b=H,U.push(s(I)+O.col[0]+" "+F+(C?O.com[0]:""));break;case"object":if(_){U=null;break}default:U.push(W[W.length-1]+(C?z:""))}L+=O.col[0].length-O.col[2],C&&(L+=O.com[0].length-O.com[2]),G+=L}0===N?w&&w.e&&W.push(l(w.e[0],"\n")+$):W.push($),0===W.length?M=t(O.obj,""):(M=B+t(O.obj,W.join("")),U&&(T=U.join(" "),T.length-G<=y&&(M=t(O.obj,T))))}return D=E,M}}var f=n("./hjson-common"),c=n("./hjson-dsf"),l={obj:["{","}"],arr:["[","]"],key:["",""],qkey:['"','"'],col:[":",""],com:[",",""],str:["",""],qstr:['"','"'],mstr:["'''","'''"],num:["",""],lit:["",""],dsf:["",""],esc:["\\",""],uni:["\\u",""],rem:["",""]},h=f.EOL,p=" ",m=!1,d=!1,g=!1,v=!1,y=0,b=1,j="",w=null,x=!1,O=l;if(e&&"object"==typeof e){e.quotes="always"===e.quotes?"strings":e.quotes,"\n"!==e.eol&&"\r\n"!==e.eol||(h=e.eol),m=e.keepWsc,y=e.condense||0,d=e.bracesSameLine,g="all"===e.quotes||"keys"===e.quotes,v="all"===e.quotes||"strings"===e.quotes||!0===e.separator,b=v||"off"==e.multiline?0:"no-tabs"==e.multiline?2:1,j=!0===e.separator?O.com[0]:"",w=e.dsf,x=e.sortProps,"number"==typeof e.space?p=new Array(e.space+1).join(" "):"string"==typeof e.space&&(p=e.space),!0===e.colors&&(O={obj:["[37m{[0m","[37m}[0m"],arr:["[37m[[0m","[37m][0m"],key:["[33m","[0m"],qkey:['[33m"','"[0m'],col:["[37m:[0m",""],com:["[37m,[0m",""],str:["[37;1m","[0m"],qstr:['[37;1m"','"[0m'],mstr:["[37;1m'''","'''[0m"],num:["[36;1m","[0m"],lit:["[36m","[0m"],dsf:["[37m","[0m"],esc:["[31m\\","[0m"],uni:["[31m\\u","[0m"],rem:["[35m","[0m"]});var k,E=Object.keys(l);for(k=E.length-1;k>=0;k--){var C=E[k];O[C].push(l[C][0].length,l[C][1].length)}}var q,S="--឴឵-\u2028- -\ufeff-",N=new RegExp('[\\\\\\"\0-'+S+"]","g"),I=new RegExp("^\\s|^\"|^'|^#|^\\/\\*|^\\/\\/|^\\{|^\\}|^\\[|^\\]|^:|^,|\\s$|[\0-"+S+"]","g"),_=new RegExp("'''|^[\\s]+$|[\0-"+(2===b?"\t":"\b")+"\v\f-"+S+"]","g"),F=new RegExp("^(true|false|null)\\s*((,|\\]|\\}|#|//|/\\*).*)?$"),A={"\b":"b","\t":"t","\n":"n","\f":"f","\r":"r",'"':'"',"\\":"\\"},P=/[,\{\[\}\]\s:#"']|\/\/|\/\*/,D="",L=0;q=c.loadDsf(w,"stringify");var M="",T=m?T=(f.getComment(r)||{}).r:null;return T&&T[0]&&(M=T[0]+"\n"),M+=u(r,null,!0,!0),T&&(M+=T[1]||""),M}},{"./hjson-common":2,"./hjson-dsf":3}],6:[function(n,r,e){r.exports="3.2.0"},{}],7:[function(n,r,e){/*! | ||
* Hjson v3.2.0 | ||
* http://hjson.org | ||
@@ -24,2 +24,2 @@ * | ||
*/ | ||
"use strict";var t=n("./hjson-common"),o=n("./hjson-version"),i=n("./hjson-parse"),a=n("./hjson-stringify"),u=n("./hjson-comments"),s=n("./hjson-dsf");e.exports={parse:i,stringify:a,endOfLine:function(){return t.EOL},setEndOfLine:function(n){"\n"!==n&&"\r\n"!==n||(t.EOL=n)},version:o,rt:{parse:function(n,e){return(e=e||{}).keepWsc=!0,i(n,e)},stringify:function(n,e){return(e=e||{}).keepWsc=!0,a(n,e)}},comments:u,dsf:s.std}},{"./hjson-comments":1,"./hjson-common":2,"./hjson-dsf":3,"./hjson-parse":4,"./hjson-stringify":5,"./hjson-version":6}],8:[function(n,e,r){},{}]},{},[7])(7)}); | ||
"use strict";var t=n("./hjson-common"),o=n("./hjson-version"),i=n("./hjson-parse"),a=n("./hjson-stringify"),s=n("./hjson-comments"),u=n("./hjson-dsf");r.exports={parse:i,stringify:a,endOfLine:function(){return t.EOL},setEndOfLine:function(n){"\n"!==n&&"\r\n"!==n||(t.EOL=n)},version:o,rt:{parse:function(n,r){return(r=r||{}).keepWsc=!0,i(n,r)},stringify:function(n,r){return(r=r||{}).keepWsc=!0,a(n,r)}},comments:s,dsf:u.std}},{"./hjson-comments":1,"./hjson-common":2,"./hjson-dsf":3,"./hjson-parse":4,"./hjson-stringify":5,"./hjson-version":6}],8:[function(n,r,e){},{}]},{},[7])(7)}); |
# hjson-js History | ||
- v3.2.0 | ||
- add option to serializeDeterministically | ||
- v3.1.1 | ||
@@ -4,0 +6,0 @@ - set exit code for cli tool |
@@ -38,2 +38,3 @@ /* Hjson http://hjson.org */ | ||
var dsfDef = null; | ||
var sortProps = false; | ||
var token = plainToken; | ||
@@ -54,2 +55,3 @@ | ||
dsfDef = opt.dsf; | ||
sortProps = opt.sortProps; | ||
@@ -317,7 +319,12 @@ // If the space parameter is a number, make an indent string containing that | ||
// Otherwise, iterate through all of the keys in the object. | ||
var keys = comments ? comments.o.slice() : []; | ||
var commentKeys = comments ? comments.o.slice() : []; | ||
var objectKeys = []; | ||
for (k in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, k) && keys.indexOf(k) < 0) | ||
keys.push(k); | ||
if (Object.prototype.hasOwnProperty.call(value, k) && objectKeys.indexOf(k) < 0) | ||
objectKeys.push(k); | ||
} | ||
if(sortProps) { | ||
objectKeys.sort(); | ||
} | ||
var keys = commentKeys.concat(objectKeys); | ||
@@ -324,0 +331,0 @@ for (i = 0, length = keys.length; i < length; i++) { |
@@ -1,1 +0,1 @@ | ||
module.exports="3.1.2"; | ||
module.exports="3.2.0"; |
/*! | ||
* Hjson v3.1.2 | ||
* Hjson v3.2.0 | ||
* http://hjson.org | ||
@@ -80,2 +80,6 @@ * | ||
obsolete: will always emit braces | ||
sortProps | ||
When serializing objects into hjson, order the keys based on | ||
their UTF-16 code units order | ||
} | ||
@@ -82,0 +86,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"author": "Christian Zangl", | ||
"version": "3.1.2", | ||
"version": "3.2.0", | ||
"keywords": [ | ||
@@ -9,0 +9,0 @@ "json", |
@@ -129,2 +129,3 @@ # hjson-js | ||
- *colors*: boolean, output ascii color codes | ||
- *serializeDeterministically*: boolean, when serializing objects into hjson, order the keys based on their UTF-16 code units order. Default false. | ||
@@ -131,0 +132,0 @@ ### Hjson.endOfLine(), .setEndOfLine(eol) |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
122626
2640
175
0