Skip to content

Commit

Permalink
build: lint/code-style fixes only
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Nov 5, 2020
1 parent a173d54 commit 570892a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": "off",
"keyword-spacing": "error",
"line-comment-position": "off",
"linebreak-style": [
"error",
Expand Down
4 changes: 2 additions & 2 deletions lib/jsonTrunc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function shallow_copy(v){
if (Array.isArray(v))
return v.slice()
let copy={} // prepares a shallow copy of v where getters are not evaluated
for(const prop of Object.getOwnPropertyNames(v))
for (const prop of Object.getOwnPropertyNames(v))
{
let desc=Object.getOwnPropertyDescriptor(v,prop)
Object.defineProperty(copy,prop,desc.get?{value:getter_trunc,enumerable:true}:desc)
Expand Down Expand Up @@ -70,7 +70,7 @@ function stringifyTrunc(value,replacer,indent,options){
}

function insert(k,v){ // handler h and array a globally defined in replace and stringifyTrunc, respectively; return false iff node has not been inserted because of truncation
while(a.length>0){
while (a.length>0) {
let top=a[a.length-1]
if (is_child(v,top,k)) {
h.add_visited(top,k) // update visited children
Expand Down
2 changes: 1 addition & 1 deletion test/jsonTrunc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ console.assert(stringifyTrunc([1,[2],[[3]],[[[4]]],[[[[5]]]]],{depth:4})==='[1,[
console.assert(stringifyTrunc([1,[2],[[3]],[[[4]]],[[[[5]]]]],{depth:5})==='[1,[2],[[3]],[[[4]]],[[[[5]]]]]')

let inner=Symbol('Inner')
o={get val(){return this[inner]}, set val(v){if(v<0) throw new Error("Illegal argument"); this[inner]=v}}
o={get val(){return this[inner]}, set val(v){if (v<0) throw new Error("Illegal argument"); this[inner]=v}}
o[inner]=42

console.assert(stringifyTrunc(o)==='{"val":"[Getter]"}')
Expand Down
2 changes: 1 addition & 1 deletion widdershins.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function doit(s) {
try {
api = yaml.parse(s);
}
catch(ex) {
catch (ex) {
console.error('Failed to parse YAML/JSON, falling back to API Blueprint');
console.error(ex.message);
api = s;
Expand Down

0 comments on commit 570892a

Please sign in to comment.