src/iso2709.js
function parseDirectory(dataStr) {
		let currChar = '';
		let directory = '';
		let pos = 24;

		while (currChar !== '\x1E') {
			currChar = dataStr.charAt(pos);
			if (currChar !== 'x1E') {
				directory += currChar;
			}

			pos++;

			if (pos > dataStr.length) {
				throw new Error('Invalid record');
			}
		}

		return directory;
	}
function parseDirectory(dataStr) {
		let currChar = '';
		let directory = '';
		let pos = 24;

		while (currChar !== '\x1E') {
			currChar = dataStr.charAt(pos);
			if (currChar !== 'x1E') {
				directory += currChar;
			}

			pos++;

			if (pos > dataStr.length) {
				throw new Error('Invalid record');
			}
		}

		return directory;
	}
function parseDirectory ( dataStr ) { let currChar = '' ; let directory = '' ; let pos = 24 ; while ( currChar !== '\x1E' ) { currChar = dataStr . charAt ( pos ) ; if ( currChar !== 'x1E' ) { directory += currChar ; } pos ++ ; if ( pos > dataStr . length ) { throw new Error ( 'Invalid record' ) ; } } return directory ; }
Returns the entire directory starting at position 24. Control character '\x1E' marks the end of directory.
Returns the entire directory starting at position 24 . Control character \ x1E marks the end of directory .