1- ' use strict' ;
1+ " use strict" ;
22
3- var $Ref = require ( ' ./ref' ) ,
4- Pointer = require ( ' ./pointer' ) ,
5- url = require ( ' ./util/url' ) ;
3+ var $Ref = require ( " ./ref" ) ,
4+ Pointer = require ( " ./pointer" ) ,
5+ url = require ( " ./util/url" ) ;
66
77module . exports = bundle ;
88
@@ -19,7 +19,7 @@ function bundle (parser, options) {
1919
2020 // Build an inventory of all $ref pointers in the JSON Schema
2121 var inventory = [ ] ;
22- crawl ( parser , ' schema' , parser . $refs . _root$Ref . path + '#' , '#' , 0 , inventory , parser . $refs , options ) ;
22+ crawl ( parser , " schema" , parser . $refs . _root$Ref . path + "#" , "#" , 0 , inventory , parser . $refs , options ) ;
2323
2424 // Remap all $ref pointers
2525 remap ( inventory ) ;
@@ -39,7 +39,7 @@ function bundle (parser, options) {
3939function crawl ( parent , key , path , pathFromRoot , indirections , inventory , $refs , options ) {
4040 var obj = key === null ? parent : parent [ key ] ;
4141
42- if ( obj && typeof obj === ' object' ) {
42+ if ( obj && typeof obj === " object" ) {
4343 if ( $Ref . isAllowed$Ref ( obj ) ) {
4444 inventory$Ref ( parent , key , path , pathFromRoot , indirections , inventory , $refs , options ) ;
4545 }
@@ -51,10 +51,10 @@ function crawl (parent, key, path, pathFromRoot, indirections, inventory, $refs,
5151 . sort ( function ( a , b ) {
5252 // Most people will expect references to be bundled into the the "definitions" property,
5353 // so we always crawl that property first, if it exists.
54- if ( a === ' definitions' ) {
54+ if ( a === " definitions" ) {
5555 return - 1 ;
5656 }
57- else if ( b === ' definitions' ) {
57+ else if ( b === " definitions" ) {
5858 return 1 ;
5959 }
6060 else {
@@ -186,8 +186,8 @@ function remap (inventory) {
186186 else {
187187 // Determine how far each $ref is from the "definitions" property.
188188 // Most people will expect references to be bundled into the the "definitions" property if possible.
189- var aDefinitionsIndex = a . pathFromRoot . lastIndexOf ( ' /definitions' ) ;
190- var bDefinitionsIndex = b . pathFromRoot . lastIndexOf ( ' /definitions' ) ;
189+ var aDefinitionsIndex = a . pathFromRoot . lastIndexOf ( " /definitions" ) ;
190+ var bDefinitionsIndex = b . pathFromRoot . lastIndexOf ( " /definitions" ) ;
191191
192192 if ( aDefinitionsIndex !== bDefinitionsIndex ) {
193193 // Give higher priority to the $ref that's closer to the "definitions" property
@@ -212,9 +212,9 @@ function remap (inventory) {
212212 // This $ref points to the same value as the prevous $ref, so remap it to the same path
213213 entry . $ref . $ref = pathFromRoot ;
214214 }
215- else if ( entry . file === file && entry . hash . indexOf ( hash + '/' ) === 0 ) {
215+ else if ( entry . file === file && entry . hash . indexOf ( hash + "/" ) === 0 ) {
216216 // This $ref points to a sub-value of the prevous $ref, so remap it beneath that path
217- entry . $ref . $ref = Pointer . join ( pathFromRoot , Pointer . parse ( entry . hash . replace ( hash , '#' ) ) ) ;
217+ entry . $ref . $ref = Pointer . join ( pathFromRoot , Pointer . parse ( entry . hash . replace ( hash , "#" ) ) ) ;
218218 }
219219 else {
220220 // We've moved to a new file or new hash
0 commit comments