id
stringlengths
1
6
tokens
sequence
labels
sequence
661900
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "const", "t", "=", "assert", ";", "const", "samplePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ")", ";", "describe", "(", "\"Decode MP3/ID3v2.4\"", ",", "(", ")", "=>", "{", "it", "(", "\"should decode id3v2.4\"", ",", "(", ")", "=>", "{", "const", "filename", "=", "'id3v2.4.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ",", "{", "duration", ":", "true", "}", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "format", ".", "tagTypes", ",", "[", "\"ID3v2.4\"", ",", "\"ID3v1\"", "]", ",", "'format.tagTypes'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "duration", ",", "0.7836734693877551", ",", "'format.format.duration'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate = 44.1 kHz'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "bitrate", ",", "128000", ",", "'format.bitrate = 128 kbit/sec'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "codecProfile", ",", "'CBR'", ",", "'format.codecProfile = CBR'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "container", ",", "'MPEG'", ",", "'format.container'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "codec", ",", "'MPEG 1 Layer 3'", ",", "'format.codec'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "tool", ",", "'LAME 3.98r'", ",", "'format.tool'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels = 2'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "title", ",", "'Home'", ",", "'title'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "artist", ",", "'Explo'", ",", "'common.artist'", ")", ";", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "artists", ",", "[", "'Explo'", ",", "'ions'", ",", "'nodejsftws'", "]", ",", "'common.artists'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "albumartist", ",", "'Soundtrack'", ",", "'albumartist'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "album", ",", "'Friday Night Lights [Original Movie Soundtrack]'", ",", "'album'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "year", ",", "2004", ",", "'year'", ")", ";", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "track", ",", "{", "no", ":", "5", ",", "of", ":", "null", "}", ",", "'common.track'", ")", ";", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "disk", ",", "{", "no", ":", "1", ",", "of", ":", "1", "}", ",", "'common.disk'", ")", ";", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "genre", ",", "[", "'Soundtrack'", ",", "'OST'", "]", ",", "'common.genres'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "picture", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'common.picture 0 format'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "picture", "[", "0", "]", ".", "data", ".", "length", ",", "80938", ",", "'common.picture 0 length'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "picture", "[", "1", "]", ".", "format", ",", "'image/jpeg'", ",", "'common.picture 1 format'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "picture", "[", "1", "]", ".", "data", ".", "length", ",", "80938", ",", "'common.picture 1 length'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'COMM mapping'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'mp3'", ",", "'issue-502.mp3'", ")", ";", "const", "{", "common", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "comment", ",", "[", "'CLEAN'", "]", ",", "'common.comment'", ")", ";", "}", ")", ";", "it", "(", "\"should respect skipCovers-flag\"", ",", "(", ")", "=>", "{", "const", "filename", "=", "'id3v2.4.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ",", "{", "duration", ":", "true", ",", "skipCovers", ":", "true", "}", ")", ".", "then", "(", "result", "=>", "{", "t", ".", "isUndefined", "(", "result", ".", "common", ".", "picture", ",", "'common.picture should be undefined'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "\"Map TXXX:ISRC\"", ",", "async", "(", ")", "=>", "{", "const", "filename", "=", "'issue-802.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'mp3'", ",", "filename", ")", ";", "const", "{", "common", ",", "native", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "const", "id3v24", "=", "native", "[", "'ID3v2.4'", "]", ";", "t", ".", "isDefined", "(", "id3v24", ",", "'ID3v2.4 presence'", ")", ";", "t", ".", "strictEqual", "(", "id3v24", ".", "filter", "(", "tag", "=>", "{", "return", "tag", ".", "id", "===", "'TSRC'", ";", "}", ")", ".", "length", ",", "0", ",", "'ID3v2.4 tag TSRC not defined'", ")", ";", "t", ".", "strictEqual", "(", "id3v24", ".", "filter", "(", "tag", "=>", "{", "return", "tag", ".", "id", "===", "'TXXX:ISRC'", ";", "}", ")", ".", "length", ",", "1", ",", "'ID3v2.4 tag TXXX:ISRC to be defined'", ")", ";", "t", ".", "includeDeepMembers", "(", "common", ".", "isrc", ",", "[", "'DEAE61300058'", "]", ",", "'ISRC'", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661901
[ "import", "*", "as", "path", "from", "'path'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "{", "assert", "}", "from", "'chai'", ";", "const", "issueDir", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ")", ";", "describe", "(", "'Merge tag headers'", ",", "(", ")", "=>", "{", "/**\n * issue_77_empty_tag.mp3 (metadata of: 'Like Spinning Plates (Live)'):\n * Has an empty ID3v2.3 tag and a ID3v1 tag.\n */", "it", "(", "'should ignore empty tag headers'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "path", ".", "join", "(", "issueDir", ",", "'issue_77_empty_tag.mp3'", ")", ")", ";", "assert", ".", "strictEqual", "(", "metadata", ".", "common", ".", "title", ",", "'Like Spinning Plates (Live)'", ")", ";", "assert", ".", "strictEqual", "(", "metadata", ".", "common", ".", "album", ",", "'I Might Be Wrong'", ")", ";", "assert", ".", "strictEqual", "(", "metadata", ".", "common", ".", "artist", ",", "'Radiohead'", ")", ";", "}", ")", ";", "describe", "(", "'mergeTagHeaders option'", ",", "(", ")", "=>", "{", "const", "testSample", "=", "path", ".", "join", "(", "issueDir", ",", "'Dethklok-mergeTagHeaders.mp3'", ")", ";", "/**\n * About the sample:\n * - Has ID3v1 and ID3v2.4 tag headers.\n * - Album is set in ID3v1 but not in ID3v2.4\n * - Artist in ID3v1 is different than in ID3v2.4\n */", "it", "(", "'should merge multiple headers information when true'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "testSample", ")", ";", "const", "id3v24", "=", "metadata", ".", "native", "[", "'ID3v2.4'", "]", ";", "const", "id3v11", "=", "metadata", ".", "native", ".", "ID3v1", ";", "const", "expectedAlbum", "=", "id3v11", ".", "filter", "(", "tag", "=>", "tag", ".", "id", "===", "'album'", ")", ".", "pop", "(", ")", ".", "value", ";", "const", "expectedArtist", "=", "id3v24", ".", "filter", "(", "tag", "=>", "tag", ".", "id", "===", "'TPE1'", ")", ".", "pop", "(", ")", ".", "value", ";", "assert", ".", "strictEqual", "(", "metadata", ".", "common", ".", "album", ",", "expectedAlbum", ")", ";", "assert", ".", "strictEqual", "(", "metadata", ".", "common", ".", "artist", ",", "expectedArtist", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661902
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mime", "from", "'mime'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "{", "SourceStream", "}", "from", "'./util'", ";", "import", "*", "as", "fs", "from", "'fs'", ";", "import", "*", "as", "path", "from", "'path'", ";", "const", "t", "=", "assert", ";", "describe", "(", "'MIME & extension mapping'", ",", "(", ")", "=>", "{", "const", "samplePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ")", ";", "const", "buf", "=", "Buffer", ".", "alloc", "(", "30", ")", ".", "fill", "(", "0", ")", ";", "const", "audioExtension", "=", "[", "'.aac'", ",", "'.mp3'", ",", "'.ogg'", ",", "'.wav'", ",", "'.flac'", ",", "'.m4a'", "]", ";", "function", "handleError", "(", "extension", ",", "err", ")", "{", "switch", "(", "extension", ")", "{", "case", "'.aac'", ":", "case", "'.m4a'", ":", "case", "'.flac'", ":", "case", "'.wav'", ":", "case", "'.ogg'", ":", "t", ".", "ok", "(", "err", ".", "message", ".", "startsWith", "(", "'FourCC'", ")", ",", "`Only FourCC error allowed, got: ${", "err", ".", "message", "}`", ")", ";", "break", ";", "default", ":", "throw", "new", "Error", "(", "'caught error parsing '", "+", "extension", "+", "': '", "+", "err", ".", "message", ")", ";", "}", "}", "it", "(", "'should reject an unknown file'", ",", "(", ")", "=>", "{", "return", "mm", ".", "parseFile", "(", "path", ".", "join", "(", "__dirname", ",", "'..'", ",", "'package.json'", ")", ")", ".", "then", "(", "(", ")", "=>", "t", ".", "fail", "(", "'Should reject extension'", ")", ")", ".", "catch", "(", "err", "=>", "{", "t", ".", "strictEqual", "(", "err", ".", "message", ",", "'Failed to determine audio format'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'should map MIME-types'", ",", "(", ")", "=>", "{", "return", "Promise", ".", "all", "(", "audioExtension", ".", "map", "(", "extension", "=>", "{", "const", "streamReader", "=", "new", "SourceStream", "(", "buf", ")", ";", "const", "mimeType", "=", "mime", ".", "getType", "(", "extension", ")", ";", "t", ".", "isNotNull", "(", "mimeType", ",", "'extension: '", "+", "extension", ")", ";", "const", "res", "=", "mm", ".", "parseStream", "(", "streamReader", ",", "mimeType", ")", ".", "catch", "(", "err", "=>", "{", "handleError", "(", "extension", ",", "err", ")", ";", "}", ")", ";", "return", "res", ";", "}", ")", ")", ";", "}", ")", ";", "it", "(", "'should map on extension as well'", ",", "(", ")", "=>", "{", "const", "prom", "=", "[", "]", ";", "audioExtension", ".", "forEach", "(", "extension", "=>", "{", "const", "streamReader", "=", "new", "SourceStream", "(", "buf", ")", ";", "const", "res", "=", "mm", ".", "parseStream", "(", "streamReader", ",", "{", "path", ":", "extension", "}", ")", ".", "catch", "(", "err", "=>", "{", "handleError", "(", "extension", ",", "err", ")", ";", "}", ")", ";", "prom", ".", "push", "(", "res", ")", ";", "}", ")", ";", "return", "Promise", ".", "all", "(", "prom", ")", ";", "}", ")", ";", "it", "(", "'should be able to handle MIME-type parameter(s)'", ",", "async", "(", ")", "=>", "{", "const", "buffer", "=", "fs", ".", "readFileSync", "(", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer [id3v2.3].wav'", ")", ")", ";", "const", "stream", "=", "new", "SourceStream", "(", "buffer", ")", ";", "const", "metadata", "=", "await", "mm", ".", "parseStream", "(", "stream", ")", ";", "assert", ".", "equal", "(", "metadata", ".", "format", ".", "container", ",", "'WAVE'", ")", ";", "}", ")", ";", "describe", "(", "'Resolve MIME based on content'", ",", "(", ")", "=>", "{", "it", "(", "'should fall back on content detection in case the extension is useless'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "path", ".", "join", "(", "samplePath", ",", "'mp3'", ",", "'1a643e9e0743dee8732554d0e870055a'", ")", ")", ";", "assert", ".", "equal", "(", "metadata", ".", "format", ".", "container", ",", "'MPEG'", ")", ";", "assert", ".", "equal", "(", "metadata", ".", "format", ".", "codec", ",", "'MPEG 1 Layer 3'", ")", ";", "}", ")", ";", "it", "(", "'should throw error on unrecognized MIME-type'", ",", "async", "(", ")", "=>", "{", "const", "streamReader", "=", "new", "SourceStream", "(", "buf", ")", ";", "try", "{", "await", "mm", ".", "parseStream", "(", "streamReader", ",", "{", "mimeType", ":", "'audio/not-existing'", "}", ")", ";", "assert", ".", "fail", "(", "'Should throw an Error'", ")", ";", "}", "catch", "(", "err", ")", "{", "assert", ".", "equal", "(", "err", ".", "message", ",", "'Failed to determine audio format'", ")", ";", "}", "}", ")", ";", "it", "(", "'should throw error on recognized MIME-type which is not supported'", ",", "async", "(", ")", "=>", "{", "const", "buffer", "=", "fs", ".", "readFileSync", "(", "path", ".", "join", "(", "samplePath", ",", "'flac.flac.jpg'", ")", ")", ";", "const", "stream", "=", "new", "SourceStream", "(", "buffer", ")", ";", "try", "{", "await", "mm", ".", "parseStream", "(", "stream", ",", "{", "mimeType", ":", "'audio/not-existing'", "}", ")", ";", "assert", ".", "fail", "(", "'Should throw an Error'", ")", ";", "}", "catch", "(", "err", ")", "{", "assert", ".", "equal", "(", "err", ".", "message", ",", "'Guessed MIME-type not supported: image/jpeg'", ")", ";", "}", "}", ")", ";", "async", "function", "testFileType", "(", "sample", ",", "container", ")", "{", "const", "stream", "=", "fs", ".", "createReadStream", "(", "path", ".", "join", "(", "samplePath", ",", "sample", ")", ")", ";", "const", "metadata", "=", "await", "mm", ".", "parseStream", "(", "stream", ")", ";", "stream", ".", "close", "(", ")", ";", "assert", ".", "equal", "(", "metadata", ".", "format", ".", "container", ",", "container", ")", ";", "}", "it", "(", "'should recognize MP2'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'1971 - 003 - Sweet - Co-Co - CannaPower.mp2'", ",", "'MPEG'", ")", ";", "}", ")", ";", "it", "(", "'should recognize MP3'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'04-Strawberry.mp3'", ",", "'MPEG'", ")", ";", "}", ")", ";", "it", "(", "'should recognize WMA'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'asf'", ",", "'asf.wma'", ")", ",", "'ASF/audio'", ")", ";", "}", ")", ";", "it", "(", "'should recognize MPEG-4 / m4a'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.m4a'", ",", "'M4A/mp42/isom'", ")", ";", "}", ")", ";", "it", "(", "'should recognize MPEG-4 / m4b'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'mp4'", ",", "'issue-127.m4b'", ")", ",", "'M4A/3gp5/isom'", ")", ";", "}", ")", ";", "it", "(", "'should recognize MPEG-4 / mp4'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'mp4'", ",", "'Mr. Pickles S02E07 My Dear Boy.mp4'", ")", ",", "'mp42/isom'", ")", ";", "}", ")", ";", "it", "(", "'should recognize FLAC'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'flac.flac'", ",", "'FLAC'", ")", ";", "}", ")", ";", "it", "(", "'should recognize OGG'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'issue_62.ogg'", ",", "'Ogg'", ")", ";", "}", ")", ";", "it", "(", "'should recognize WAV'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer [id3v2.3].wav'", ",", "'WAVE'", ")", ";", "}", ")", ";", "it", "(", "'should recognize APE'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.ape'", ",", "'Monkey\\'s Audio'", ")", ";", "}", ")", ";", "it", "(", "'should recognize WMA'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'asf'", ",", "'issue_57.wma'", ")", ",", "'ASF/audio'", ")", ";", "}", ")", ";", "it", "(", "'should recognize WavPack'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'wavpack'", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.wv'", ")", ",", "'WavPack'", ")", ";", "}", ")", ";", "it", "(", "'should recognize SV7'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'mpc'", ",", "'apev2.sv7.mpc'", ")", ",", "'Musepack, SV7'", ")", ";", "}", ")", ";", "it", "(", "'should recognize SV8'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'mpc'", ",", "'bach-goldberg-variatians-05.sv8.mpc'", ")", ",", "'Musepack, SV8'", ")", ";", "}", ")", ";", "it", "(", "'should recognize DSF'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'dsf'", ",", "'2L-110_stereo-5644k-1b_04_0.1-sec.dsf'", ")", ",", "'DSF'", ")", ";", "}", ")", ";", "it", "(", "'should recognize MKA'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'matroska'", ",", "'02 - Poxfil - Solid Ground (5 sec).mka'", ")", ",", "'EBML/matroska'", ")", ";", "}", ")", ";", "it", "(", "'should recognize WebM'", ",", "(", ")", "=>", "{", "return", "testFileType", "(", "path", ".", "join", "(", "'matroska'", ",", "'02 - Poxfil - Solid Ground (5 sec).opus.webm'", ")", ",", "'EBML/webm'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 25, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, 29905, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 2, null, null, null, 29905, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 29905, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 29905, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 29905, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, 2, null, null, null, 1027, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661903
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "it", "(", "'MusicBrains/Picard tags in FLAC'", ",", "async", "(", ")", "=>", "{", "const", "filename", "=", "'MusicBrainz-Picard-tags.flac'", ";", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "filename", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "assert", ".", "deepEqual", "(", "format", ".", "duration", ",", "271.7733333333333", ",", "'format.duration'", ")", ";", "assert", ".", "deepEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate'", ")", ";", "assert", ".", "deepEqual", "(", "format", ".", "bitsPerSample", ",", "16", ",", "'format.bitsPerSample'", ")", ";", "assert", ".", "deepEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels'", ")", ";", "}", "function", "checkCommonTags", "(", "common", ")", "{", "assert", ".", "deepEqual", "(", "common", ".", "title", ",", "'Brian Eno'", ",", "'common.tagtitle'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "artist", ",", "'MGMT'", ",", "'common.artist'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "artists", ",", "[", "'MGMT'", "]", ",", "'common.artist'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "albumartist", ",", "'MGMT'", ",", "'common.albumartist'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "album", ",", "'Oracular Spectacular / Congratulations'", ",", "'common.album'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "track", ",", "{", "no", ":", "7", ",", "of", ":", "9", "}", ",", "'common.track'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "disk", ",", "{", "no", ":", "2", ",", "of", ":", "2", "}", ",", "'common.disk'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "discsubtitle", ",", "'Cogratulations'", ",", "'common.discsubtitle'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "date", ",", "'2011-09-11'", ",", "'common.date'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "year", ",", "2011", ",", "'common.year'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "releasecountry", ",", "'XE'", ",", "'common.releasecountry'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "asin", ",", "'B0055U9LNC'", ",", "'common.asin'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "barcode", ",", "'886979357723'", ",", "'common.barcode'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "label", ",", "[", "'Sony Music'", "]", ",", "'common.label'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "catalognumber", ",", "[", "'88697935772'", "]", ",", "'common.catalognumber'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "originalyear", ",", "2011", ",", "'common.originalyear'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "originaldate", ",", "'2011-09-11'", ",", "'common.originaldate'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "releasestatus", ",", "'official'", ",", "'common.releasestatus'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "releasetype", ",", "[", "'album'", ",", "'compilation'", "]", ",", "'common.releasetype'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "comment", ",", "[", "'EAC-Secure Mode'", "]", ",", "'common.comment'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "genre", ",", "[", "'Alt. Rock'", "]", ",", "'common.genre'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "musicbrainz_albumid", ",", "'6032dfc4-8880-4fea-b1c0-aaee52e1113c'", ",", "'common.musicbrainz_albumid'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "musicbrainz_recordingid", ",", "'b0c1d984-ba93-4167-880a-ac02255bf9e7'", ",", "'common.musicbrainz_recordingid'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "musicbrainz_albumartistid", ",", "[", "'c485632c-b784-4ee9-8ea1-c5fb365681fc'", "]", ",", "'common.musicbrainz_albumartistid'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "musicbrainz_artistid", ",", "[", "'c485632c-b784-4ee9-8ea1-c5fb365681fc'", "]", ",", "'common.musicbrainz_artistid'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "musicbrainz_releasegroupid", ",", "'9a3237f4-c2a5-467f-9a8e-fe1d247ff520'", ",", "'common.musicbrainz_releasegroupid'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "musicbrainz_trackid", ",", "'0f53f7a3-89df-4069-9357-d04252239b6d'", ",", "'common.musicbrainz_trackid'", ")", ";", "assert", ".", "isDefined", "(", "common", ".", "picture", ",", "'common.picture'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "picture", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'picture format'", ")", ";", "assert", ".", "deepEqual", "(", "common", ".", "picture", "[", "0", "]", ".", "data", ".", "length", ",", "175668", ",", "'picture length'", ")", ";", "}", "function", "checkNativeTags", "(", "vorbis", ")", "{", "assert", ".", "deepEqual", "(", "vorbis", ".", "TITLE", ",", "[", "'Brian Eno'", "]", ",", "'vorbis: .TITLE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ARTIST", ",", "[", "'MGMT'", "]", ",", "'vorbis: artist'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ARTISTS", ",", "[", "'MGMT'", "]", ",", "'vorbis: artist'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ALBUMARTIST", ",", "[", "'MGMT'", "]", ",", "'vorbis: albumartist'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ALBUM", ",", "[", "'Oracular Spectacular / Congratulations'", "]", ",", "'vorbis: album'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "TRACKNUMBER", ",", "[", "'7'", "]", ",", "'vorbis: TRACK'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "TRACKTOTAL", ",", "[", "'9'", "]", ",", "'vorbis: TRACKTOTAL'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "DISCNUMBER", ",", "[", "'2'", "]", ",", "'vorbis: DISCNUMBER'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "DISCTOTAL", ",", "[", "'2'", "]", ",", "'vorbis: DISCTOTAL'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "DISCSUBTITLE", ",", "[", "'Cogratulations'", "]", ",", "'vorbis: DISCSUBTITLE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "DATE", ",", "[", "'2011-09-11'", "]", ",", "'vorbis: DATE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "RELEASECOUNTRY", ",", "[", "'XE'", "]", ",", "'vorbis: RELEASECOUNTRY'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ASIN", ",", "[", "'B0055U9LNC'", "]", ",", "'vorbis: ASIN'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "BARCODE", ",", "[", "'886979357723'", "]", ",", "'vorbis: BARCODE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "LABEL", ",", "[", "'Sony Music'", "]", ",", "'vorbis: LABEL'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "CATALOGNUMBER", ",", "[", "'88697935772'", "]", ",", "'vorbis: CATALOGNUMBER'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ORIGINALYEAR", ",", "[", "'2011'", "]", ",", "'vorbis: ORIGINALYEAR'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "ORIGINALDATE", ",", "[", "'2011-09-11'", "]", ",", "'vorbis: ORIGINALDATE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "RELEASESTATUS", ",", "[", "'official'", "]", ",", "'vorbis: RELEASESTATUS'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "RELEASETYPE", ",", "[", "'album'", ",", "'compilation'", "]", ",", "'vorbis: RELEASETYPE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "COMMENT", ",", "[", "'EAC-Secure Mode'", "]", ",", "'vorbis: COMMENT'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "GENRE", ",", "[", "'Alt. Rock'", "]", ",", "'vorbis: GENRE'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ALBUMID", ",", "[", "'6032dfc4-8880-4fea-b1c0-aaee52e1113c'", "]", ",", "'vorbis: MUSICBRAINZ_ALBUMID'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_TRACKID", ",", "[", "'b0c1d984-ba93-4167-880a-ac02255bf9e7'", "]", ",", "'vorbis: MUSICBRAINZ_RECORDINGID'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ALBUMARTISTID", ",", "[", "'c485632c-b784-4ee9-8ea1-c5fb365681fc'", "]", ",", "'vorbis: MUSICBRAINZ_ALBUMARTISTID'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ARTISTID", ",", "[", "'c485632c-b784-4ee9-8ea1-c5fb365681fc'", "]", ",", "'vorbis: MUSICBRAINZ_ARTISTID'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_RELEASEGROUPID", ",", "[", "'9a3237f4-c2a5-467f-9a8e-fe1d247ff520'", "]", ",", "'vorbis: MUSICBRAINZ_RELEASEGROUPID'", ")", ";", "assert", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_RELEASETRACKID", ",", "[", "'0f53f7a3-89df-4069-9357-d04252239b6d'", "]", ",", "'vorbis: MUSICBRAINZ_RELEASETRACKID'", ")", ";", "}", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "isDefined", "(", "metadata", ",", "'metadata'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ",", "'should include common tags'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "native", ",", "'metadata.common'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "native", ".", "vorbis", ",", "'should include native Vorbis tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkNativeTags", "(", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ")", ";", "checkCommonTags", "(", "metadata", ".", "common", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661904
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "it", "(", "\"should reject files that can't be parsed\"", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "__filename", ")", ";", "try", "{", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "fail", "(", "'Should reject a file which cannot be parsed'", ")", ";", "}", "catch", "(", "err", ")", "{", "assert", ".", "isDefined", "(", "err", ")", ";", "assert", ".", "isDefined", "(", "err", ".", "message", ")", ";", "}", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661905
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "const", "t", "=", "assert", ";", "it", "(", "\"should decode non-ascii-characters\"", ",", "(", ")", "=>", "{", "const", "filename", "=", "'bug-non ascii chars.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "result", "=>", "{", "t", ".", "deepEqual", "(", "result", ".", "common", ".", "artist", ",", "'Janelle Monáe'", ",", "'common.artist'", ")", ";", "t", ".", "deepEqual", "(", "result", ".", "common", ".", "artists", ",", "[", "'Janelle Monáe'", ",", "'Roman Gianarthur'", ",", "'Nate Wonder'", "]", ",", "'common.artists'", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661906
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "describe", "(", "'Parser options'", ",", "(", ")", "=>", "{", "const", "file_ape", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'monkeysaudio.ape'", ")", ";", "const", "file_flac", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.flac'", ")", ";", "const", "file_id3v22", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'id3v2.2.mp3'", ")", ";", "const", "file_m4a", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'mp4'", ",", "'id4.m4a'", ")", ";", "const", "file_ogg", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'Nirvana - In Bloom - 2-sec.ogg'", ")", ";", "describe", "(", "'option \\'skipCovers\\''", ",", "(", ")", "=>", "{", "describe", "(", "'\\'skipCovers\\' in APE format'", ",", "(", ")", "=>", "{", "it", "(", "'should include cover-art if option.skipCovers is not defined'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_ape", ")", ";", "const", "native", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "APEv2", ")", ";", "assert", ".", "isDefined", "(", "native", "[", "'Cover Art (Back)'", "]", ",", "'APEv2.\\'Cover Art (Back)\\''", ")", ";", "assert", ".", "isDefined", "(", "native", "[", "'Cover Art (Back)'", "]", ",", "'APEv2.\\'Cover Art (Front)\\''", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should not include cover-art if option.skipCovers=true'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_ape", ",", "{", "skipCovers", ":", "true", "}", ")", ";", "const", "native", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "APEv2", ")", ";", "assert", ".", "isUndefined", "(", "native", "[", "'Cover Art (Back)'", "]", ",", "'APEv2.\\'Cover Art (Back)\\''", ")", ";", "assert", ".", "isUndefined", "(", "native", "[", "'Cover Art (Back)'", "]", ",", "'APEv2.\\'Cover Art (Front)\\''", ")", ";", "assert", ".", "isUndefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should include cover-art if option.skipCovers=false'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_ape", ",", "{", "skipCovers", ":", "false", "}", ")", ";", "const", "native", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "APEv2", ")", ";", "assert", ".", "isDefined", "(", "native", "[", "'Cover Art (Back)'", "]", ",", "'APEv2.\\'Cover Art (Back)\\''", ")", ";", "assert", ".", "isDefined", "(", "native", "[", "'Cover Art (Back)'", "]", ",", "'APEv2.\\'Cover Art (Front)\\''", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'\\'skipCovers\\' in FLAC/Vorbis format'", ",", "(", ")", "=>", "{", "it", "(", "'should include cover-art if option.skipCovers is not defined'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_flac", ",", "{", "skipCovers", ":", "true", "}", ")", ";", "const", "vorbis", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ";", "assert", ".", "isUndefined", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", ",", "'vorbis.METADATA_BLOCK_PICTURE'", ")", ";", "assert", ".", "isUndefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should not include cover-art if option.skipCovers=true'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_flac", ",", "{", "skipCovers", ":", "true", "}", ")", ";", "const", "vorbis", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ";", "assert", ".", "isUndefined", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", ",", "'vorbis.METADATA_BLOCK_PICTURE'", ")", ";", "assert", ".", "isUndefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should include cover-art if option.skipCovers=false'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_flac", ",", "{", "skipCovers", ":", "false", "}", ")", ";", "const", "vorbis", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ";", "assert", ".", "isDefined", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", ",", "'vorbis.METADATA_BLOCK_PICTURE'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'\\'skipCovers\\' in MP3/id3v2.2 format'", ",", "(", ")", "=>", "{", "it", "(", "'should include cover-art if option.skipCovers is not defined'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_id3v22", ")", ";", "const", "id3", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.2'", "]", ")", ";", "assert", ".", "isDefined", "(", "id3", ".", "PIC", ",", "'id3v1.PIC'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should not include cover-art if option.skipCovers=true'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_id3v22", ",", "{", "skipCovers", ":", "true", "}", ")", ";", "const", "id3", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.2'", "]", ")", ";", "assert", ".", "isUndefined", "(", "id3", ".", "PIC", ",", "'id3v1.PIC'", ")", ";", "assert", ".", "isUndefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should include cover-art if option.skipCovers=false'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_id3v22", ",", "{", "skipCovers", ":", "false", "}", ")", ";", "const", "id3", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.2'", "]", ")", ";", "assert", ".", "isDefined", "(", "id3", ".", "PIC", ",", "'id3v1.PIC'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'\\'skipCovers\\' in M4A (id4) format'", ",", "(", ")", "=>", "{", "it", "(", "'should include cover-art if option.skipCovers is not defined'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_m4a", ")", ";", "const", "iTunes", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "iTunes", ")", ";", "assert", ".", "isDefined", "(", "iTunes", ".", "covr", ",", "'iTunes.covr'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should not include cover-art if option.skipCovers=true'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_m4a", ",", "{", "skipCovers", ":", "true", "}", ")", ";", "const", "iTunes", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "iTunes", ")", ";", "assert", ".", "isUndefined", "(", "iTunes", ".", "covr", ",", "'m4a.covr'", ")", ";", "assert", ".", "isUndefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should include cover-art if option.skipCovers=false'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_m4a", ",", "{", "skipCovers", ":", "false", "}", ")", ";", "const", "iTunes", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "iTunes", ")", ";", "assert", ".", "isDefined", "(", "iTunes", ".", "aART", ",", "'m4a.covr'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'\\'skipCovers\\' in ogg format'", ",", "(", ")", "=>", "{", "it", "(", "'should include cover-art if option.skipCovers is not defined'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_ogg", ")", ";", "const", "vorbis", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ";", "assert", ".", "isDefined", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", ",", "'vorbis.METADATA_BLOCK_PICTURE'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should not include cover-art if option.skipCovers=true'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_ogg", ",", "{", "skipCovers", ":", "true", "}", ")", ";", "const", "vorbis", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ";", "assert", ".", "isUndefined", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", ",", "'vorbis.METADATA_BLOCK_PICTURE'", ")", ";", "assert", ".", "isUndefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "it", "(", "'should include cover-art if option.skipCovers=false'", ",", "async", "(", ")", "=>", "{", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "file_ogg", ",", "{", "skipCovers", ":", "false", "}", ")", ";", "const", "vorbis", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ";", "assert", ".", "isDefined", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", ",", "'vorbis.METADATA_BLOCK_PICTURE'", ")", ";", "assert", ".", "isDefined", "(", "metadata", ".", "common", ".", "picture", ",", "'metadata.common.picture'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661907
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "{", "AsfTagMapper", "}", "from", "\"../lib/asf/AsfTagMapper\"", ";", "import", "{", "APEv2TagMapper", "}", "from", "\"../lib/apev2/APEv2TagMapper\"", ";", "import", "{", "ID3v24TagMapper", "}", "from", "\"../lib/id3v2/ID3v24TagMapper\"", ";", "describe", "(", "\"Picard mapping coverage\"", ",", "(", ")", "=>", "{", "function", "convertName", "(", "picardName", ")", "{", "switch", "(", "picardName", ")", "{", "case", "\"tracknumber\"", ":", "return", "\"track\"", ";", "case", "\"discnumber\"", ":", "return", "\"disk\"", ";", "default", ":", "return", "picardName", ";", "}", "}", "it", "(", "\"ASF\"", ",", "(", ")", "=>", "{", "/**\n * Picard mappings\n * Taken from: picard-release-1.4.2/picard/formats/asf.py\n */", "const", "PicardMappings", "=", "{", "album", ":", "'WM/AlbumTitle'", ",", "title", ":", "'Title'", ",", "artist", ":", "'Author'", ",", "albumartist", ":", "'WM/AlbumArtist'", ",", "date", ":", "'WM/Year'", ",", "originaldate", ":", "'WM/OriginalReleaseTime'", ",", "originalyear", ":", "'WM/OriginalReleaseYear'", ",", "composer", ":", "'WM/Composer'", ",", "lyricist", ":", "'WM/Writer'", ",", "conductor", ":", "'WM/Conductor'", ",", "remixer", ":", "'WM/ModifiedBy'", ",", "producer", ":", "'WM/Producer'", ",", "grouping", ":", "'WM/ContentGroupDescription'", ",", "subtitle", ":", "'WM/SubTitle'", ",", "discsubtitle", ":", "'WM/SetSubTitle'", ",", "tracknumber", ":", "'WM/TrackNumber'", ",", "discnumber", ":", "'WM/PartOfSet'", ",", "comment", ":", "'Description'", ",", "genre", ":", "'WM/Genre'", ",", "bpm", ":", "'WM/BeatsPerMinute'", ",", "key", ":", "'WM/InitialKey'", ",", "script", ":", "'WM/Script'", ",", "language", ":", "'WM/Language'", ",", "mood", ":", "'WM/Mood'", ",", "isrc", ":", "'WM/ISRC'", ",", "copyright", ":", "'Copyright'", ",", "lyrics", ":", "'WM/Lyrics'", ",", "rating", ":", "'WM/SharedUserRating'", ",", "media", ":", "'WM/Media'", ",", "barcode", ":", "'WM/Barcode'", ",", "catalognumber", ":", "'WM/CatalogNo'", ",", "label", ":", "'WM/Publisher'", ",", "encodedby", ":", "'WM/EncodedBy'", ",", "encodersettings", ":", "'WM/EncodingSettings'", ",", "albumsort", ":", "'WM/AlbumSortOrder'", ",", "albumartistsort", ":", "'WM/AlbumArtistSortOrder'", ",", "artistsort", ":", "'WM/ArtistSortOrder'", ",", "titlesort", ":", "'WM/TitleSortOrder'", ",", "composersort", ":", "'WM/ComposerSortOrder'", ",", "musicbrainz_recordingid", ":", "'MusicBrainz/Track Id'", ",", "musicbrainz_trackid", ":", "'MusicBrainz/Release Track Id'", ",", "musicbrainz_albumid", ":", "'MusicBrainz/Album Id'", ",", "musicbrainz_artistid", ":", "'MusicBrainz/Artist Id'", ",", "musicbrainz_albumartistid", ":", "'MusicBrainz/Album Artist Id'", ",", "musicbrainz_trmid", ":", "'MusicBrainz/TRM Id'", ",", "musicbrainz_discid", ":", "'MusicBrainz/Disc Id'", ",", "musicbrainz_workid", ":", "'MusicBrainz/Work Id'", ",", "musicbrainz_releasegroupid", ":", "'MusicBrainz/Release Group Id'", ",", "musicip_puid", ":", "'MusicIP/PUID'", ",", "releasestatus", ":", "'MusicBrainz/Album Status'", ",", "releasetype", ":", "'MusicBrainz/Album Type'", ",", "releasecountry", ":", "'MusicBrainz/Album Release Country'", ",", "acoustid_id", ":", "'Acoustid/Id'", ",", "acoustid_fingerprint", ":", "'Acoustid/Fingerprint'", ",", "compilation", ":", "'WM/IsCompilation'", ",", "engineer", ":", "'WM/Engineer'", ",", "asin", ":", "'ASIN'", ",", "djmixer", ":", "'WM/DJMixer'", ",", "mixer", ":", "'WM/Mixer'", ",", "artists", ":", "'WM/ARTISTS'", ",", "work", ":", "'WM/Work'", ",", "website", ":", "'WM/AuthorURL'", "}", ";", "const", "asfTagMapper", "=", "new", "AsfTagMapper", "(", ")", ";", "for", "(", "const", "picComTag", "in", "PicardMappings", ")", "{", "const", "picNativeTag", "=", "PicardMappings", "[", "picComTag", "]", ";", "const", "mmCommonTag", "=", "convertName", "(", "picComTag", ")", ";", "assert", ".", "isDefined", "(", "asfTagMapper", ".", "tagMap", "[", "picNativeTag", "]", ",", "\"Is '\"", "+", "picNativeTag", "+", "\"' defined?\"", ")", ";", "assert", ".", "equal", "(", "asfTagMapper", ".", "tagMap", "[", "picNativeTag", "]", ",", "mmCommonTag", ",", "\"Check Picard mapping for \"", "+", "picNativeTag", ")", ";", "}", "}", ")", ";", "it", "(", "\"APEv2\"", ",", "(", ")", "=>", "{", "/**\n * Picard mappings\n * Taken from: picard-release-1.4.2/picard/formats/apev2.py\n */", "const", "PicardMappings", "=", "{", "\"Album Artist\"", ":", "\"albumartist\"", ",", "MixArtist", ":", "\"remixer\"", ",", "Weblink", ":", "\"website\"", ",", "DiscSubtitle", ":", "\"discsubtitle\"", ",", "BPM", ":", "\"bpm\"", ",", "ISRC", ":", "\"isrc\"", ",", "CatalogNumber", ":", "\"catalognumber\"", ",", "Barcode", ":", "\"barcode\"", ",", "EncodedBy", ":", "\"encodedby\"", ",", "Language", ":", "\"language\"", ",", "MUSICBRAINZ_ALBUMSTATUS", ":", "\"releasestatus\"", ",", "MUSICBRAINZ_ALBUMTYPE", ":", "\"releasetype\"", ",", "musicbrainz_trackid", ":", "\"musicbrainz_recordingid\"", ",", "musicbrainz_releasetrackid", ":", "\"musicbrainz_trackid\"", "}", ";", "const", "apeTagMapper", "=", "new", "APEv2TagMapper", "(", ")", ";", "for", "(", "const", "picNativeTag", "in", "PicardMappings", ")", "{", "const", "picComTag", "=", "PicardMappings", "[", "picNativeTag", "]", ";", "const", "mmCommonTag", "=", "convertName", "(", "picComTag", ")", ";", "assert", ".", "isDefined", "(", "apeTagMapper", ".", "tagMap", "[", "picNativeTag", ".", "toUpperCase", "(", ")", "]", ",", "\"Is '\"", "+", "picNativeTag", "+", "\"' defined?\"", ")", ";", "assert", ".", "equal", "(", "apeTagMapper", ".", "tagMap", "[", "picNativeTag", ".", "toUpperCase", "(", ")", "]", ",", "mmCommonTag", ",", "\"Check Picard mapping for \"", "+", "picNativeTag", ")", ";", "}", "}", ")", ";", "it", "(", "\"ID3v2.4.0\"", ",", "(", ")", "=>", "{", "/**\n * Picard mappings\n * Taken from: picard-release-1.4.2/picard/formats/asf.py\n */", "const", "PicardMappings", "=", "{", "TIT1", ":", "'grouping'", ",", "TIT2", ":", "'title'", ",", "TIT3", ":", "'subtitle'", ",", "TALB", ":", "'album'", ",", "TSST", ":", "'discsubtitle'", ",", "TSRC", ":", "'isrc'", ",", "TPE1", ":", "'artist'", ",", "TPE2", ":", "'albumartist'", ",", "TPE3", ":", "'conductor'", ",", "TPE4", ":", "'remixer'", ",", "TEXT", ":", "'lyricist'", ",", "TCOM", ":", "'composer'", ",", "TENC", ":", "'encodedby'", ",", "TBPM", ":", "'bpm'", ",", "TKEY", ":", "'key'", ",", "TLAN", ":", "'language'", ",", "TCON", ":", "'genre'", ",", "TMED", ":", "'media'", ",", "TMOO", ":", "'mood'", ",", "TCOP", ":", "'copyright'", ",", "TPUB", ":", "'label'", ",", "TDOR", ":", "'originaldate'", ",", "TDRC", ":", "'date'", ",", "TSSE", ":", "'encodersettings'", ",", "TSOA", ":", "'albumsort'", ",", "TSOP", ":", "'artistsort'", ",", "TSOT", ":", "'titlesort'", ",", "WCOP", ":", "'license'", ",", "WOAR", ":", "'website'", ",", "COMM", ":", "'comment'", ",", "TOAL", ":", "'originalalbum'", ",", "TOPE", ":", "'originalartist'", ",", "TCMP", ":", "'compilation'", ",", "TSOC", ":", "'composersort'", ",", "TSO2", ":", "'albumartistsort'", "}", ";", "const", "id3v24TagMapper", "=", "new", "ID3v24TagMapper", "(", ")", ";", "for", "(", "const", "picNativeTag", "in", "PicardMappings", ")", "{", "const", "picComTag", "=", "PicardMappings", "[", "picNativeTag", "]", ";", "const", "mmCommonTag", "=", "convertName", "(", "picComTag", ")", ";", "assert", ".", "isDefined", "(", "id3v24TagMapper", ".", "tagMap", "[", "picNativeTag", "]", ",", "\"Is '\"", "+", "picNativeTag", "+", "\"' defined?\"", ")", ";", "assert", ".", "equal", "(", "id3v24TagMapper", ".", "tagMap", "[", "picNativeTag", "]", ",", "mmCommonTag", ",", "\"Check Picard mapping for \"", "+", "picNativeTag", ")", ";", "}", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661908
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "path", "from", "'path'", ";", "import", "*", "as", "crypto", "from", "'crypto'", ";", "import", "{", "TagType", "}", "from", "'../lib/common/GenericTagTypes'", ";", "import", "{", "ICommonTagsResult", ",", "IFormat", ",", "INativeTagDict", ",", "parseFile", ",", "orderTags", "}", "from", "'../lib'", ";", "const", "t", "=", "assert", ";", "/**\n * Check if different header formats map to the same common output.\n * Ref: https://picard.musicbrainz.org/docs/mappings/\n */", "describe", "(", "'Parsing of metadata saved by \\'Picard\\' in audio files'", ",", "(", ")", "=>", "{", "const", "samplePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ")", ";", "function", "hasReleaseData", "(", "inputTagType", ")", "{", "return", "inputTagType", "!==", "'ID3v2.3'", ";", "}", "function", "hasOriginalData", "(", "inputTagType", ")", "{", "switch", "(", "inputTagType", ")", "{", "case", "'ID3v2.3'", ":", "return", "false", ";", "default", ":", "return", "true", ";", "}", "}", "function", "calcHash", "(", "buf", ")", "{", "const", "hash", "=", "crypto", ".", "createHash", "(", "'md5'", ")", ";", "hash", ".", "update", "(", "buf", ")", ";", "return", "hash", ".", "digest", "(", "'hex'", ")", ";", "}", "const", "performers", "=", "[", "'Carmine Rojas (bass guitar)'", ",", "'The Bovaland Orchestra (orchestra)'", ",", "'Anton Fig (drums)'", ",", "'Blondie Chaplin (guitar)'", ",", "'Joe Bonamassa (guitar)'", ",", "'Anton Fig (percussion)'", ",", "'Arlan Schierbaum (keyboard)'", ",", "'Beth Hart (vocals)'", ",", "'Joe Bonamassa (vocals)'", ",", "'Beth Hart (piano)'", "]", ";", "param", "inputTagType", "param", "common", "function", "checkCommonMapping", "(", "inputTagType", ",", "common", ")", "{", "t", ".", "strictEqual", "(", "common", ".", "title", ",", "'Sinner\\'s Prayer'", ",", "inputTagType", "+", "' => common.title'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "artist", ",", "'Beth Hart & Joe Bonamassa'", ",", "inputTagType", "+", "' => common.artist'", ")", ";", "if", "(", "inputTagType", "===", "'asf'", ")", "{", "t", ".", "deepEqual", "(", "common", ".", "artists", ",", "[", "'Joe Bonamassa'", ",", "'Beth Hart'", "]", ",", "inputTagType", "+", "' => common.artists'", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "musicbrainz_artistid", ",", "[", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", ",", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", "]", ",", "inputTagType", "+", "' => common.musicbrainz_artistid'", ")", ";", "}", "else", "{", "t", ".", "deepEqual", "(", "common", ".", "artists", ",", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", ",", "inputTagType", "+", "' => common.artists'", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "musicbrainz_artistid", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "inputTagType", "+", "' => common.musicbrainz_artistid'", ")", ";", "}", "t", ".", "strictEqual", "(", "common", ".", "albumartist", ",", "'Beth Hart & Joe Bonamassa'", ",", "'common.albumartist'", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "albumartistsort", ",", "'Hart, Beth & Bonamassa, Joe'", ",", "inputTagType", "+", "' => common.albumartistsort'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "album", ",", "'Don\\'t Explain'", ",", "inputTagType", "+", "' => common.album = Don\\'t Explain'", ")", ";", "if", "(", "inputTagType", "===", "'asf'", ")", "{", "t", ".", "deepEqual", "(", "common", ".", "track", ",", "{", "no", ":", "1", ",", "of", ":", "null", "}", ",", "inputTagType", "+", "' => common.track'", ")", ";", "}", "else", "{", "t", ".", "deepEqual", "(", "common", ".", "track", ",", "{", "no", ":", "1", ",", "of", ":", "10", "}", ",", "inputTagType", "+", "' => common.track'", ")", ";", "}", "t", ".", "deepEqual", "(", "common", ".", "disk", ",", "{", "no", ":", "1", ",", "of", ":", "1", "}", ",", "inputTagType", "+", "' => common.disk'", ")", ";", "if", "(", "hasOriginalData", "(", "inputTagType", ")", ")", "{", "t", ".", "strictEqual", "(", "common", ".", "originaldate", ",", "'2011-09-26'", ",", "inputTagType", "+", "' => common.originaldate = 2011-09-26'", ")", ";", "}", "if", "(", "hasReleaseData", "(", "inputTagType", ")", ")", "{", "t", ".", "strictEqual", "(", "common", ".", "date", ",", "'2011-09-27'", ",", "inputTagType", "+", "' => common.date'", ")", ";", "}", "t", ".", "strictEqual", "(", "common", ".", "year", ",", "2011", ",", "inputTagType", "+", "' => common.year'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "originalyear", ",", "2011", ",", "inputTagType", "+", "' => common.year'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "media", ",", "'CD'", ",", "inputTagType", "+", "' => common.media = CD'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "barcode", ",", "'804879313915'", ",", "inputTagType", "+", "' => common.barcode'", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "label", ",", "[", "'J&R Adventures'", "]", ",", "inputTagType", "+", "' => common.label = \\'J&R Adventures\\''", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "catalognumber", ",", "[", "'PRAR931391'", "]", ",", "inputTagType", "+", "' => common.catalognumber = PRAR931391'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "originalyear", ",", "2011", ",", "inputTagType", "+", "' => common.originalyear = 2011'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "releasestatus", ",", "'official'", ",", "inputTagType", "+", "' => common.releasestatus = official'", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "releasetype", ",", "[", "'album'", "]", ",", "inputTagType", "+", "' => common.releasetype'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "musicbrainz_albumid", ",", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", ",", "inputTagType", "+", "' => common.musicbrainz_albumid'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "musicbrainz_recordingid", ",", "'f151cb94-c909-46a8-ad99-fb77391abfb8'", ",", "inputTagType", "+", "' => common.musicbrainz_recordingid'", ")", ";", "if", "(", "inputTagType", "===", "'asf'", ")", "{", "t", ".", "deepEqual", "(", "common", ".", "musicbrainz_albumartistid", ",", "[", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", ",", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", "]", ",", "inputTagType", "+", "' => common.musicbrainz_albumartistid'", ")", ";", "}", "else", "{", "t", ".", "deepEqual", "(", "common", ".", "musicbrainz_albumartistid", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "inputTagType", "+", "' => common.musicbrainz_albumartistid'", ")", ";", "}", "t", ".", "strictEqual", "(", "common", ".", "musicbrainz_releasegroupid", ",", "'e00305af-1c72-469b-9a7c-6dc665ca9adc'", ",", "inputTagType", "+", "' => common.musicbrainz_releasegroupid'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "musicbrainz_trackid", ",", "'d062f484-253c-374b-85f7-89aab45551c7'", ",", "inputTagType", "+", "' => common.musicbrainz_trackid'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "asin", ",", "'B005NPEUB2'", ",", "inputTagType", "+", "' => common.asin'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "acoustid_id", ",", "'09c06fac-679a-45b1-8ea0-6ce532318363'", ",", "inputTagType", "+", "' => common.acoustid_id'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "picture", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'picture format'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "picture", "[", "0", "]", ".", "data", ".", "length", ",", "98008", ",", "'picture length'", ")", ";", "t", ".", "strictEqual", "(", "calcHash", "(", "common", ".", "picture", "[", "0", "]", ".", "data", ")", ",", "'c57bec49b36ebf422018f82273d1995a'", ",", "'hash front cover data'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "picture", "[", "1", "]", ".", "format", ",", "'image/png'", ",", "'picture format'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "picture", "[", "1", "]", ".", "data", ".", "length", ",", "120291", ",", "'picture length'", ")", ";", "t", ".", "strictEqual", "(", "calcHash", "(", "common", ".", "picture", "[", "1", "]", ".", "data", ")", ",", "'90ec686eb82e745e737b2c7aa706eeaa'", ",", "'hash back cover data'", ")", ";", "t", ".", "deepEqual", "(", "common", ".", "isrc", ",", "[", "'NLB931100460'", ",", "'USMH51100098'", "]", ",", "'ISRC\\'s'", ")", ";", "switch", "(", "inputTagType", ")", "{", "case", "'APEv2'", ":", "case", "'iTunes'", ":", "break", ";", "default", ":", "t", ".", "isDefined", "(", "common", ".", "rating", ",", "`'${", "inputTagType", "}' has rating`", ")", ";", "t", ".", "approximately", "(", "common", ".", "rating", "[", "0", "]", ".", "rating", ",", "0.6", ",", "0.1", ",", "`'${", "inputTagType", "}': rating=3.0`", ")", ";", "}", "}", "describe", "(", "'Vorbis mappings'", ",", "(", ")", "=>", "{", "param", "vorbis", "function", "checkVorbisTags", "(", "vorbis", ")", "{", "t", ".", "deepEqual", "(", "vorbis", ".", "TITLE", ",", "[", "'Sinner\\'s Prayer'", "]", ",", "'vorbis.TITLE'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ALBUM", ",", "[", "'Don\\'t Explain'", "]", ",", "'vorbis.TITLE'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "DATE", ",", "[", "'2011-09-27'", "]", ",", "'vorbis.DATE'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "TRACKNUMBER", ",", "[", "'1'", "]", ",", "'vorbis.TRACKNUMBER'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "PRODUCER", ",", "[", "'Roy Weisman'", "]", ",", "'vorbis.PRODUCER'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ENGINEER", ",", "[", "'James McCullagh'", ",", "'Jared Kvitka'", "]", ",", "'vorbis.ENGINEER'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "LABEL", ",", "[", "'J&R Adventures'", "]", ",", "'vorbis.LABEL'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "CATALOGNUMBER", ",", "[", "'PRAR931391'", "]", ",", "'vorbis.CATALOGNUMBER'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ACOUSTID_ID", ",", "[", "'09c06fac-679a-45b1-8ea0-6ce532318363'", "]", ",", "'vorbis.ACOUSTID_ID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ARTIST", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'vorbis.ARTIST'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ARTISTS", ",", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", ",", "'vorbis.ARTISTS'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ARTISTSORT", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'vorbis.ARTISTSORT'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ALBUMARTIST", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'vorbis.ALBUMARTIST'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ALBUMARTISTSORT", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'vorbis.ALBUMARTISTSORT'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ORIGINALDATE", ",", "[", "'2011-09-26'", "]", ",", "'vorbis.ORIGINALDATE'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "SCRIPT", ",", "[", "'Latn'", "]", ",", "'vorbis.SCRIPT'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MEDIA", ",", "[", "'CD'", "]", ",", "'vorbis.MEDIA'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ALBUMID", ",", "[", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", "]", ",", "'vorbis.MUSICBRAINZ_ALBUMID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ALBUMARTISTID", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'vorbis.MUSICBRAINZ_ALBUMARTISTID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ARTISTID", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'vorbis.MUSICBRAINZ_ARTISTID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "PERFORMER", ",", "performers", ",", "'vorbis.PERFORMER'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ARRANGER", ",", "[", "'Jeff Bova'", "]", ",", "'vorbis.ARRANGER'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_ALBUMID", ",", "[", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", "]", ",", "'vorbis.MUSICBRAINZ_ALBUMID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_RELEASETRACKID", ",", "[", "'d062f484-253c-374b-85f7-89aab45551c7'", "]", ",", "'vorbis.MUSICBRAINZ_RELEASETRACKID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_RELEASEGROUPID", ",", "[", "'e00305af-1c72-469b-9a7c-6dc665ca9adc'", "]", ",", "'vorbis.MUSICBRAINZ_RELEASEGROUPID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "MUSICBRAINZ_TRACKID", ",", "[", "'f151cb94-c909-46a8-ad99-fb77391abfb8'", "]", ",", "'vorbis.MUSICBRAINZ_TRACKID'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "NOTES", ",", "[", "'Medieval CUE Splitter (www.medieval.it)'", "]", ",", "'vorbis.NOTES'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "BARCODE", ",", "[", "'804879313915'", "]", ",", "'vorbis.BARCODE'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "ASIN", ",", "[", "'B005NPEUB2'", "]", ",", "'vorbis.ASIN'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "RELEASECOUNTRY", ",", "[", "'US'", "]", ",", "'vorbis.RELEASECOUNTRY'", ")", ";", "t", ".", "deepEqual", "(", "vorbis", ".", "RELEASESTATUS", ",", "[", "'official'", "]", ",", "'vorbis.RELEASESTATUS'", ")", ";", "t", ".", "strictEqual", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'vorbis.METADATA_BLOCK_PICTURE.format = \\'image/jpeg\\''", ")", ";", "t", ".", "strictEqual", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", "[", "0", "]", ".", "type", ",", "'Cover (front)'", ",", "'vorbis.METADATA_BLOCK_PICTURE.type = \\'Cover (front)\\''", ")", ";", "t", ".", "strictEqual", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", "[", "0", "]", ".", "description", ",", "''", ",", "'vorbis.METADATA_BLOCK_PICTURE.description'", ")", ";", "t", ".", "strictEqual", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", "[", "0", "]", ".", "data", ".", "length", ",", "98008", ",", "'vorbis.METADATA_BLOCK_PICTURE.data.length = 98008 bytes'", ")", ";", "t", ".", "strictEqual", "(", "calcHash", "(", "vorbis", ".", "METADATA_BLOCK_PICTURE", "[", "0", "]", ".", "data", ")", ",", "'c57bec49b36ebf422018f82273d1995a'", ",", "'Picture content'", ")", ";", "}", "it", "(", "'should map FLAC/Vorbis'", ",", "async", "(", ")", "=>", "{", "const", "filename", "=", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.flac'", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "strictEqual", "(", "format", ".", "container", ",", "'FLAC'", ",", "'format.container'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "codec", ",", "'FLAC'", ",", "'format.codec'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1229931972789116", ",", "'format.duration = 2.123 seconds'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate = 44100 samples/sec'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "bitsPerSample", ",", "16", ",", "'format.bitsPerSample = 16 bits'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels = 2 channels'", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ".", "vorbis", ",", "'should return metadata.native.vorbis'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkVorbisTags", "(", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ")", ";", "checkCommonMapping", "(", "'vorbis'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "it", "(", "'should map ogg/Vorbis'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.ogg'", ")", ";", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ".", "vorbis", ",", "'should return metadata.native.vorbis'", ")", ";", "checkVorbisTags", "(", "orderTags", "(", "metadata", ".", "native", ".", "vorbis", ")", ")", ";", "checkCommonMapping", "(", "'vorbis'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'APEv2 header'", ",", "(", ")", "=>", "{", "function", "checkApeTags", "(", "APEv2", ")", "{", "t", ".", "deepEqual", "(", "APEv2", ".", "Title", ",", "[", "'Sinner\\'s Prayer'", "]", ",", "'APEv2.Title'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Album", ",", "[", "'Don\\'t Explain'", "]", ",", "'APEv2.Album'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Year", ",", "[", "'2011-09-27'", "]", ",", "'APEv2.Year'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Track", ",", "[", "'1/10'", "]", ",", "'APEv2.Track'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Disc", ",", "[", "'1/1'", "]", ",", "'APEv2.Disc'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Originalyear", ",", "[", "'2011'", "]", ",", "'APEv2.Year'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Originaldate", ",", "[", "'2011-09-26'", "]", ",", "'APEv2.Originaldate'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Label", ",", "[", "'J&R Adventures'", "]", ",", "'APEv2.LABEL'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "CatalogNumber", ",", "[", "'PRAR931391'", "]", ",", "'APEv2.CatalogNumber'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Acoustid_Id", ",", "[", "'09c06fac-679a-45b1-8ea0-6ce532318363'", "]", ",", "'APEv2.Acoustid_Id'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Artist", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'APEv2.Artist'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Artists", ",", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", ",", "'APEv2.Artists'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Artistsort", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'APEv2.Artistsort'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Album Artist'", "]", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'APEv2.ALBUMARTIST'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Albumartistsort", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'APEv2.Albumartistsort'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Originaldate", ",", "[", "'2011-09-26'", "]", ",", "'APEv2.ORIGINALDATE'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Script", ",", "[", "'Latn'", "]", ",", "'APEv2.Script'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Media", ",", "[", "'CD'", "]", ",", "'APEv2.Media'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Musicbrainz_Albumid", ",", "[", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", "]", ",", "'APEv2.Musicbrainz_Albumid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Musicbrainz_Albumartistid", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'APEv2.Musicbrainz_Albumartistid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Musicbrainz_Artistid", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'APEv2.Musicbrainz_Artistid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Performer", ",", "performers", ",", "'APEv2.Performer'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Producer", ",", "[", "'Roy Weisman'", "]", ",", "'APEv2.PRODUCER'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Engineer", ",", "[", "'James McCullagh'", ",", "'Jared Kvitka'", "]", ",", "'APEv2.ENGINEER'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Arranger", ",", "[", "'Jeff Bova'", "]", ",", "'APEv2.ARRANGER'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Musicbrainz_Albumid", ",", "[", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", "]", ",", "'APEv2.Musicbrainz_Albumid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "musicbrainz_releasetrackid", ",", "[", "'d062f484-253c-374b-85f7-89aab45551c7'", "]", ",", "'APEv2.musicbrainz_releasetrackid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Musicbrainz_Releasegroupid", ",", "[", "'e00305af-1c72-469b-9a7c-6dc665ca9adc'", "]", ",", "'APEv2.Musicbrainz_Releasegroupid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "musicbrainz_trackid", ",", "[", "'f151cb94-c909-46a8-ad99-fb77391abfb8'", "]", ",", "'APEv2.musicbrainz_trackid'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Barcode", ",", "[", "'804879313915'", "]", ",", "'APEv2.Barcode'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "MUSICBRAINZ_ALBUMSTATUS", ",", "[", "'official'", "]", ",", "'APEv2.MUSICBRAINZ_ALBUMSTATUS'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", ".", "Arranger", ",", "[", "'Jeff Bova'", "]", ",", "'APEv2.Arranger'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Cover Art (Front)'", "]", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'picture.format'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Cover Art (Front)'", "]", "[", "0", "]", ".", "description", ",", "'front'", ",", "'picture.description'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Cover Art (Front)'", "]", "[", "0", "]", ".", "data", ".", "length", ",", "98008", ",", "'picture.data.length'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Cover Art (Back)'", "]", "[", "0", "]", ".", "format", ",", "'image/png'", ",", "'picture.format'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Cover Art (Back)'", "]", "[", "0", "]", ".", "description", ",", "'back'", ",", "'picture.description'", ")", ";", "t", ".", "deepEqual", "(", "APEv2", "[", "'Cover Art (Back)'", "]", "[", "0", "]", ".", "data", ".", "length", ",", "120291", ",", "'picture.data.length'", ")", ";", "}", "it", "(", "'should map Monkey\\'s Audio / APEv2'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.ape'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1229931972789116", ",", "'format.duration = 2.123 seconds'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "bitsPerSample", ",", "16", ",", "'format.bitsPerSample'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels'", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", "[", "'APEv2'", "]", ",", "'should include native APEv2 tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkApeTags", "(", "orderTags", "(", "metadata", ".", "native", ".", "APEv2", ")", ")", ";", "checkCommonMapping", "(", "'APEv2'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "it", "(", "'should map WavPack / APEv2'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'wavpack'", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.wv'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1229931972789116", ",", "'format.duration = 2.123 seconds'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "bitsPerSample", ",", "16", ",", "'format.bitsPerSample'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels'", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", "[", "'APEv2'", "]", ",", "'should include native APEv2 tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkApeTags", "(", "orderTags", "(", "metadata", ".", "native", ".", "APEv2", ")", ")", ";", "checkCommonMapping", "(", "'APEv2'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'ID3v2.3 header'", ",", "(", ")", "=>", "{", "function", "checkID3Tags", "(", "native", ")", "{", "t", ".", "deepEqual", "(", "native", ".", "TIT2", ",", "[", "'Sinner\\'s Prayer'", "]", ",", "'id3v23.TIT2: Title/songname/content description'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TPE1", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'id3v23.TPE1: Lead performer(s)/Soloist(s)'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TPE2", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'id3v23.TPE2: Band/orchestra/accompaniment'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TALB", ",", "[", "'Don\\'t Explain'", "]", ",", "'id3v23.TALB: Album/Movie/Show title'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TORY", ",", "[", "'2011'", "]", ",", "'id3v23.TORY: Original release year'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TYER", ",", "[", "'2011'", "]", ",", "'id3v23.TYER'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TPOS", ",", "[", "'1/1'", "]", ",", "'id3v23.TPOS: Part of a set'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TRCK", ",", "[", "'1/10'", "]", ",", "'id3v23.TRCK: Track number/Position in set'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TPUB", ",", "[", "'J&R Adventures'", "]", ",", "'id3v23.TPUB: Publisher'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "TMED", ",", "[", "'CD'", "]", ",", "'id3v23.TMED: Media type'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "UFID", "[", "0", "]", ",", "{", "owner_identifier", ":", "'http://musicbrainz.org'", ",", "identifier", ":", "Buffer", ".", "from", "(", "'f151cb94-c909-46a8-ad99-fb77391abfb8'", ",", "'ascii'", ")", "}", ",", "'id3v23.UFID: Unique file identifier'", ")", ";", "t", ".", "deepEqual", "(", "native", ".", "IPLS", ",", "[", "{", "arranger", ":", "[", "'Jeff Bova'", "]", ",", "'bass guitar'", ":", "[", "'Carmine Rojas'", "]", ",", "drums", ":", "[", "'Anton Fig'", "]", ",", "engineer", ":", "[", "'James McCullagh'", ",", "'Jared Kvitka'", "]", ",", "guitar", ":", "[", "'Blondie Chaplin'", ",", "'Joe Bonamassa'", "]", ",", "keyboard", ":", "[", "'Arlan Schierbaum'", "]", ",", "orchestra", ":", "[", "'The Bovaland Orchestra'", "]", ",", "percussion", ":", "[", "'Anton Fig'", "]", ",", "piano", ":", "[", "'Beth Hart'", "]", ",", "producer", ":", "[", "'Roy Weisman'", "]", ",", "vocals", ":", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", "}", "]", ",", "'id3v23.IPLS: Involved people list'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:ASIN'", "]", ",", "[", "'B005NPEUB2'", "]", ",", "'id3v23.TXXX:ASIN'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:Artists'", "]", ",", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", ",", "'id3v23.TXXX:Artists'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:BARCODE'", "]", ",", "[", "'804879313915'", "]", ",", "'id3v23.TXXX:BARCODE'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:CATALOGNUMBER'", "]", ",", "[", "'PRAR931391'", "]", ",", "'id3v23.TXXX:CATALOGNUMBER'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Album Artist Id'", "]", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'id3v23.TXXX:MusicBrainz Album Artist Id'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Album Id'", "]", ",", "[", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", "]", ",", "'id3v23.TXXX:MusicBrainz Album Id'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Album Status'", "]", ",", "[", "'official'", "]", ",", "'id3v23.TXXX:MusicBrainz Album Status'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Album Type'", "]", ",", "[", "'album'", "]", ",", "'id3v23.TXXX:MusicBrainz Album Type'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Artist Id'", "]", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'id3v23.TXXX:MusicBrainz Artist Id'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Release Group Id'", "]", ",", "[", "'e00305af-1c72-469b-9a7c-6dc665ca9adc'", "]", ",", "'id3v23.TXXX.MusicBrainz Release Group Id'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:MusicBrainz Release Track Id'", "]", ",", "[", "'d062f484-253c-374b-85f7-89aab45551c7'", "]", ",", "'id3v23.TXXX.MusicBrainz Release Track Id'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:SCRIPT'", "]", ",", "[", "'Latn'", "]", ",", "'id3v23.TXXX:SCRIPT'", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'TXXX:originalyear'", "]", ",", "[", "'2011'", "]", ",", "'id3v23.TXXX:originalyear'", ")", ";", "}", "it", "(", "'MP3 / ID3v2.3'", ",", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer [id3v2.3].V2.mp3'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "'ID3v2.3'", "]", ",", "'format.tagTypes'", ")", ";", "t", ".", "deepEqual", "(", "format", ".", "container", ",", "'MPEG'", ",", "'format.container'", ")", ";", "t", ".", "deepEqual", "(", "format", ".", "codec", ",", "'MPEG 1 Layer 3'", ",", "'format.codec'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1681632653061222", ",", "'format.duration'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "codecProfile", ",", "'V2'", ",", "'format.codecProfile'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "tool", ",", "'LAME 3.99r'", ",", "'format.tool'", ")", ";", "}", "return", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", "[", "'ID3v2.3'", "]", ",", "'should include native id3v2.3 tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkID3Tags", "(", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.3'", "]", ")", ")", ";", "checkCommonMapping", "(", "'ID3v2.3'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "}", ")", ";", "/**\n * Looks like RIFF/WAV not fully supported yet in MusicBrainz Picard: https://tickets.metabrainz.org/browse/PICARD-653?jql=text%20~%20%22RIFF%22.\n * This file has been fixed with Mp3Tag to have a valid ID3v2.3 tag\n */", "it", "(", "'should map RIFF/WAVE/PCM / ID3v2.3'", ",", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer [id3v2.3].wav'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "'exif'", ",", "'ID3v2.3'", "]", ",", "'format.tagTypes)'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate = 44.1 kHz'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "bitsPerSample", ",", "16", ",", "'format.bitsPerSample = 16 bits'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels = 2 channels'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfSamples", ",", "93624", ",", "'format.numberOfSamples = 88200'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1229931972789116", ",", "'format.duration = 2 seconds'", ")", ";", "}", "return", "parseFile", "(", "filePath", ")", ".", "then", "(", "result", "=>", "{", "checkFormat", "(", "result", ".", "format", ")", ";", "checkID3Tags", "(", "orderTags", "(", "result", ".", "native", "[", "'ID3v2.3'", "]", ")", ")", ";", "checkCommonMapping", "(", "'ID3v2.3'", ",", "result", ".", "common", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'ID3v2.4 header'", ",", "(", ")", "=>", "{", "function", "checkID3Tags", "(", "id3v24", ")", "{", "t", ".", "deepEqual", "(", "id3v24", ".", "APIC", "[", "0", "]", ".", "data", ".", "length", ",", "98008", ",", "'id3v24.APIC.data.length'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "APIC", "[", "0", "]", ".", "description", ",", "''", ",", "'id3v24.APIC.data.description'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "APIC", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'id3v24.APIC.format = image/jpeg'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "APIC", "[", "0", "]", ".", "type", ",", "'Cover (front)'", ",", "'d3v24.APIC.type = Cover (front)'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TALB", ",", "[", "'Don\\'t Explain'", "]", ",", "'id3v24.TALB: Album/Movie/Show title'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TDOR", ",", "[", "'2011-09-26'", "]", ",", "'id3v24.TDOR'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TDRC", ",", "[", "'2011-09-27'", "]", ",", "'id3v24.DATE'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TIPL", "[", "0", "]", ",", "{", "arranger", ":", "[", "'Jeff Bova'", "]", ",", "engineer", ":", "[", "'James McCullagh'", ",", "'Jared Kvitka'", "]", ",", "producer", ":", "[", "'Roy Weisman'", "]", "}", ",", "'event id3v24.TIPL'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TIT2", "[", "0", "]", ",", "'Sinner\\'s Prayer'", ",", "'id3v24.TIT2: Title/songname/content description'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TMCL", "[", "0", "]", ",", "{", "'bass guitar'", ":", "[", "'Carmine Rojas'", "]", ",", "drums", ":", "[", "'Anton Fig'", "]", ",", "guitar", ":", "[", "'Blondie Chaplin'", ",", "'Joe Bonamassa'", "]", ",", "keyboard", ":", "[", "'Arlan Schierbaum'", "]", ",", "orchestra", ":", "[", "'The Bovaland Orchestra'", "]", ",", "percussion", ":", "[", "'Anton Fig'", "]", ",", "piano", ":", "[", "'Beth Hart'", "]", ",", "vocals", ":", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", "}", ",", "'event id3v24.TMCL'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TMED", ",", "[", "'CD'", "]", ",", "'id3v24.TMED'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TPE1", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'id3v24.TPE1: Lead performer(s)/Soloist(s)'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TPE2", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'id3v24.TPE1: Band/orchestra/accompaniment'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TPOS", ",", "[", "'1/1'", "]", ",", "'id3v24.TPOS'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TPUB", ",", "[", "'J&R Adventures'", "]", ",", "'id3v24.TPUB'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TRCK", ",", "[", "'1/10'", "]", ",", "'id3v24.TRCK'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TSO2", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'TSO2'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "TSOP", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'TSOP'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", ".", "UFID", "[", "0", "]", ",", "{", "owner_identifier", ":", "'http://musicbrainz.org'", ",", "identifier", ":", "Buffer", ".", "from", "(", "'f151cb94-c909-46a8-ad99-fb77391abfb8'", ",", "'ascii'", ")", "}", ",", "'id3v24.UFID: Unique file identifier'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:ASIN'", "]", ",", "[", "'B005NPEUB2'", "]", ",", "'id3v24.TXXX:ASIN'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:Artists'", "]", ",", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", ",", "'id3v24.TXXX:Artists'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:BARCODE'", "]", ",", "[", "'804879313915'", "]", ",", "'id3v24.TXXX:BARCODE'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:CATALOGNUMBER'", "]", ",", "[", "'PRAR931391'", "]", ",", "'id3v24.TXXX:CATALOGNUMBER'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Album Artist Id'", "]", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'id3v24.TXXX:MusicBrainz Album Artist Id'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Album Id'", "]", ",", "[", "'e7050302-74e6-42e4-aba0-09efd5d431d8'", "]", ",", "'id3v24.TXXX:MusicBrainz Album Id'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Album Status'", "]", ",", "[", "'official'", "]", ",", "'id3v24.TXXX:MusicBrainz Album Status'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Album Type'", "]", ",", "[", "'album'", "]", ",", "'id3v24.TXXX:MusicBrainz Album Type'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Artist Id'", "]", ",", "[", "'3fe817fc-966e-4ece-b00a-76be43e7e73c'", ",", "'984f8239-8fe1-4683-9c54-10ffb14439e9'", "]", ",", "'id3v24.TXXX:MusicBrainz Artist Id'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Release Group Id'", "]", ",", "[", "'e00305af-1c72-469b-9a7c-6dc665ca9adc'", "]", ",", "'id3v24.TXXX.MusicBrainz Release Group Id'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:MusicBrainz Release Track Id'", "]", ",", "[", "'d062f484-253c-374b-85f7-89aab45551c7'", "]", ",", "'id3v24.TXXX.MusicBrainz Release Track Id'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:SCRIPT'", "]", ",", "[", "'Latn'", "]", ",", "'id3v24.TXXX:SCRIPT'", ")", ";", "t", ".", "deepEqual", "(", "id3v24", "[", "'TXXX:originalyear'", "]", ",", "[", "'2011'", "]", ",", "'id3v24.TXXX:originalyear'", ")", ";", "}", "it", "(", "'should map MP3/ID3v2.4 header'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer [id3v2.4].V2.mp3'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "'ID3v2.4'", "]", ",", "'format.tagTypes'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "container", ",", "'MPEG'", ",", "'format.container'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "codec", ",", "'MPEG 1 Layer 3'", ",", "'format.codec'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "codecProfile", ",", "'V2'", ",", "'format.codecProfile = V2'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "tool", ",", "'LAME 3.99r'", ",", "'format.tool'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1681632653061222", ",", "'format.duration'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate = 44.1 kHz'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels'", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", "[", "'ID3v2.4'", "]", ",", "'should include native id3v2.4 tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkID3Tags", "(", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.4'", "]", ")", ")", ";", "checkCommonMapping", "(", "'ID3v2.4'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "it", "(", "'should parse AIFF/ID3v2.4 audio file'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer [id3v2.4].aiff'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "strictEqual", "(", "format", ".", "container", ",", "'AIFF'", ",", "'format.container = \\'AIFF\\''", ")", ";", "t", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "'ID3v2.4'", "]", ",", "'format.tagTypes = \\'ID3v2.4\\''", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate = 44.1 kHz'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "bitsPerSample", ",", "16", ",", "'format.bitsPerSample = 16 bits'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfChannels", ",", "2", ",", "'format.numberOfChannels = 2 channels'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "numberOfSamples", ",", "93624", ",", "'format.bitsPerSample = 93624'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1229931972789116", ",", "'format.duration = ~2.123'", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", "[", "'ID3v2.4'", "]", ",", "'should include native id3v2.4 tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "checkID3Tags", "(", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.4'", "]", ")", ")", ";", "checkCommonMapping", "(", "'ID3v2.4'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'should map M4A / (Apple) iTunes header'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.m4a'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "'iTunes'", "]", ",", "'format.tagTypes'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "container", ",", "'M4A/mp42/isom'", ",", "'format.container'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "codec", ",", "'ALAC'", ",", "'format.codec'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "lossless", ",", "true", ",", "'ALAC is a lossless format'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "duration", ",", "2.1229931972789116", ",", "'format.duration'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "sampleRate", ",", "44100", ",", "'format.sampleRate = 44.1 kHz'", ")", ";", "}", "function", "checkCommonTags", "(", "common", ")", "{", "t", ".", "strictEqual", "(", "common", ".", "picture", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'picture format'", ")", ";", "t", ".", "strictEqual", "(", "common", ".", "picture", "[", "0", "]", ".", "data", ".", "length", ",", "98008", ",", "'picture length'", ")", ";", "}", "function", "check_iTunes_Tags", "(", "iTunes", ")", "{", "t", ".", "deepEqual", "(", "iTunes", "[", "'©nam'", "]", ",", "[", "'Sinner\\'s Prayer'", "]", ",", "'iTunes.©nam => common.title'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'©ART'", "]", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'iTunes.@ART => common.artist'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'©alb'", "]", ",", "[", "'Don\\'t Explain'", "]", ",", "'iTunes.©alb => common.album'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", ".", "soar", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'iTunes.soar => common.artistsort'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", ".", "soaa", ",", "[", "'Hart, Beth & Bonamassa, Joe'", "]", ",", "'iTunes.soaa => common.albumartistsort'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:ARTISTS'", "]", ",", "[", "'Beth Hart'", ",", "'Joe Bonamassa'", "]", ",", "'iTunes.----:com.apple.iTunes:ARTISTS => common.artists'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", ".", "aART", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'iTunes.aART => common.albumartist'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:Band'", "]", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'iTunes.----:com.apple.iTunes:Band => common.albumartist'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", ".", "trkn", ",", "[", "'1/10'", "]", ",", "'iTunes.trkn => common.track'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", ".", "disk", ",", "[", "'1/1'", "]", ",", "'iTunes.trkn => common.disk'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:ORIGINALDATE'", "]", ",", "[", "'2011-09-26'", "]", ",", "'iTunes.----:com.apple.iTunes:ORIGINALDATE => common.albumartistsort'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:ORIGINALYEAR'", "]", ",", "[", "'2011'", "]", ",", "'iTunes.----:com.apple.iTunes:ORIGINALDATE => common.originalyear'", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:ACOUSTID_ID'", "]", ",", "[", "'09c06fac-679a-45b1-8ea0-6ce532318363'", "]", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:ARRANGER'", "]", ",", "[", "'Jeff Bova'", "]", ")", ";", "t", ".", "deepEqual", "(", "iTunes", "[", "'----:com.apple.iTunes:NOTES'", "]", ",", "[", "'Medieval CUE Splitter (www.medieval.it)'", "]", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ".", "iTunes", ",", "'should include native iTunes tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "check_iTunes_Tags", "(", "orderTags", "(", "metadata", ".", "native", ".", "iTunes", ")", ")", ";", "checkCommonTags", "(", "metadata", ".", "common", ")", ";", "checkCommonMapping", "(", "'iTunes'", ",", "metadata", ".", "common", ")", ";", "}", ")", ";", "it", "(", "'should map WMA/ASF header'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "'MusicBrainz - Beth Hart - Sinner\\'s Prayer.wma'", ")", ";", "function", "checkFormat", "(", "format", ")", "{", "t", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "'asf'", "]", ",", "'format.tagTypes = asf'", ")", ";", "t", ".", "strictEqual", "(", "format", ".", "bitrate", ",", "320000", ",", "'format.bitrate = 320000'", ")", ";", "t", ".", "approximately", "(", "format", ".", "duration", ",", "2.135", ",", "1", "/", "10000", ",", "\"format.duration\"", ")", ";", "}", "function", "check_asf_Tags", "(", "native", ")", "{", "t", ".", "deepEqual", "(", "native", "[", "'WM/AlbumArtist'", "]", ",", "[", "'Beth Hart & Joe Bonamassa'", "]", ",", "'asf.WM/AlbumArtist => common.albumartist = \\'Beth Hart & Joe Bonamassa\\''", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'WM/AlbumTitle'", "]", ",", "[", "'Don\\'t Explain'", "]", ",", "'asf.WM/AlbumTitle => common.albumtitle = \\'Don\\'t Explain\\''", ")", ";", "t", ".", "deepEqual", "(", "native", "[", "'WM/ARTISTS'", "]", ",", "[", "'Joe Bonamassa'", ",", "'Beth Hart'", "]", ",", "'asf.WM/ARTISTS => common.artists = [\\'Joe Bonamassa\\', \\'Beth Hart\\']'", ")", ";", "t", ".", "isDefined", "(", "native", "[", "'WM/Picture'", "]", ",", "'Contains WM/Picture'", ")", ";", "t", ".", "strictEqual", "(", "native", "[", "'WM/Picture'", "]", ".", "length", ",", "1", ",", "'Contains 1 WM/Picture'", ")", ";", "}", "const", "metadata", "=", "await", "parseFile", "(", "filePath", ")", ";", "t", ".", "isDefined", "(", "metadata", ",", "'should return metadata'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ",", "'should return metadata.native'", ")", ";", "t", ".", "isDefined", "(", "metadata", ".", "native", ".", "asf", ",", "'should include native asf tags'", ")", ";", "checkFormat", "(", "metadata", ".", "format", ")", ";", "check_asf_Tags", "(", "orderTags", "(", "metadata", ".", "native", ".", "asf", ")", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 8, null, 3940, null, null, null, null, null, null, null, null, null, 8, null, 3940, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 12, null, null, null, 422, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 3940, null, 36824, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 22604, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 22604, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 22604, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, 10350, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 22604, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, 10350, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, 10350, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, 10350, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 22604, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 4, null, 10350, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 22604, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661909
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "const", "t", "=", "assert", ";", "const", "samplePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ")", ";", "describe", "(", "'Add, change and fix some mappings #pr-544'", ",", "(", ")", "=>", "{", "describe", "(", "'Movement Name'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "movement", ",", "'Movement Name'", ",", "'metadata.common.movement'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "movement", ",", "'Movement Name'", ",", "'metadata.common.movement'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Movement Index'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "movementIndex", ",", "{", "no", ":", "1", ",", "of", ":", "4", "}", ",", "'metadata.common.movementIndex'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "movementIndex", ",", "{", "no", ":", "1", ",", "of", ":", "4", "}", ",", "'metadata.common.movementIndex'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Show Movement'", ",", "(", ")", "=>", "{", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "showMovement", ",", "true", ",", "'metadata.common.showMovement'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Work'", ",", "(", ")", "=>", "{", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "work", ",", "'Work'", ",", "'metadata.common.work'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Podcast'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "podcast", ",", "true", ",", "'metadata.common.podcast'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "podcast", ",", "true", ",", "'metadata.common.podcast'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Podcast Category'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "category", ",", "[", "'Podcast Category'", "]", ",", "'metadata.common.category'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "category", ",", "[", "'Podcast Category'", "]", ",", "'metadata.common.category'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Podcast Identifier'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "podcastId", ",", "'1234'", ",", "'metadata.common.podcastId'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "podcastId", ",", "'1234'", ",", "'metadata.common.podcastId'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Podcast Keywords'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "keywords", ",", "[", "'Podcast Keywords'", "]", ",", "'metadata.common.keywords'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "keywords", ",", "[", "'Podcast Keywords'", "]", ",", "'metadata.common.keywords'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Podcast Url'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "podcasturl", ",", "'http://podcast.url'", ",", "'metadata.common.podcasturl'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "podcasturl", ",", "'http://podcast.url'", ",", "'metadata.common.podcasturl'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Short Description'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "subtitle", ",", "[", "'Short Description'", "]", ",", "'metadata.common.subscription'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "description", ",", "[", "'Short Description'", "]", ",", "'metadata.common.subscription'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Long Description'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "description", ",", "[", "'Long Description'", "]", ",", "'metadata.common.description'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "longDescription", ",", "'Long Description'", ",", "'metadata.common.description'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Album Artist Sort'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "albumartistsort", ",", "'Album Artist Sort'", ",", "'metadata.common.albumartistsort'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "albumartistsort", ",", "'Album Artist Sort'", ",", "'metadata.common.albumartistsort'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Album Sort'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "albumsort", ",", "'Album Sort'", ",", "'metadata.common.albumsort'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "albumsort", ",", "'Album Sort'", ",", "'metadata.common.albumsort'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Artist Sort'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "artistsort", ",", "'Artist Sort'", ",", "'metadata.common.artistsort'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "artistsort", ",", "'Artist Sort'", ",", "'metadata.common.artistsort'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Composer Sort'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "composersort", ",", "'Composer Sort'", ",", "'metadata.common.composersort'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "composersort", ",", "'Composer Sort'", ",", "'metadata.common.composersort'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Title Sort'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "titlesort", ",", "'Title Sort'", ",", "'metadata.common.titlesort'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "titlesort", ",", "'Title Sort'", ",", "'metadata.common.titlesort'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Copyright'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "copyright", ",", "'Copyright'", ",", "'metadata.common.copyright'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "copyright", ",", "'Copyright'", ",", "'metadata.common.copyright'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Compilation'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "compilation", ",", "true", ",", "'metadata.common.compilation'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "compilation", ",", "true", ",", "'metadata.common.compilation'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Comment'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "comment", ",", "[", "'Tagged with Mp3tag v3.01'", "]", ",", "'metadata.common.comment'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "deepEqual", "(", "metadata", ".", "common", ".", "comment", ",", "[", "'Tagged with Mp3tag v3.01'", "]", ",", "'metadata.common.comment'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Release time'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "date", ",", "'2020-06-29T00:00:00.000Z'", ",", "'metadata.common.date'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "year", ",", "2020", ",", "'metadata.common.year'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "date", ",", "'2020-06-29T00:00:00.000Z'", ",", "'metadata.common.date'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "year", ",", "2020", ",", "'metadata.common.year'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Original Album'", ",", "(", ")", "=>", "{", "it", "(", "'mp3-id3v24'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp3/pr-544-id3v24.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "originalalbum", ",", "'Original Album'", ",", "'metadata.common.originalalbum'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'iTunes Video Quality'", ",", "(", ")", "=>", "{", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "hdVideo", ",", "2", ",", "'metadata.common.hdVideo'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'iTunes Media Type'", ",", "(", ")", "=>", "{", "it", "(", "'mp4'", ",", "(", ")", "=>", "{", "const", "filename", "=", "'mp4/pr-544.m4a'", ";", "const", "filePath", "=", "path", ".", "join", "(", "samplePath", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "t", ".", "strictEqual", "(", "metadata", ".", "common", ".", "stik", ",", "9", ",", "'metadata.common.stik'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661910
[ "import", "{", "assert", "}", "from", "\"chai\"", ";", "import", "*", "as", "path", "from", "\"path\"", ";", "import", "{", "Parsers", "}", "from", "'./metadata-parsers'", ";", "const", "t", "=", "assert", ";", "describe", "(", "\"should calculate duration for a CBR encoded MP3\"", ",", "(", ")", "=>", "{", "const", "filename", "=", "\"regress-GH-56.mp3\"", ";", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "\"samples\"", ",", "filename", ")", ";", "Parsers", ".", "forEach", "(", "parser", "=>", "{", "it", "(", "parser", ".", "description", ",", "(", ")", "=>", "{", "return", "parser", ".", "initParser", "(", "filePath", ",", "'audio/mpeg'", ")", ".", "then", "(", "metadata", "=>", "{", "const", "expectedTags", "=", "(", "parser", ".", "description", "===", "'parseFile'", "||", "parser", ".", "description", "===", "'parseBuffer'", ")", "?", "[", "'ID3v2.3'", ",", "'APEv2'", "]", ":", "[", "'ID3v2.3'", "]", ";", "t", ".", "deepEqual", "(", "metadata", ".", "format", ".", "tagTypes", ",", "expectedTags", ",", "'format.tagTypes'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "sampleRate", ",", "44100", ",", "\"format.sampleRate\"", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "duration", ",", "16462080", "/", "metadata", ".", "format", ".", "sampleRate", ",", "\"format.duration\"", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'_parseFile'", ",", "(", ")", "=>", "{", "const", "parser", "=", "Parsers", "[", "0", "]", ";", "return", "parser", ".", "initParser", "(", "filePath", ",", "'audio/mpeg'", ")", ".", "then", "(", "metadata", "=>", "{", "const", "expectedTags", "=", "(", "parser", ".", "description", "===", "'parseFile'", "||", "parser", ".", "description", "===", "'parseBuffer'", ")", "?", "[", "'ID3v2.3'", ",", "'APEv2'", "]", ":", "[", "'ID3v2.3'", "]", ";", "t", ".", "deepEqual", "(", "metadata", ".", "format", ".", "tagTypes", ",", "expectedTags", ",", "'format.tagTypes'", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "sampleRate", ",", "44100", ",", "\"format.sampleRate\"", ")", ";", "t", ".", "strictEqual", "(", "metadata", ".", "format", ".", "duration", ",", "16462080", "/", "metadata", ".", "format", ".", "sampleRate", ",", "\"format.duration\"", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661911
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "path", "from", "'path'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "{", "TagType", "}", "from", "'../lib/common/GenericTagTypes'", ";", "interface", "IReplayGainSample", "{", "description", ":", "string", ";", "filename", ":", "string", ";", "container", ":", "string", ";", "tagType", ":", "TagType", ";", "track", "?", ":", "{", "gain", ":", "number", ";", "peak", ":", "number", ";", "}", ";", "album", "?", ":", "{", "gain", ":", "number", ";", "peak", ":", "number", ";", "}", ";", "}", "const", "samples", "=", "[", "{", "description", ":", "'album'", ",", "filename", ":", "'id3v23-txxx-album.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "-", "24", ",", "peak", ":", "0", "}", ",", "album", ":", "{", "gain", ":", "-", "12", ",", "peak", ":", "0", "}", "}", ",", "{", "description", ":", "'album-nopeak'", ",", "filename", ":", "'id3v23-txxx-album-nopeak.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "24", ",", "peak", ":", "-", "12", "}", ",", "album", ":", "{", "gain", ":", "12", ",", "peak", ":", "0", "}", "}", ",", "{", "description", ":", "'case sensitivity'", ",", "filename", ":", "'id3v23-txxx-case.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "-", "12", ",", "peak", ":", "0", "}", ",", "album", ":", "{", "gain", ":", "-", "24", ",", "peak", ":", "0", "}", "}", ",", "{", "description", ":", "'latin-1'", ",", "filename", ":", "'id3v23-txxx-latin1.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "12", ",", "peak", ":", "-", "6", "}", "}", ",", "{", "description", ":", "'peak'", ",", "filename", ":", "'id3v23-txxx-peak.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "0", ",", "peak", ":", "6.0", "}", ",", "album", ":", "{", "gain", ":", "0", ",", "peak", ":", "12.0", "}", "}", ",", "{", "description", ":", "'track'", ",", "filename", ":", "'id3v23-txxx-track.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "-", "12", ",", "peak", ":", "0", "}", ",", "album", ":", "{", "gain", ":", "-", "24", ",", "peak", ":", "0", "}", "}", ",", "{", "description", ":", "'track-nopeak'", ",", "filename", ":", "'id3v23-txxx-track-nopeak.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "12", ",", "peak", ":", "0", "}", ",", "album", ":", "{", "gain", ":", "0", ",", "peak", ":", "6", "}", "}", ",", "{", "description", ":", "'track-only'", ",", "filename", ":", "'id3v23-txxx-track-only.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.3'", ",", "track", ":", "{", "gain", ":", "12", ",", "peak", ":", "-", "6", "}", "}", ",", "{", "description", ":", "'album'", ",", "filename", ":", "'id3v24-txxx-album.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.4'", ",", "track", ":", "{", "gain", ":", "-", "24", ",", "peak", ":", "0", "}", ",", "album", ":", "{", "gain", ":", "-", "12", ",", "peak", ":", "0", "}", "}", ",", "{", "description", ":", "'track'", ",", "filename", ":", "'id3v24-txxx-track.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.4'", ",", "track", ":", "{", "gain", ":", "-", "12", ",", "peak", ":", "0", "}", ",", "album", ":", "{", "gain", ":", "-", "24", ",", "peak", ":", "0", "}", "}", ",", "{", "description", ":", "'track-only'", ",", "filename", ":", "'id3v24-txxx-track-only.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.4'", ",", "track", ":", "{", "gain", ":", "12", ",", "peak", ":", "-", "6", "}", "}", ",", "{", "description", ":", "'utf8'", ",", "filename", ":", "'id3v24-txxx-track-only.mp3'", ",", "container", ":", "'MPEG'", ",", "tagType", ":", "'ID3v2.4'", ",", "track", ":", "{", "gain", ":", "12", ",", "peak", ":", "-", "6", "}", "}", ",", "{", "description", ":", "'utf8'", ",", "filename", ":", "'vorbis.flac'", ",", "container", ":", "'FLAC'", ",", "tagType", ":", "'vorbis'", ",", "track", ":", "{", "gain", ":", "-", "3.26", ",", "peak", ":", "-", "5.19595", "}", ",", "album", ":", "{", "gain", ":", "-", "3.26", ",", "peak", ":", "-", "5.19595", "}", "}", "]", ";", "/**\n * Samples provided by: https://github.com/kepstin/replaygain-test-vectors\n */", "describe", "(", "'Test Replay-Gain'", ",", "(", ")", "=>", "{", "const", "pathGainSamples", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'replay-gain'", ")", ";", "samples", ".", "forEach", "(", "sample", "=>", "{", "it", "(", "`Test ${", "sample", ".", "description", "}, mapping from tag header: ${", "sample", ".", "tagType", "}`", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "pathGainSamples", ",", "sample", ".", "filename", ")", ";", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "const", "{", "format", ",", "common", "}", "=", "metadata", ";", "assert", ".", "strictEqual", "(", "format", ".", "container", ",", "sample", ".", "container", ",", "'format.container'", ")", ";", "assert", ".", "deepEqual", "(", "format", ".", "tagTypes", ",", "[", "sample", ".", "tagType", "]", ",", "'format.tagTypes'", ")", ";", "const", "d", "=", "1", "/", "1000", ";", "if", "(", "sample", ".", "track", ")", "{", "assert", ".", "approximately", "(", "common", ".", "replaygain_track_gain", ".", "dB", ",", "sample", ".", "track", ".", "gain", ",", "d", ",", "'replay-gain: track gain'", ")", ";", "assert", ".", "approximately", "(", "common", ".", "replaygain_track_peak", ".", "dB", ",", "sample", ".", "track", ".", "peak", ",", "d", ",", "'replay-gain: track peak'", ")", ";", "}", "else", "{", "assert", ".", "isUndefined", "(", "common", ".", "replaygain_track_gain", ",", "'replay-gain: track gain'", ")", ";", "assert", ".", "isUndefined", "(", "common", ".", "replaygain_track_peak", ",", "'replay-gain: track peak'", ")", ";", "}", "if", "(", "sample", ".", "album", ")", "{", "assert", ".", "approximately", "(", "common", ".", "replaygain_album_gain", ".", "dB", ",", "sample", ".", "album", ".", "gain", ",", "d", ",", "'replay-gain: album gain'", ")", ";", "assert", ".", "approximately", "(", "common", ".", "replaygain_album_peak", ".", "dB", ",", "sample", ".", "album", ".", "peak", ",", "d", ",", "'replay-gain: album peak'", ")", ";", "}", "else", "{", "assert", ".", "isUndefined", "(", "common", ".", "replaygain_album_gain", ",", "'replay-gain: album gain'", ")", ";", "assert", ".", "isUndefined", "(", "common", ".", "replaygain_album_peak", ",", "'replay-gain: album peak'", ")", ";", "}", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661912
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "import", "{", "ratioToDb", ",", "dbToRatio", ",", "toRatio", "}", "from", "'../lib/common/Util'", ";", "describe", "(", "\"Decode replaygain tags\"", ",", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "'04 Long Drive.flac'", ")", ";", "it", "(", "'Convert ratio to dB'", ",", "(", ")", "=>", "{", "assert", ".", "approximately", "(", "ratioToDb", "(", "0.99914551", ")", ",", "-", "0.00371259", ",", "0.000000005", ")", ";", "}", ")", ";", "it", "(", "'Convert dB to ratio'", ",", "(", ")", "=>", "{", "assert", ".", "approximately", "(", "dbToRatio", "(", "-", "7.03", ")", ",", "0.19815270", ",", "0.000000005", ")", ";", "}", ")", ";", "it", "(", "'Convert dB string value to IRatio'", ",", "(", ")", "=>", "{", "assert", ".", "deepEqual", "(", "toRatio", "(", "'-7.03 dB'", ")", ",", "{", "dB", ":", "-", "7.03", ",", "ratio", ":", "0.1981527025805098", "}", ")", ";", "assert", ".", "deepEqual", "(", "toRatio", "(", "'xxx'", ")", ",", "{", "dB", ":", "NaN", ",", "ratio", ":", "NaN", "}", ")", ";", "}", ")", ";", "it", "(", "'should decode replaygain tags from FLAC/Vorbis'", ",", "async", "(", ")", "=>", "{", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "metadata", "=>", "{", "assert", ".", "deepEqual", "(", "metadata", ".", "common", ".", "replaygain_track_gain", ",", "{", "dB", ":", "-", "7.03", ",", "ratio", ":", "0.1981527025805098", "}", ",", "'replaygain_track_gain.ratio'", ")", ";", "assert", ".", "deepEqual", "(", "metadata", ".", "common", ".", "replaygain_track_peak", ",", "{", "dB", ":", "-", "0.0037125893296365503", ",", "ratio", ":", "0.99914551", "}", ",", "'replaygain_track_peak.ratio = -0.00371259 dB'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661913
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "import", "{", "TrackType", "}", "from", "'../lib/type'", ";", "const", "path_samples", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ")", ";", "describe", "(", "'format.trackInfo'", ",", "(", ")", "=>", "{", "describe", "(", "'Containers'", ",", "(", ")", "=>", "{", "describe", "(", "'ASF'", ",", "(", ")", "=>", "{", "const", "path_asf", "=", "path", ".", "join", "(", "path_samples", ",", "'asf'", ")", ";", "it", "(", "'wma'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "path_asf", ",", "'issue_57.wma'", ")", ";", "const", "{", "format", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "includeDeepOrderedMembers", "(", "format", ".", "trackInfo", ",", "[", "{", "codecName", ":", "'Windows Media Audio 9.2'", ",", "type", ":", "TrackType", ".", "audio", "}", "]", ",", "'format.trackInfo'", ")", ";", "}", ")", ";", "it", "(", "'elephant.asf'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "path_asf", ",", "'elephant.asf'", ")", ";", "const", "{", "format", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "includeDeepOrderedMembers", "(", "format", ".", "trackInfo", ",", "[", "{", "codecName", ":", "'Windows Media Audio V2'", ",", "type", ":", "TrackType", ".", "audio", "}", ",", "{", "codecName", ":", "'Microsoft MPEG-4 Video Codec V3'", ",", "type", ":", "TrackType", ".", "video", "}", "]", ",", "'format.trackInfo'", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'Matroska'", ",", "(", ")", "=>", "{", "it", "(", "'WebM'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "path_samples", ",", "'matroska'", ",", "'big-buck-bunny_trailer-short.vp8.webm'", ")", ";", "const", "{", "format", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "includeDeepOrderedMembers", "(", "format", ".", "trackInfo", ",", "[", "{", "audio", ":", "undefined", ",", "codecName", ":", "'VP8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "undefined", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "undefined", ",", "language", ":", "undefined", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "video", ",", "video", ":", "{", "displayHeight", ":", "360", ",", "displayWidth", ":", "640", ",", "pixelHeight", ":", "360", ",", "pixelWidth", ":", "640", "}", "}", ",", "{", "audio", ":", "{", "samplingFrequency", ":", "44100", "}", ",", "codecName", ":", "'VORBIS'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "undefined", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "undefined", ",", "language", ":", "undefined", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "audio", ",", "video", ":", "undefined", "}", "]", ",", "'format.trackInfo'", ")", ";", "}", ")", ";", "it", "(", "'matroska-test-w1-test5-short.mkv'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "path_samples", ",", "'matroska'", ",", "'matroska-test-w1-test5-short.mkv'", ")", ";", "const", "{", "format", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "includeDeepOrderedMembers", "(", "format", ".", "trackInfo", ",", "[", "{", "audio", ":", "undefined", ",", "codecName", ":", "'MPEG4/ISO/AVC'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "undefined", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'und'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "video", ",", "video", ":", "{", "displayHeight", ":", "576", ",", "displayWidth", ":", "1024", ",", "pixelHeight", ":", "576", ",", "pixelWidth", ":", "1024", "}", "}", ",", "{", "audio", ":", "{", "channels", ":", "2", ",", "samplingFrequency", ":", "48000", "}", ",", "codecName", ":", "'AAC'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "undefined", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "undefined", ",", "language", ":", "'und'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "audio", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "undefined", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "undefined", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'hun'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'ger'", ",", "name", ":", "undefined", ",", "type", ":", "17", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'fre'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'spa'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "name", ":", "undefined", ",", "language", ":", "'ita'", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "{", "outputSamplingFrequency", ":", "44100", ",", "samplingFrequency", ":", "22050", "}", ",", "codecName", ":", "'AAC'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "undefined", ",", "language", ":", "undefined", ",", "name", ":", "'Commentary'", ",", "type", ":", "TrackType", ".", "audio", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'jpn'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", ",", "{", "audio", ":", "undefined", ",", "codecName", ":", "'S_TEXT/UTF8'", ",", "codecSettings", ":", "undefined", ",", "flagDefault", ":", "false", ",", "flagEnabled", ":", "undefined", ",", "flagLacing", ":", "false", ",", "language", ":", "'und'", ",", "name", ":", "undefined", ",", "type", ":", "TrackType", ".", "subtitle", ",", "video", ":", "undefined", "}", "]", ",", "'format.trackInfo'", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'MPEG-4'", ",", "(", ")", "=>", "{", "it", "(", "'.mp4: \"Mr. Pickles S02E07 My Dear Boy.mp4\"'", ",", "async", "(", ")", "=>", "{", "const", "filePath", "=", "path", ".", "join", "(", "path_samples", ",", "'mp4'", ",", "'Mr. Pickles S02E07 My Dear Boy.mp4'", ")", ";", "const", "{", "format", "}", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "assert", ".", "includeDeepOrderedMembers", "(", "format", ".", "trackInfo", ",", "[", "{", "audio", ":", "{", "bitDepth", ":", "16", ",", "channels", ":", "2", ",", "samplingFrequency", ":", "48000", "}", ",", "codecName", ":", "'MPEG-4/AAC'", ",", "type", ":", "TrackType", ".", "audio", "}", ",", "{", "audio", ":", "{", "bitDepth", ":", "0", ",", "channels", ":", "0", ",", "samplingFrequency", ":", "1916.1076", "}", ",", "codecName", ":", "'<avc1>'", ",", "type", ":", "TrackType", ".", "audio", "}", ",", "{", "audio", ":", "{", "bitDepth", ":", "16", ",", "channels", ":", "2", ",", "samplingFrequency", ":", "48000", "}", ",", "codecName", ":", "'AC-3'", ",", "type", ":", "TrackType", ".", "audio", "}", ",", "{", "codecName", ":", "'CEA-608'", "}", "]", ",", "'format.trackInfo'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661914
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "const", "t", "=", "assert", ";", "it", "(", "'ID3v2.4'", ",", "async", "(", ")", "=>", "{", "const", "filename", "=", "'29 - Dominator.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "filename", ")", ";", "const", "metadata", "=", "await", "mm", ".", "parseFile", "(", "filePath", ")", ";", "const", "nativeTags", "=", "mm", ".", "orderTags", "(", "metadata", ".", "native", "[", "'ID3v2.3'", "]", ")", ";", "t", ".", "equal", "(", "nativeTags", ".", "UFID", ".", "length", ",", "1", ")", ";", "t", ".", "deepEqual", "(", "nativeTags", ".", "UFID", "[", "0", "]", ",", "{", "owner_identifier", ":", "'http://musicbrainz.org'", ",", "identifier", ":", "Buffer", ".", "from", "(", "[", "0x33", ",", "0x66", ",", "0x32", ",", "0x33", ",", "0x66", ",", "0x32", ",", "0x63", ",", "0x66", ",", "0x2d", ",", "0x32", ",", "0x61", ",", "0x34", ",", "0x36", ",", "0x2d", ",", "0x34", ",", "0x38", ",", "0x65", ",", "0x63", ",", "0x2d", ",", "0x38", ",", "0x36", ",", "0x33", ",", "0x65", ",", "0x2d", ",", "0x36", ",", "0x65", ",", "0x63", ",", "0x34", ",", "0x33", ",", "0x31", ",", "0x62", ",", "0x35", ",", "0x66", ",", "0x65", ",", "0x63", ",", "0x61", "]", ")", "}", ",", "'UFID'", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661915
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "const", "t", "=", "assert", ";", "import", "*", "as", "path", "from", "'path'", ";", "it", "(", "\"should be able to read metadata with unknown encoding\"", ",", "(", ")", "=>", "{", "const", "filename", "=", "'bug-unkown encoding.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "result", "=>", "{", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "title", ",", "'808'", ",", "'title'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "artist", ",", "'Benga'", ",", "'artist'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "albumartist", ",", "'Benga'", ",", "'albumartist'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "album", ",", "'Phaze One'", ",", "'album'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "year", ",", "2010", ",", "'year'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "track", ".", "no", ",", "4", ",", "'track no'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "track", ".", "of", ",", "8", ",", "'track of'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "genre", "[", "0", "]", ",", "'Dubstep'", ",", "'genre'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "picture", "[", "0", "]", ".", "format", ",", "'image/jpeg'", ",", "'picture format'", ")", ";", "t", ".", "strictEqual", "(", "result", ".", "common", ".", "picture", "[", "0", "]", ".", "data", ".", "length", ",", "6761", ",", "'picture length'", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661916
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "mm", "from", "'../lib'", ";", "import", "*", "as", "path", "from", "'path'", ";", "const", "t", "=", "assert", ";", "it", "(", "\"should read utf16bom (big endian) encoded metadata correctly\"", ",", "(", ")", "=>", "{", "const", "filename", "=", "'bug-utf16bom-encoding.mp3'", ";", "const", "filePath", "=", "path", ".", "join", "(", "__dirname", ",", "'samples'", ",", "filename", ")", ";", "return", "mm", ".", "parseFile", "(", "filePath", ")", ".", "then", "(", "result", "=>", "{", "t", ".", "equal", "(", "result", ".", "common", ".", "title", ",", "\"It's All Over You Know\"", ",", "'title'", ")", ";", "t", ".", "equal", "(", "result", ".", "common", ".", "artist", ",", "'The Apers'", ",", "'artist'", ")", ";", "t", ".", "deepEqual", "(", "result", ".", "common", ".", "artists", ",", "[", "'The Apers'", "]", ",", "'artist'", ")", ";", "t", ".", "equal", "(", "result", ".", "common", ".", "albumartist", ",", "'The Apers'", ",", "'albumartist'", ")", ";", "t", ".", "equal", "(", "result", ".", "common", ".", "album", ",", "'Reanimate My Heart'", ",", "'album'", ")", ";", "t", ".", "equal", "(", "result", ".", "common", ".", "year", ",", "2007", ",", "'year'", ")", ";", "t", ".", "deepEqual", "(", "result", ".", "common", ".", "track", ",", "{", "no", ":", "1", ",", "of", ":", "null", "}", ",", "'track'", ")", ";", "t", ".", "deepEqual", "(", "result", ".", "common", ".", "genre", ",", "[", "'Punk Rock'", "]", ",", "'genre'", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661917
[ "import", "{", "assert", "}", "from", "'chai'", ";", "import", "*", "as", "util", "from", "'../lib/common/Util'", ";", "import", "{", "FourCcToken", "}", "from", "\"../lib/common/FourCC\"", ";", "const", "t", "=", "assert", ";", "describe", "(", "\"shared utility functionality\"", ",", "(", ")", "=>", "{", "describe", "(", "\"find zero\"", ",", "(", ")", "=>", "{", "const", "findZero", "=", "util", ".", "findZero", ";", "it", "(", "\"should find terminator in ascii encoded string\"", ",", "(", ")", "=>", "{", "const", "buf", "=", "Buffer", ".", "from", "(", "[", "0xFF", ",", "0xFF", ",", "0xFF", ",", "0x00", "]", ")", ";", "t", ".", "equal", "(", "findZero", "(", "buf", ",", "0", ",", "buf", ".", "length", ",", "'ascii'", ")", ",", "3", ")", ";", "}", ")", ";", "it", "(", "\"find terminator in middle of ascii encoded string\"", ",", "(", ")", "=>", "{", "const", "buf", "=", "Buffer", ".", "from", "(", "[", "0xFF", ",", "0xFF", ",", "0x00", ",", "0xFF", ",", "0xFF", "]", ")", ";", "t", ".", "equal", "(", "findZero", "(", "buf", ",", "0", ",", "buf", ".", "length", ",", "'ascii'", ")", ",", "2", ")", ";", "}", ")", ";", "it", "(", "\"return offset to end if nothing is found\"", ",", "(", ")", "=>", "{", "const", "buf", "=", "Buffer", ".", "from", "(", "[", "0xFF", ",", "0xFF", ",", "0xFF", ",", "0xFF", ",", "0xFF", "]", ")", ";", "t", ".", "equal", "(", "findZero", "(", "buf", ",", "0", ",", "buf", ".", "length", ",", "'ascii'", ")", ",", "buf", ".", "length", ")", ";", "}", ")", ";", "it", "(", "\"find terminator in utf16le encoded string\"", ",", "(", ")", "=>", "{", "const", "buf", "=", "Buffer", ".", "from", "(", "[", "0x68", ",", "0x00", ",", "0x65", ",", "0x00", ",", "0x6C", ",", "0x00", ",", "0x6C", ",", "0x00", ",", "0x6F", ",", "0x00", ",", "0x00", ",", "0x00", "]", ")", ";", "t", ".", "equal", "(", "findZero", "(", "buf", ",", "0", ",", "buf", ".", "length", ",", "'utf16le'", ")", ",", "10", ")", ";", "}", ")", ";", "it", "(", "\"find terminator in utf16be encoded string\"", ",", "(", ")", "=>", "{", "const", "buf", "=", "Buffer", ".", "from", "(", "[", "0x00", ",", "0x68", ",", "0x00", ",", "0x65", ",", "0x00", ",", "0x6C", ",", "0x00", ",", "0x6C", ",", "0x00", ",", "0x00", "]", ")", ";", "t", ".", "equal", "(", "findZero", "(", "buf", ",", "0", ",", "buf", ".", "length", ",", "'utf16le'", ")", ",", "8", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "\"stripNulls\"", ",", "(", ")", "=>", "{", "it", "(", "\"should strip nulls\"", ",", "(", ")", "=>", "{", "const", "tests", "=", "[", "{", "str", ":", "\"foo\"", ",", "expected", ":", "\"foo\"", "}", ",", "{", "str", ":", "\"derp\\x00\\x00\"", ",", "expected", ":", "\"derp\"", "}", ",", "{", "str", ":", "\"\\x00\\x00harkaaa\\x00\"", ",", "expected", ":", "\"harkaaa\"", "}", ",", "{", "str", ":", "\"\\x00joystick\"", ",", "expected", ":", "\"joystick\"", "}", "]", ";", "tests", ".", "forEach", "(", "test", "=>", "{", "t", ".", "strictEqual", "(", "util", ".", "stripNulls", "(", "test", ".", "str", ")", ",", "test", ".", "expected", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "\"FourCC token\"", ",", "(", ")", "=>", "{", "const", "testData", "=", "[", "{", "fourCC", ":", "'\\x00\\x00\\x00\\x00'", ",", "valid", ":", "false", "}", ",", "{", "fourCC", ":", "'WAVE'", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "'fmt '", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "'fmt\\x00'", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "'----'", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "'-\\x00\\x00\\x00'", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "'©nam'", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "'(c) '", ",", "valid", ":", "true", "}", ",", "{", "fourCC", ":", "' XML'", ",", "valid", ":", "false", "}", ",", "{", "fourCC", ":", "' XM '", ",", "valid", ":", "false", "}", "]", ";", "it", "(", "\"should only accept a valid identifier, otherwise is should throw an error\"", ",", "(", ")", "=>", "{", "for", "(", "const", "data", "of", "testData", ")", "{", "const", "buf", "=", "Buffer", ".", "from", "(", "data", ".", "fourCC", ",", "\"ascii\"", ")", ";", "let", "valid", ";", "let", "fourCC", ";", "try", "{", "fourCC", "=", "FourCcToken", ".", "get", "(", "buf", ",", "0", ")", ";", "valid", "=", "true", ";", "}", "catch", "(", "e", ")", "{", "valid", "=", "false", ";", "}", "t", ".", "strictEqual", "(", "valid", ",", "data", ".", "valid", ",", "`FourCC: ${", "util", ".", "a2hex", "(", "data", ".", "fourCC", ")", "} \"${", "data", ".", "fourCC", "}\"`", ")", ";", "if", "(", "data", ".", "valid", ")", "{", "t", ".", "strictEqual", "(", "fourCC", ",", "data", ".", "fourCC", ")", ";", "}", "}", "}", ")", ";", "it", "(", "\"should be able to encode FourCC token\"", ",", "(", ")", "=>", "{", "const", "buffer", "=", "Buffer", ".", "alloc", "(", "4", ")", ";", "FourCcToken", ".", "put", "(", "buffer", ",", "0", ",", "'abcd'", ")", ";", "t", ".", "deepEqual", "(", "buffer", ".", "toString", "(", "'binary'", ")", ",", "'abcd'", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "\"a2hex\"", ",", "(", ")", "=>", "{", "t", ".", "equal", "(", "util", ".", "a2hex", "(", "\"\\x00\\x01ABC\\x02\"", ")", ",", "'00 01 41 42 43 02'", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2040, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661918
[ "export", "const", "CSV_SEPARATOR_SETTING", "=", "'csv:separator'", ";", "export", "const", "CSV_QUOTE_VALUES_SETTING", "=", "'csv:quoteValues'", ";" ]
[ null, null, 2, null, null, null, null, null, 2, null, null, null ]
661919
[ "import", "url", "from", "'url'", ";", "import", "{", "HttpStart", "}", "from", "'opensearch-dashboards/public'", ";", "import", "{", "CREATE_PATH", ",", "getGotoPath", "}", "from", "'../../common/short_url_routes'", ";", "export", "async", "function", "shortenUrl", "(", "absoluteUrl", ",", "{", "basePath", ",", "post", "}", ")", "{", "const", "parsedUrl", "=", "url", ".", "parse", "(", "absoluteUrl", ")", ";", "if", "(", "!", "parsedUrl", "||", "!", "parsedUrl", ".", "path", ")", "{", "return", ";", "}", "const", "path", "=", "parsedUrl", ".", "path", ".", "replace", "(", "basePath", ",", "''", ")", ";", "const", "hash", "=", "parsedUrl", ".", "hash", "?", "parsedUrl", ".", "hash", ":", "''", ";", "const", "relativeUrl", "=", "path", "+", "hash", ";", "const", "body", "=", "JSON", ".", "stringify", "(", "{", "url", ":", "relativeUrl", "}", ")", ";", "const", "resp", "=", "await", "post", "(", "CREATE_PATH", ",", "{", "body", "}", ")", ";", "return", "url", ".", "format", "(", "{", "protocol", ":", "parsedUrl", ".", "protocol", ",", "host", ":", "parsedUrl", ".", "host", ",", "pathname", ":", "`${", "basePath", "}${", "getGotoPath", "(", "resp", ".", "urlId", ")", "}`", ",", "}", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661920
[ "import", "React", ",", "{", "Component", "}", "from", "'react'", ";", "import", "{", "I18nProvider", "}", "from", "'@osd/i18n/react'", ";", "import", "{", "i18n", "}", "from", "'@osd/i18n'", ";", "import", "{", "EuiContextMenu", ",", "EuiContextMenuPanelDescriptor", "}", "from", "'@elastic/eui'", ";", "import", "{", "HttpStart", "}", "from", "'opensearch-dashboards/public'", ";", "import", "{", "UrlPanelContent", "}", "from", "'./url_panel_content'", ";", "import", "{", "ShareMenuItem", ",", "ShareContextMenuPanelItem", ",", "UrlParamExtension", "}", "from", "'../types'", ";", "interface", "Props", "{", "allowEmbed", ":", "boolean", ";", "allowShortUrl", ":", "boolean", ";", "objectId", "?", ":", "string", ";", "objectType", ":", "string", ";", "shareableUrl", "?", ":", "string", ";", "shareMenuItems", ":", "ShareMenuItem", "[", "]", ";", "sharingData", ":", "any", ";", "onClose", ":", "(", ")", "=>", "void", ";", "basePath", ":", "string", ";", "post", ":", "HttpStart", "[", "'post'", "]", ";", "embedUrlParamExtensions", "?", ":", "UrlParamExtension", "[", "]", ";", "}", "export", "class", "ShareContextMenu", "extends", "Component", "<", "Props", ">", "{", "public", "render", "(", ")", "{", "const", "{", "panels", ",", "initialPanelId", "}", "=", "this", ".", "getPanels", "(", ")", ";", "return", "(", "<", "I18nProvider", ">", "<", "EuiContextMenu", "initialPanelId", "=", "{", "initialPanelId", "}", "panels", "=", "{", "panels", "}", "data", "-", "test", "-", "subj", "=", "\"shareContextMenu\"", "/", ">", "<", "/I18nProvider>);", "}", "private", "getPanels", "=", "(", ")", "=>", "{", "const", "panels", "=", "[", "]", ";", "const", "menuItems", "=", "[", "]", ";", "const", "permalinkPanel", "=", "{", "id", ":", "panels", ".", "length", "+", "1", ",", "title", ":", "i18n", ".", "translate", "(", "'share.contextMenu.permalinkPanelTitle'", ",", "{", "defaultMessage", ":", "'Permalink'", ",", "}", ")", ",", "content", ":", "(", "<", "UrlPanelContent", "allowShortUrl", "=", "{", "this", ".", "props", ".", "allowShortUrl", "}", "objectId", "=", "{", "this", ".", "props", ".", "objectId", "}", "objectType", "=", "{", "this", ".", "props", ".", "objectType", "}", "basePath", "=", "{", "this", ".", "props", ".", "basePath", "}", "post", "=", "{", "this", ".", "props", ".", "post", "}", "shareableUrl", "=", "{", "this", ".", "props", ".", "shareableUrl", "}", "/", ">", ")", ",", "}", ";", "menuItems", ".", "push", "(", "{", "name", ":", "i18n", ".", "translate", "(", "'share.contextMenu.permalinksLabel'", ",", "{", "defaultMessage", ":", "'Permalinks'", ",", "}", ")", ",", "icon", ":", "'link'", ",", "panel", ":", "permalinkPanel", ".", "id", ",", "sortOrder", ":", "0", ",", "}", ")", ";", "panels", ".", "push", "(", "permalinkPanel", ")", ";", "if", "(", "this", ".", "props", ".", "allowEmbed", ")", "{", "const", "embedPanel", "=", "{", "id", ":", "panels", ".", "length", "+", "1", ",", "title", ":", "i18n", ".", "translate", "(", "'share.contextMenu.embedCodePanelTitle'", ",", "{", "defaultMessage", ":", "'Embed Code'", ",", "}", ")", ",", "content", ":", "(", "<", "UrlPanelContent", "allowShortUrl", "=", "{", "this", ".", "props", ".", "allowShortUrl", "}", "isEmbedded", "objectId", "=", "{", "this", ".", "props", ".", "objectId", "}", "objectType", "=", "{", "this", ".", "props", ".", "objectType", "}", "basePath", "=", "{", "this", ".", "props", ".", "basePath", "}", "post", "=", "{", "this", ".", "props", ".", "post", "}", "shareableUrl", "=", "{", "this", ".", "props", ".", "shareableUrl", "}", "urlParamExtensions", "=", "{", "this", ".", "props", ".", "embedUrlParamExtensions", "}", "/", ">", ")", ",", "}", ";", "panels", ".", "push", "(", "embedPanel", ")", ";", "menuItems", ".", "push", "(", "{", "name", ":", "i18n", ".", "translate", "(", "'share.contextMenu.embedCodeLabel'", ",", "{", "defaultMessage", ":", "'Embed code'", ",", "}", ")", ",", "icon", ":", "'console'", ",", "panel", ":", "embedPanel", ".", "id", ",", "sortOrder", ":", "0", ",", "}", ")", ";", "}", "this", ".", "props", ".", "shareMenuItems", ".", "forEach", "(", "(", "{", "shareMenuItem", ",", "panel", "}", ")", "=>", "{", "const", "panelId", "=", "panels", ".", "length", "+", "1", ";", "panels", ".", "push", "(", "{", "...", "panel", ",", "id", ":", "panelId", ",", "}", ")", ";", "menuItems", ".", "push", "(", "{", "...", "shareMenuItem", ",", "panel", ":", "panelId", ",", "}", ")", ";", "}", ")", ";", "if", "(", "menuItems", ".", "length", ">", "1", ")", "{", "const", "topLevelMenuPanel", "=", "{", "id", ":", "panels", ".", "length", "+", "1", ",", "title", ":", "i18n", ".", "translate", "(", "'share.contextMenuTitle'", ",", "{", "defaultMessage", ":", "'Share this {objectType}'", ",", "values", ":", "{", "objectType", ":", "this", ".", "props", ".", "objectType", ",", "}", ",", "}", ")", ",", "items", ":", "menuItems", ".", "sort", "(", "(", "a", ",", "b", ")", "=>", "{", "const", "aSortOrder", "=", "a", ".", "sortOrder", "||", "0", ";", "const", "bSortOrder", "=", "b", ".", "sortOrder", "||", "0", ";", "if", "(", "aSortOrder", ">", "bSortOrder", ")", "{", "return", "1", ";", "}", "if", "(", "aSortOrder", "<", "bSortOrder", ")", "{", "return", "-", "1", ";", "}", "if", "(", "a", ".", "name", ".", "toLowerCase", "(", ")", ".", "localeCompare", "(", "b", ".", "name", ".", "toLowerCase", "(", ")", ")", ">", "0", ")", "{", "return", "1", ";", "}", "return", "-", "1", ";", "}", ")", ".", "map", "(", "(", "menuItem", ")", "=>", "{", "menuItem", "[", "'data-test-subj'", "]", "=", "`sharePanel-${", "menuItem", ".", "name", ".", "replace", "(", "' '", ",", "''", ")", "}`", ";", "delete", "menuItem", ".", "sortOrder", ";", "return", "menuItem", ";", "}", ")", ",", "}", ";", "panels", ".", "push", "(", "topLevelMenuPanel", ")", ";", "}", "const", "lastPanelIndex", "=", "panels", ".", "length", "-", "1", ";", "const", "initialPanelId", "=", "panels", "[", "lastPanelIndex", "]", ".", "id", ";", "return", "{", "panels", ",", "initialPanelId", "}", ";", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, 5, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8337, null, 8337, null, null, null, null, 3, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8337, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661921
[ "import", "{", "BehaviorSubject", "}", "from", "'rxjs'", ";", "import", "{", "skip", "}", "from", "'rxjs/operators'", ";", "import", "deepFreeze", "from", "'deep-freeze-strict'", ";", "import", "{", "PureTransitionsToTransitions", ",", "PureTransition", ",", "ReduxLikeStateContainer", ",", "PureSelectorsToSelectors", ",", "BaseState", ",", "}", "from", "'./types'", ";", "const", "$$observable", "=", "(", "typeof", "Symbol", "===", "'function'", "&&", "(", "Symbol", "as", "any", ")", ".", "observable", ")", "||", "'@@observable'", ";", "const", "$$setActionType", "=", "'@@SET'", ";", "const", "isProduction", "=", "typeof", "window", "===", "'object'", "?", "process", ".", "env", ".", "NODE_ENV", "===", "'production'", ":", "!", "process", ".", "env", ".", "NODE_ENV", "||", "process", ".", "env", ".", "NODE_ENV", "===", "'production'", ";", "const", "defaultFreeze", "=", "isProduction", "?", "<", "T", ">", "(", "value", ")", "=>", "value", "as", "T", ":", "<", "T", ">", "(", "value", ")", ":", "T", "=>", "{", "const", "isFreezable", "=", "value", "!==", "null", "&&", "typeof", "value", "===", "'object'", ";", "if", "(", "isFreezable", ")", "return", "deepFreeze", "(", "value", ")", "as", "T", ";", "return", "value", "as", "T", ";", "}", ";", "public", "export", "interface", "CreateStateContainerOptions", "{", "example", "freeze", "?", ":", "<", "T", ">", "(", "state", ":", "T", ")", "=>", "T", ";", "}", "param", "defaultState", "typeParam", "public", "export", "function", "createStateContainer", "<", "State", "extends", "BaseState", ">", "(", "defaultState", ")", ";", "param", "defaultState", "param", "pureTransitions", "- state transitions configuration object. Map of ", "PureTransition", ".\n * ", "typeParam", "public", "export", "function", "createStateContainer", "<", "State", "extends", "BaseState", ",", "PureTransitions", "extends", "object", ">", "(", "defaultState", ",", "pureTransitions", ")", ";", "param", "defaultState", "param", "pureTransitions", "- state transitions configuration object. Map of ", "PureTransition", ".\n * ", "param", "pureSelectors", "- state selectors configuration object. Map of ", "PureSelectors", ".\n * ", "param", "options", "- state container options ", "CreateStateContainerOptions", "typeParam", "public", "export", "function", "createStateContainer", "<", "State", "extends", "BaseState", ",", "PureTransitions", "extends", "object", ",", "PureSelectors", "extends", "object", ">", "(", "defaultState", ",", "pureTransitions", ",", "pureSelectors", ",", "options", "?", ")", ";", "internal", "export", "function", "createStateContainer", "<", "State", "extends", "BaseState", ",", "PureTransitions", "extends", "object", ",", "PureSelectors", "extends", "object", ">", "(", "defaultState", ",", "pureTransitions", "=", "{", "}", "as", "PureTransitions", ",", "pureSelectors", "=", "{", "}", "as", "PureSelectors", ",", "options", "=", "{", "}", ")", "{", "const", "{", "freeze", "=", "defaultFreeze", "}", "=", "options", ";", "const", "data$", "=", "new", "BehaviorSubject", "<", "State", ">", "(", "freeze", "(", "defaultState", ")", ")", ";", "const", "state$", "=", "data$", ".", "pipe", "(", "skip", "(", "1", ")", ")", ";", "const", "get", "=", "(", ")", "=>", "data$", ".", "getValue", "(", ")", ";", "const", "container", "=", "{", "get", ",", "state$", ",", "getState", ":", "(", ")", "=>", "data$", ".", "getValue", "(", ")", ",", "set", ":", "(", "state", ")", "=>", "{", "container", ".", "dispatch", "(", "{", "type", ":", "$$setActionType", ",", "args", ":", "[", "state", "]", "}", ")", ";", "}", ",", "reducer", ":", "(", "state", ",", "action", ")", "=>", "{", "if", "(", "action", ".", "type", "===", "$$setActionType", ")", "{", "return", "freeze", "(", "action", ".", "args", "[", "0", "]", "as", "State", ")", ";", "}", "const", "pureTransition", "=", "(", "pureTransitions", "as", "Record", "<", "string", ",", "PureTransition", "<", "State", ",", "any", "[", "]", ">", ">", ")", "[", "action", ".", "type", "]", ";", "return", "pureTransition", "?", "freeze", "(", "pureTransition", "(", "state", ")", "(", "...", "action", ".", "args", ")", ")", ":", "state", ";", "}", ",", "replaceReducer", ":", "(", "nextReducer", ")", "=>", "(", "container", ".", "reducer", "=", "nextReducer", ")", ",", "dispatch", ":", "(", "action", ")", "=>", "data$", ".", "next", "(", "container", ".", "reducer", "(", "get", "(", ")", ",", "action", ")", ")", ",", "transitions", ":", "Object", ".", "keys", "(", "pureTransitions", ")", ".", "reduce", "<", "PureTransitionsToTransitions", "<", "PureTransitions", ">", ">", "(", "(", "acc", ",", "type", ")", "=>", "(", "{", "...", "acc", ",", "[", "type", "]", ":", "(", "...", "args", ")", "=>", "container", ".", "dispatch", "(", "{", "type", ",", "args", "}", ")", "}", ")", ",", "{", "}", "as", "PureTransitionsToTransitions", "<", "PureTransitions", ">", ")", ",", "selectors", ":", "Object", ".", "keys", "(", "pureSelectors", ")", ".", "reduce", "<", "PureSelectorsToSelectors", "<", "PureSelectors", ">", ">", "(", "(", "acc", ",", "selector", ")", "=>", "(", "{", "...", "acc", ",", "[", "selector", "]", ":", "(", "...", "args", ")", "=>", "(", "pureSelectors", "as", "any", ")", "[", "selector", "]", "(", "get", "(", ")", ")", "(", "...", "args", ")", ",", "}", ")", ",", "{", "}", "as", "PureSelectorsToSelectors", "<", "PureSelectors", ">", ")", ",", "addMiddleware", ":", "(", "middleware", ")", "=>", "(", "container", ".", "dispatch", "=", "middleware", "(", "container", "as", "any", ")", "(", "container", ".", "dispatch", ")", ")", ",", "subscribe", ":", "(", "listener", ")", "=>", "{", "const", "subscription", "=", "state$", ".", "subscribe", "(", "listener", ")", ";", "return", "(", ")", "=>", "subscription", ".", "unsubscribe", "(", ")", ";", "}", ",", "[", "$$observable", "]", ":", "state$", ",", "}", ";", "return", "container", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4325, null, null, null, null, null, null, 38, null, null, null, null, null, null, null, null, null, null, null, null, null, 4325, null, null, null, null, null, null, null, null, null, null, 38, null, 8953, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4325, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 38, null, 8953, null, 13390, null, 13391, null, null, null, null, null, null, 4325, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 38, null, 8953, null, null, null, null, null, null, 13390, null, null, null, null, null, null, 13391, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4325, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 38, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 38, null, 13392, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 28008, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 329, null, null, null, null, null, null, null, null, null, null, null, null, null, 13392, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 28009, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 28010, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 337, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661922
[ "export", "class", "OsdError", "extends", "Error", "{", "constructor", "(", "message", ")", "{", "super", "(", "message", ")", ";", "Object", ".", "setPrototypeOf", "(", "this", ",", "new", ".", "target", ".", "prototype", ")", ";", "}", "}", "param", "{", "String", "}", "name", "export", "class", "DuplicateField", "extends", "OsdError", "{", "constructor", "(", "name", ")", "{", "super", "(", "`The field \"${", "name", "}\" already exists in this mapping`", ")", ";", "}", "}", "/**\n * A saved object was not found\n */", "export", "class", "SavedObjectNotFound", "extends", "OsdError", "{", "public", "savedObjectType", ":", "string", ";", "public", "savedObjectId", "?", ":", "string", ";", "constructor", "(", "type", ",", "id", "?", ",", "link", "?", ")", "{", "const", "idMsg", "=", "id", "?", "` (id: ${", "id", "})`", ":", "''", ";", "let", "message", "=", "`Could not locate that ${", "type", "}${", "idMsg", "}`", ";", "if", "(", "link", ")", "{", "message", "+=", "`, [click here to re-create it](${", "link", "})`", ";", "}", "super", "(", "message", ")", ";", "this", ".", "savedObjectType", "=", "type", ";", "this", ".", "savedObjectId", "=", "id", ";", "}", "}", "/**\n * This error is for scenarios where a saved object is detected that has invalid JSON properties.\n * There was a scenario where we were importing objects with double-encoded JSON, and the system\n * was silently failing. This error is now thrown in those scenarios.\n */", "export", "class", "InvalidJSONProperty", "extends", "OsdError", "{", "constructor", "(", "message", ")", "{", "super", "(", "message", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null ]
661923
[ "export", "type", "Get", "<", "T", ">", "=", "(", ")", "=>", "T", ";", "export", "type", "Set", "<", "T", ">", "=", "(", "value", ":", "T", ")", "=>", "void", ";", "export", "const", "createGetterSetter", "=", "<", "T", "extends", "object", ">", "(", "name", ")", ":", "[", "Get", "<", "T", ">", ",", "Set", "<", "T", ">", "]", "=>", "{", "let", "value", ";", "const", "get", "=", "(", ")", "=>", "{", "if", "(", "!", "value", ")", "throw", "new", "Error", "(", "`${", "name", "} was not set.`", ")", ";", "return", "value", ";", "}", ";", "const", "set", "=", "(", "newValue", ")", "=>", "{", "value", "=", "newValue", ";", "}", ";", "return", "[", "get", ",", "set", "]", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, null, null, 9631, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 30, null, null, 11, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661924
[ "import", "{", "MonoTypeOperatorFunction", ",", "queueScheduler", ",", "scheduled", ",", "from", "}", "from", "'rxjs'", ";", "import", "{", "concatAll", ",", "distinctUntilChanged", ",", "skip", "}", "from", "'rxjs/operators'", ";", "export", "function", "distinctUntilChangedWithInitialValue", "<", "T", ">", "(", "initialValue", ",", "compare", "?", ")", "{", "return", "(", "input$", ")", "=>", "scheduled", "(", "[", "isPromise", "(", "initialValue", ")", "?", "from", "(", "initialValue", ")", ":", "[", "initialValue", "]", ",", "input$", "]", ",", "queueScheduler", ")", ".", "pipe", "(", "concatAll", "(", ")", ",", "distinctUntilChanged", "(", "compare", ")", ",", "skip", "(", "1", ")", ")", ";", "}", "function", "isPromise", "<", "T", ">", "(", "value", ")", "{", "return", "(", "!", "!", "value", "&&", "typeof", "value", "===", "'object'", "&&", "'then'", "in", "value", "&&", "typeof", "value", ".", "then", "===", "'function'", "&&", "!", "(", "'subscribe'", "in", "value", ")", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2116, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661925
[ "import", "{", "ParsedQuery", "}", "from", "'query-string'", ";", "import", "{", "transform", "}", "from", "'lodash'", ";", "/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */", "export", "function", "encodeUriQuery", "(", "val", ",", "pctEncodeSpaces", "=", "false", ")", "{", "return", "encodeURIComponent", "(", "val", ")", ".", "replace", "(", "/%40/gi", ",", "'@'", ")", ".", "replace", "(", "/%3A/gi", ",", "':'", ")", ".", "replace", "(", "/%24/g", ",", "'$'", ")", ".", "replace", "(", "/%2C/gi", ",", "','", ")", ".", "replace", "(", "/%3B/gi", ",", "';'", ")", ".", "replace", "(", "/%20/g", ",", "pctEncodeSpaces", "?", "'%20'", ":", "'+'", ")", ";", "}", "export", "const", "encodeQuery", "=", "(", "query", ",", "encodeFunction", "=", "encodeUriQuery", ")", "=>", "transform", "(", "query", ",", "(", "result", ",", "value", ",", "key", ")", "=>", "{", "if", "(", "key", ")", "{", "const", "singleValue", "=", "Array", ".", "isArray", "(", "value", ")", "?", "value", ".", "join", "(", "','", ")", ":", "value", ";", "result", "[", "key", "]", "=", "encodeFunction", "(", "singleValue", "===", "undefined", "||", "singleValue", "===", "null", "?", "''", ":", "singleValue", ",", "true", ")", ";", "}", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1897, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661926
[ "import", "{", "encodeUriQuery", ",", "encodeQuery", "}", "from", "'./encode_uri_query'", ";", "export", "const", "url", "=", "{", "encodeQuery", ",", "encodeUriQuery", ",", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null ]
661927
[ "export", "class", "RenderCompleteListener", "{", "private", "readonly", "attributeName", "=", "'data-render-complete'", ";", "constructor", "(", "private", "readonly", "element", ")", "{", "this", ".", "setup", "(", ")", ";", "}", "public", "destroy", "=", "(", ")", "=>", "{", "this", ".", "element", ".", "removeEventListener", "(", "'renderStart'", ",", "this", ".", "start", ")", ";", "this", ".", "element", ".", "removeEventListener", "(", "'renderComplete'", ",", "this", ".", "complete", ")", ";", "}", ";", "public", "setup", "=", "(", ")", "=>", "{", "this", ".", "element", ".", "setAttribute", "(", "this", ".", "attributeName", ",", "'false'", ")", ";", "this", ".", "element", ".", "addEventListener", "(", "'renderStart'", ",", "this", ".", "start", ")", ";", "this", ".", "element", ".", "addEventListener", "(", "'renderComplete'", ",", "this", ".", "complete", ")", ";", "}", ";", "public", "disable", "=", "(", ")", "=>", "{", "this", ".", "element", ".", "setAttribute", "(", "this", ".", "attributeName", ",", "'disabled'", ")", ";", "this", ".", "destroy", "(", ")", ";", "}", ";", "private", "start", "=", "(", ")", "=>", "{", "this", ".", "element", ".", "setAttribute", "(", "this", ".", "attributeName", ",", "'false'", ")", ";", "return", "true", ";", "}", ";", "private", "complete", "=", "(", ")", "=>", "{", "this", ".", "element", ".", "setAttribute", "(", "this", ".", "attributeName", ",", "'true'", ")", ";", "return", "true", ";", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 15, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661928
[ "const", "dispatchEvent", "=", "(", "el", ",", "eventName", ")", "=>", "{", "el", ".", "dispatchEvent", "(", "new", "CustomEvent", "(", "eventName", ",", "{", "bubbles", ":", "true", "}", ")", ")", ";", "}", ";", "export", "function", "dispatchRenderComplete", "(", "el", ")", "{", "dispatchEvent", "(", "el", ",", "'renderComplete'", ")", ";", "}", "export", "function", "dispatchRenderStart", "(", "el", ")", "{", "dispatchEvent", "(", "el", ",", "'renderStart'", ")", ";", "}", "/**\n * Should call `dispatchComplete()` when UI block has finished loading its data and has\n * completely rendered. Should `dispatchInProgress()` every time UI block\n * starts loading data again. At the start it is assumed that UI block is loading\n * so it dispatches \"in progress\" automatically, so you need to call `setRenderComplete`\n * at least once.\n *\n * This is used for reporting to know that UI block is ready, so\n * it can take a screenshot. It is also used in functional tests to know that\n * page has stabilized.\n */", "export", "class", "RenderCompleteDispatcher", "{", "private", "count", ":", "number", "=", "0", ";", "private", "el", "?", ":", "HTMLElement", ";", "constructor", "(", "el", "?", ")", "{", "this", ".", "setEl", "(", "el", ")", ";", "}", "public", "setEl", "(", "el", "?", ")", "{", "this", ".", "el", "=", "el", ";", "this", ".", "count", "=", "0", ";", "if", "(", "el", ")", "this", ".", "dispatchInProgress", "(", ")", ";", "}", "public", "dispatchInProgress", "(", ")", "{", "if", "(", "!", "this", ".", "el", ")", "return", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-render-complete'", ",", "'false'", ")", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-rendering-count'", ",", "String", "(", "this", ".", "count", ")", ")", ";", "dispatchRenderStart", "(", "this", ".", "el", ")", ";", "}", "public", "dispatchComplete", "(", ")", "{", "if", "(", "!", "this", ".", "el", ")", "return", ";", "this", ".", "count", "++", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-render-complete'", ",", "'true'", ")", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-rendering-count'", ",", "String", "(", "this", ".", "count", ")", ")", ";", "dispatchRenderComplete", "(", "this", ".", "el", ")", ";", "}", "public", "dispatchError", "(", ")", "{", "if", "(", "!", "this", ".", "el", ")", "return", ";", "this", ".", "count", "++", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-render-complete'", ",", "'false'", ")", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-rendering-count'", ",", "String", "(", "this", ".", "count", ")", ")", ";", "}", "public", "setTitle", "(", "title", ")", "{", "if", "(", "!", "this", ".", "el", ")", "return", ";", "this", ".", "el", ".", "setAttribute", "(", "'data-title'", ",", "title", ")", ";", "}", "}" ]
[ null, 4, null, null, 15, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 15, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 15, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 15, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 15, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661929
[ "import", "{", "EventEmitter", "}", "from", "'events'", ";", "import", "{", "isEqual", "}", "from", "'lodash'", ";", "import", "ResizeObserver", "from", "'resize-observer-polyfill'", ";", "function", "getSize", "(", "el", ")", "{", "return", "[", "el", ".", "clientWidth", ",", "el", ".", "clientHeight", "]", ";", "}", "/**\n * ResizeChecker receives an element and emits a \"resize\" event every time it changes size.\n */", "export", "class", "ResizeChecker", "extends", "EventEmitter", "{", "private", "destroyed", ":", "boolean", "=", "false", ";", "private", "el", ":", "HTMLElement", "|", "null", ";", "private", "observer", ":", "ResizeObserver", "|", "null", ";", "private", "expectedSize", ":", "[", "number", ",", "number", "]", "|", "null", "=", "null", ";", "constructor", "(", "el", ",", "args", "=", "{", "}", ")", "{", "super", "(", ")", ";", "this", ".", "el", "=", "el", ";", "this", ".", "observer", "=", "new", "ResizeObserver", "(", "(", ")", "=>", "{", "if", "(", "this", ".", "expectedSize", ")", "{", "const", "sameSize", "=", "isEqual", "(", "getSize", "(", "el", ")", ",", "this", ".", "expectedSize", ")", ";", "this", ".", "expectedSize", "=", "null", ";", "if", "(", "sameSize", ")", "{", "return", ";", "}", "}", "this", ".", "emit", "(", "'resize'", ")", ";", "}", ")", ";", "if", "(", "!", "args", ".", "disabled", ")", "{", "this", ".", "enable", "(", ")", ";", "}", "}", "public", "enable", "(", ")", "{", "if", "(", "this", ".", "destroyed", ")", "{", "return", ";", "}", "this", ".", "expectedSize", "=", "getSize", "(", "this", ".", "el", "!", ")", ";", "this", ".", "observer", "!", ".", "observe", "(", "this", ".", "el", "!", ")", ";", "}", "/**\n * Run a function and ignore all resizes that occur\n * while it's running.\n */", "public", "modifySizeWithoutTriggeringResize", "(", "block", ")", "{", "try", "{", "block", "(", ")", ";", "}", "finally", "{", "if", "(", "this", ".", "el", ")", "{", "this", ".", "expectedSize", "=", "getSize", "(", "this", ".", "el", ")", ";", "}", "}", "}", "/**\n * Tell the ResizeChecker to shutdown, stop listenings, and never\n * emit another resize event.\n *\n * Cleans up it's listeners and timers.\n */", "public", "destroy", "(", ")", "{", "if", "(", "this", ".", "destroyed", ")", "{", "return", ";", "}", "this", ".", "destroyed", "=", "true", ";", "this", ".", "observer", "!", ".", "disconnect", "(", ")", ";", "this", ".", "observer", "=", "null", ";", "this", ".", "expectedSize", "=", "null", ";", "this", ".", "el", "=", "null", ";", "this", ".", "removeAllListeners", "(", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 15, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 15, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661930
[ "import", "{", "HashedItemStore", "}", "from", "'./hashed_item_store'", ";", "export", "{", "HashedItemStore", "}", ";", "export", "const", "hashedItemStore", "=", "new", "HashedItemStore", "(", "window", ".", "sessionStorage", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14363, null, null, null, null, null, null, null, null, null ]
661931
[ "import", "rison", ",", "{", "RisonValue", "}", "from", "'rison-node'", ";", "import", "{", "isStateHash", ",", "retrieveState", ",", "persistState", "}", "from", "'../state_hash'", ";", "export", "function", "decodeState", "<", "State", ">", "(", "expandedOrHashedState", ")", "{", "if", "(", "isStateHash", "(", "expandedOrHashedState", ")", ")", "{", "return", "retrieveState", "(", "expandedOrHashedState", ")", ";", "}", "else", "{", "return", "(", "rison", ".", "decode", "(", "expandedOrHashedState", ")", "as", "unknown", ")", "as", "State", ";", "}", "}", "export", "function", "encodeState", "<", "State", ">", "(", "state", ",", "useHash", ")", "{", "if", "(", "useHash", ")", "{", "return", "persistState", "(", "state", ")", ";", "}", "else", "{", "return", "rison", ".", "encode", "(", "(", "state", "as", "unknown", ")", "as", "RisonValue", ")", ";", "}", "}", "export", "function", "hashedStateToExpandedState", "(", "expandedOrHashedState", ")", "{", "if", "(", "isStateHash", "(", "expandedOrHashedState", ")", ")", "{", "return", "encodeState", "(", "retrieveState", "(", "expandedOrHashedState", ")", ",", "false", ")", ";", "}", "return", "expandedOrHashedState", ";", "}", "export", "function", "expandedStateToHashedState", "(", "expandedOrHashedState", ")", "{", "if", "(", "isStateHash", "(", "expandedOrHashedState", ")", ")", "{", "return", "expandedOrHashedState", ";", "}", "return", "persistState", "(", "decodeState", "(", "expandedOrHashedState", ")", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 38, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 38, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661932
[ "import", "{", "parse", "as", "_parseUrl", "}", "from", "'url'", ";", "import", "{", "History", "}", "from", "'history'", ";", "export", "const", "parseUrl", "=", "(", "url", ")", "=>", "_parseUrl", "(", "url", ",", "true", ")", ";", "export", "const", "parseUrlHash", "=", "(", "url", ")", "=>", "{", "const", "hash", "=", "parseUrl", "(", "url", ")", ".", "hash", ";", "return", "hash", "?", "parseUrl", "(", "hash", ".", "slice", "(", "1", ")", ")", ":", "null", ";", "}", ";", "export", "const", "getCurrentUrl", "=", "(", "history", ")", "=>", "history", ".", "createHref", "(", "history", ".", "location", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1529, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 1529, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 222, null, null, null, null, null, null, null, null, null, null, null ]
661933
[ "import", "{", "format", "as", "formatUrl", "}", "from", "'url'", ";", "import", "{", "stringify", ",", "ParsedQuery", "}", "from", "'query-string'", ";", "import", "{", "parseUrl", ",", "parseUrlHash", "}", "from", "'./parse'", ";", "import", "{", "url", "as", "urlUtils", "}", "from", "'../../../common'", ";", "export", "function", "replaceUrlQuery", "(", "rawUrl", ",", "queryReplacer", ")", "{", "const", "url", "=", "parseUrl", "(", "rawUrl", ")", ";", "const", "newQuery", "=", "queryReplacer", "(", "url", ".", "query", "||", "{", "}", ")", ";", "const", "searchQueryString", "=", "stringify", "(", "urlUtils", ".", "encodeQuery", "(", "newQuery", ")", ",", "{", "sort", ":", "false", ",", "encode", ":", "false", ",", "}", ")", ";", "if", "(", "!", "url", ".", "search", "&&", "!", "searchQueryString", ")", "return", "rawUrl", ";", "return", "formatUrl", "(", "{", "...", "url", ",", "search", ":", "searchQueryString", ",", "}", ")", ";", "}", "export", "function", "replaceUrlHashQuery", "(", "rawUrl", ",", "queryReplacer", ")", "{", "const", "url", "=", "parseUrl", "(", "rawUrl", ")", ";", "const", "hash", "=", "parseUrlHash", "(", "rawUrl", ")", ";", "const", "newQuery", "=", "queryReplacer", "(", "hash", "?.", "query", "||", "{", "}", ")", ";", "const", "searchQueryString", "=", "stringify", "(", "urlUtils", ".", "encodeQuery", "(", "newQuery", ")", ",", "{", "sort", ":", "false", ",", "encode", ":", "false", ",", "}", ")", ";", "if", "(", "(", "!", "hash", "||", "!", "hash", ".", "search", ")", "&&", "!", "searchQueryString", ")", "return", "rawUrl", ";", "return", "formatUrl", "(", "{", "...", "url", ",", "hash", ":", "formatUrl", "(", "{", "pathname", ":", "hash", "?.", "pathname", "||", "''", ",", "search", ":", "searchQueryString", ",", "}", ")", ",", "}", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 1897, null, null, null, 1529, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 1897, null, null, null, 1529, null, null, null, null, null, null, null, 1529, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661934
[ "import", "{", "createHashHistory", ",", "History", ",", "UnregisterCallback", "}", "from", "'history'", ";", "import", "{", "BehaviorSubject", ",", "Observable", ",", "Subscription", "}", "from", "'rxjs'", ";", "import", "{", "AppUpdater", ",", "ToastsSetup", "}", "from", "'opensearch-dashboards/public'", ";", "import", "{", "setStateToOsdUrl", "}", "from", "'./osd_url_storage'", ";", "import", "{", "unhashUrl", "}", "from", "'./hash_unhash_url'", ";", "export", "interface", "OsdUrlTracker", "{", "/**\n * Callback to invoke when the app is mounted\n */", "appMounted", ":", "(", ")", "=>", "void", ";", "/**\n * Callback to invoke when the app is unmounted\n */", "appUnMounted", ":", "(", ")", "=>", "void", ";", "/**\n * Unregistering the url tracker. This won't reset the current state of the nav link\n */", "stop", ":", "(", ")", "=>", "void", ";", "setActiveUrl", ":", "(", "newUrl", ":", "string", ")", "=>", "void", ";", "getActiveUrl", ":", "(", ")", "=>", "string", ";", "/**\n * Resets internal state to the last active url, discarding the most recent change\n */", "restorePreviousUrl", ":", "(", ")", "=>", "void", ";", "}", "/**\n * Listens to history changes and optionally to global state changes and updates the nav link url of\n * a given app to point to the last visited page within the app.\n *\n * This includes the following parts:\n * * When the app is currently active, the nav link points to the configurable default url of the app.\n * * When the app is not active the last visited url is set to the nav link.\n * * When a provided observable emits a new value, the state parameter in the url of the nav link is updated\n * as long as the app is not active.\n */", "export", "function", "createOsdUrlTracker", "(", "{", "baseUrl", ",", "defaultSubUrl", ",", "storageKey", ",", "stateParams", ",", "navLinkUpdater$", ",", "toastNotifications", ",", "history", ",", "getHistory", ",", "storage", ",", "shouldTrackUrlUpdate", "=", "(", ")", "=>", "{", "return", "true", ";", "}", ",", "}", ")", "{", "const", "storageInstance", "=", "storage", "||", "sessionStorage", ";", "let", "previousActiveUrl", "=", "''", ";", "let", "activeUrl", "=", "''", ";", "let", "unsubscribeURLHistory", ";", "let", "unsubscribeGlobalState", ";", "function", "setNavLink", "(", "hash", ")", "{", "navLinkUpdater$", ".", "next", "(", "(", ")", "=>", "(", "{", "defaultPath", ":", "hash", "}", ")", ")", ";", "}", "function", "getActiveSubUrl", "(", "url", ")", "{", "return", "url", ".", "substr", "(", "baseUrl", ".", "length", ")", ";", "}", "function", "unsubscribe", "(", ")", "{", "if", "(", "unsubscribeURLHistory", ")", "{", "unsubscribeURLHistory", "(", ")", ";", "unsubscribeURLHistory", "=", "undefined", ";", "}", "if", "(", "unsubscribeGlobalState", ")", "{", "unsubscribeGlobalState", ".", "forEach", "(", "(", "sub", ")", "=>", "sub", ".", "unsubscribe", "(", ")", ")", ";", "unsubscribeGlobalState", "=", "undefined", ";", "}", "}", "function", "setActiveUrl", "(", "newUrl", ")", "{", "const", "urlWithHashes", "=", "baseUrl", "+", "'#'", "+", "newUrl", ";", "let", "urlWithStates", "=", "''", ";", "try", "{", "urlWithStates", "=", "unhashUrl", "(", "urlWithHashes", ")", ";", "}", "catch", "(", "e", ")", "{", "toastNotifications", ".", "addDanger", "(", "e", ".", "message", ")", ";", "}", "previousActiveUrl", "=", "activeUrl", ";", "activeUrl", "=", "getActiveSubUrl", "(", "urlWithStates", "||", "urlWithHashes", ")", ";", "storageInstance", ".", "setItem", "(", "storageKey", ",", "activeUrl", ")", ";", "}", "function", "onMountApp", "(", ")", "{", "unsubscribe", "(", ")", ";", "const", "historyInstance", "=", "history", "||", "(", "getHistory", "&&", "getHistory", "(", ")", ")", "||", "createHashHistory", "(", ")", ";", "unsubscribeURLHistory", "=", "historyInstance", ".", "listen", "(", "(", "location", ")", "=>", "{", "if", "(", "shouldTrackUrlUpdate", "(", "location", ".", "hash", ")", ")", "{", "setActiveUrl", "(", "location", ".", "hash", ".", "substr", "(", "1", ")", ")", ";", "}", "}", ")", ";", "}", "function", "onUnmountApp", "(", ")", "{", "unsubscribe", "(", ")", ";", "unsubscribeGlobalState", "=", "stateParams", ".", "map", "(", "(", "{", "stateUpdate$", ",", "osdUrlKey", "}", ")", "=>", "stateUpdate$", ".", "subscribe", "(", "(", "state", ")", "=>", "{", "const", "updatedUrl", "=", "setStateToOsdUrl", "(", "osdUrlKey", ",", "state", ",", "{", "useHash", ":", "false", "}", ",", "baseUrl", "+", "(", "activeUrl", "||", "defaultSubUrl", ")", ")", ";", "previousActiveUrl", "=", "activeUrl", ";", "activeUrl", "=", "getActiveSubUrl", "(", "updatedUrl", ")", ";", "storageInstance", ".", "setItem", "(", "storageKey", ",", "activeUrl", ")", ";", "setNavLink", "(", "activeUrl", ")", ";", "}", ")", ")", ";", "}", "onUnmountApp", "(", ")", ";", "const", "storedUrl", "=", "storageInstance", ".", "getItem", "(", "storageKey", ")", ";", "if", "(", "storedUrl", ")", "{", "activeUrl", "=", "storedUrl", ";", "previousActiveUrl", "=", "storedUrl", ";", "setNavLink", "(", "storedUrl", ")", ";", "}", "return", "{", "appMounted", "(", ")", "{", "onMountApp", "(", ")", ";", "setNavLink", "(", "defaultSubUrl", ")", ";", "}", ",", "appUnMounted", "(", ")", "{", "onUnmountApp", "(", ")", ";", "setNavLink", "(", "activeUrl", ")", ";", "}", ",", "stop", "(", ")", "{", "unsubscribe", "(", ")", ";", "}", ",", "setActiveUrl", ",", "getActiveUrl", "(", ")", "{", "return", "activeUrl", ";", "}", ",", "restorePreviousUrl", "(", ")", "{", "activeUrl", "=", "previousActiveUrl", ";", "}", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 26073, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661935
[ "import", "{", "i18n", "}", "from", "'@osd/i18n'", ";", "import", "{", "NotificationsStart", "}", "from", "'opensearch-dashboards/public'", ";", "export", "const", "restoreUrlErrorTitle", "=", "i18n", ".", "translate", "(", "'opensearch_dashboards_utils.stateManagement.url.restoreUrlErrorTitle'", ",", "{", "defaultMessage", ":", "`Error restoring state from URL`", ",", "}", ")", ";", "export", "const", "saveStateInUrlErrorTitle", "=", "i18n", ".", "translate", "(", "'opensearch_dashboards_utils.stateManagement.url.saveStateInUrlErrorTitle'", ",", "{", "defaultMessage", ":", "`Error saving state in URL`", ",", "}", ")", ";", "/**\n * Helper for configuring ", "IOsdUrlStateStorage", "to notify about inner errors\n *\n * ", "example", "param", "toast", "export", "const", "withNotifyOnErrors", "=", "(", "toasts", ")", "=>", "{", "return", "{", "onGetError", ":", "(", "error", ")", "=>", "{", "toasts", ".", "addError", "(", "error", ",", "{", "title", ":", "restoreUrlErrorTitle", ",", "}", ")", ";", "}", ",", "onSetError", ":", "(", "error", ")", "=>", "{", "toasts", ".", "addError", "(", "error", ",", "{", "title", ":", "saveStateInUrlErrorTitle", ",", "}", ")", ";", "}", ",", "}", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, 25, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 25, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661936
[ "import", "{", "Observable", ",", "of", "}", "from", "'rxjs'", ";", "import", "{", "catchError", ",", "map", ",", "share", "}", "from", "'rxjs/operators'", ";", "import", "{", "History", "}", "from", "'history'", ";", "import", "{", "IStateStorage", "}", "from", "'./types'", ";", "import", "{", "createOsdUrlControls", ",", "getStateFromOsdUrl", ",", "setStateToOsdUrl", ",", "}", "from", "'../../state_management/url'", ";", "/**\n * OsdUrlStateStorage is a state storage for ", "syncState", "utility which:\n *\n * 1. Keeps state in sync with the URL.\n * 2. Serializes data and stores it in the URL in one of the supported formats:\n * * Rison encoded.\n * * Hashed URL: In URL we store only the hash from the serialized state, but the state itself is stored in sessionStorage. See OpenSearch Dashboards's `state:storeInSessionStorage`\n * advanced option for more context.\n * 3. Takes care of listening to the URL updates and notifies state about the updates.\n * 4. Takes care of batching URL updates to prevent redundant browser history records.\n *\n * TODO: Update link\n * ", "https", "public", "export", "interface", "IOsdUrlStateStorage", "extends", "IStateStorage", "{", "set", ":", "<", "State", ">", "(", "key", ":", "string", ",", "state", ":", "State", ",", "opts", "?", ":", "{", "replace", ":", "boolean", ";", "}", ")", "=>", "Promise", "<", "string", "|", "undefined", ">", ";", "get", ":", "<", "State", "=", "unknown", ">", "(", "key", ":", "string", ")", "=>", "State", "|", "null", ";", "change$", ":", "<", "State", "=", "unknown", ">", "(", "key", ":", "string", ")", "=>", "Observable", "<", "State", "|", "null", ">", ";", "/**\n * cancels any pending url updates\n */", "cancel", ":", "(", ")", "=>", "void", ";", "param", "opts", "returns", "flush", ":", "(", "opts", "?", ":", "{", "replace", "?", ":", "boolean", ";", "}", ")", "=>", "boolean", ";", "}", "/**\n * Creates ", "IOsdUrlStateStorage", "state storage\n * ", "returns", "- ", "IOsdUrlStateStorage", "public", "export", "const", "createOsdUrlStateStorage", "=", "(", "{", "useHash", "=", "false", ",", "history", ",", "onGetError", ",", "onSetError", ",", "}", "=", "{", "useHash", ":", "false", ",", "}", ")", ":", "IOsdUrlStateStorage", "=>", "{", "const", "url", "=", "createOsdUrlControls", "(", "history", ")", ";", "return", "{", "set", ":", "<", "State", ">", "(", "key", ",", "state", ",", "{", "replace", "=", "false", "}", "=", "{", "replace", ":", "false", "}", ")", "=>", "{", "return", "url", ".", "updateAsync", "(", "(", "currentUrl", ")", "=>", "{", "try", "{", "return", "setStateToOsdUrl", "(", "key", ",", "state", ",", "{", "useHash", "}", ",", "currentUrl", ")", ";", "}", "catch", "(", "error", ")", "{", "if", "(", "onSetError", ")", "onSetError", "(", "error", ")", ";", "}", "}", ",", "replace", ")", ";", "}", ",", "get", ":", "(", "key", ")", "=>", "{", "try", "{", "return", "getStateFromOsdUrl", "(", "key", ",", "url", ".", "getPendingUrl", "(", ")", ")", ";", "}", "catch", "(", "e", ")", "{", "if", "(", "onGetError", ")", "onGetError", "(", "e", ")", ";", "return", "null", ";", "}", "}", ",", "change$", ":", "<", "State", ">", "(", "key", ")", "=>", "new", "Observable", "(", "(", "observer", ")", "=>", "{", "const", "unlisten", "=", "url", ".", "listen", "(", "(", ")", "=>", "{", "observer", ".", "next", "(", ")", ";", "}", ")", ";", "return", "(", ")", "=>", "{", "unlisten", "(", ")", ";", "}", ";", "}", ")", ".", "pipe", "(", "map", "(", "(", ")", "=>", "getStateFromOsdUrl", "<", "State", ">", "(", "key", ")", ")", ",", "catchError", "(", "(", "error", ")", "=>", "{", "if", "(", "onGetError", ")", "onGetError", "(", "error", ")", ";", "return", "of", "(", "null", ")", ";", "}", ")", ",", "share", "(", ")", ")", ",", "flush", ":", "(", "{", "replace", "=", "false", "}", "=", "{", "}", ")", "=>", "{", "return", "!", "!", "url", ".", "flush", "(", "replace", ")", ";", "}", ",", "cancel", "(", ")", "{", "url", ".", "cancel", "(", ")", ";", "}", ",", "}", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8581, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661937
[ "import", "{", "keys", ",", "isFunction", ",", "difference", ",", "filter", ",", "union", ",", "pick", ",", "each", ",", "assign", ",", "isEqual", "}", "from", "'lodash'", ";", "export", "interface", "IDiffObject", "{", "removed", ":", "string", "[", "]", ";", "added", ":", "string", "[", "]", ";", "changed", ":", "string", "[", "]", ";", "keys", ":", "string", "[", "]", ";", "}", "param", "{", "string", "}", "key", "returns", "{", "boolean", "}", "const", "filterPrivateAndMethods", "=", "function", "(", "obj", ")", "{", "return", "function", "(", "key", ")", "{", "if", "(", "isFunction", "(", "obj", "[", "key", "]", ")", ")", "return", "false", ";", "if", "(", "key", ".", "charAt", "(", "0", ")", "===", "'$'", ")", "return", "false", ";", "return", "key", ".", "charAt", "(", "0", ")", "!==", "'_'", ";", "}", ";", "}", ";", "export", "function", "applyDiff", "(", "target", ",", "source", ")", "{", "const", "diff", "=", "{", "removed", ":", "[", "]", ",", "added", ":", "[", "]", ",", "changed", ":", "[", "]", ",", "keys", ":", "[", "]", ",", "}", ";", "const", "targetKeys", "=", "keys", "(", "target", ")", ".", "filter", "(", "filterPrivateAndMethods", "(", "target", ")", ")", ";", "const", "sourceKeys", "=", "keys", "(", "source", ")", ".", "filter", "(", "filterPrivateAndMethods", "(", "source", ")", ")", ";", "diff", ".", "removed", "=", "difference", "(", "targetKeys", ",", "sourceKeys", ")", ";", "diff", ".", "added", "=", "difference", "(", "sourceKeys", ",", "targetKeys", ")", ";", "diff", ".", "changed", "=", "filter", "(", "sourceKeys", ",", "(", "key", ")", "=>", "!", "isEqual", "(", "target", "[", "key", "]", ",", "source", "[", "key", "]", ")", ")", ";", "diff", ".", "keys", "=", "union", "(", "diff", ".", "changed", ",", "diff", ".", "removed", ",", "diff", ".", "added", ")", ";", "each", "(", "diff", ".", "removed", ",", "(", "key", ")", "=>", "{", "delete", "target", "[", "key", "]", ";", "}", ")", ";", "assign", "(", "target", ",", "pick", "(", "source", ",", "diff", ".", "changed", ")", ")", ";", "assign", "(", "target", ",", "pick", "(", "source", ",", "diff", ".", "added", ")", ")", ";", "return", "diff", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, 17, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11265, null, 17, null, 17, null, null, null, 11265, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661938
[ "import", "{", "parse", ",", "stringify", "}", "from", "'query-string'", ";", "import", "{", "History", ",", "Location", "}", "from", "'history'", ";", "import", "{", "url", "}", "from", "'../../common'", ";", "export", "function", "removeQueryParam", "(", "history", ",", "param", ",", "replace", "=", "true", ")", "{", "const", "oldLocation", "=", "history", ".", "location", ";", "const", "search", "=", "(", "oldLocation", ".", "search", "||", "''", ")", ".", "replace", "(", "/^\\?/", ",", "''", ")", ";", "const", "query", "=", "parse", "(", "search", ",", "{", "sort", ":", "false", "}", ")", ";", "delete", "query", "[", "param", "]", ";", "const", "newSearch", "=", "stringify", "(", "url", ".", "encodeQuery", "(", "query", ")", ",", "{", "sort", ":", "false", ",", "encode", ":", "false", "}", ")", ";", "const", "newLocation", "=", "{", "...", "oldLocation", ",", "search", ":", "newSearch", ",", "}", ";", "if", "(", "replace", ")", "{", "history", ".", "replace", "(", "newLocation", ")", ";", "}", "else", "{", "history", ".", "push", "(", "newLocation", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 222, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 163, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661939
[ "export", "{", "calculateObjectHash", ",", "defer", ",", "Defer", ",", "fieldWildcardFilter", ",", "fieldWildcardMatcher", ",", "Get", ",", "JsonArray", ",", "JsonObject", ",", "JsonValue", ",", "of", ",", "Set", ",", "UiComponent", ",", "UiComponentInstance", ",", "url", ",", "createGetterSetter", ",", "}", "from", "'../common'", ";", "export", "*", "from", "'./core'", ";", "export", "*", "from", "'../common/errors'", ";", "export", "*", "from", "'./render_complete'", ";", "export", "*", "from", "'./resize_checker'", ";", "export", "*", "from", "'../common/state_containers'", ";", "export", "*", "from", "'./storage'", ";", "export", "{", "hashedItemStore", ",", "HashedItemStore", "}", "from", "'./storage/hashed_item_store'", ";", "export", "{", "createStateHash", ",", "persistState", ",", "retrieveState", ",", "isStateHash", ",", "}", "from", "'./state_management/state_hash'", ";", "export", "{", "hashQuery", ",", "hashUrl", ",", "unhashUrl", ",", "unhashQuery", ",", "createUrlTracker", ",", "createOsdUrlTracker", ",", "createOsdUrlControls", ",", "getStateFromOsdUrl", ",", "getStatesFromOsdUrl", ",", "setStateToOsdUrl", ",", "withNotifyOnErrors", ",", "}", "from", "'./state_management/url'", ";", "export", "{", "syncState", ",", "syncStates", ",", "createOsdUrlStateStorage", ",", "createSessionStorageStateStorage", ",", "IStateSyncConfig", ",", "ISyncStateRef", ",", "IOsdUrlStateStorage", ",", "INullableBaseStateContainer", ",", "ISessionStorageStateStorage", ",", "StartSyncStateFnType", ",", "StopSyncStateFnType", ",", "}", "from", "'./state_sync'", ";", "export", "{", "Configurable", ",", "CollectConfigProps", "}", "from", "'./ui'", ";", "export", "{", "removeQueryParam", ",", "redirectWhenMissing", "}", "from", "'./history'", ";", "export", "{", "applyDiff", "}", "from", "'./state_management/utils/diff_object'", ";", "export", "{", "createStartServicesGetter", ",", "StartServicesGetter", "}", "from", "'./core/create_start_service_getter'", ";", "/** dummy plugin, we just want opensearchDashboardsUtils to have its own bundle */", "export", "function", "plugin", "(", ")", "{", "return", "new", "(", "class", "OpenSearchUtilsPlugin", "{", "setup", "(", ")", "{", "}", "start", "(", ")", "{", "}", "}", ")", "(", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 26074, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null ]
661940
[ "import", "{", "CoreSetup", "}", "from", "'opensearch-dashboards/public'", ";", "import", "{", "getUrlIdFromGotoRoute", ",", "getUrlPath", ",", "GOTO_PREFIX", "}", "from", "'../../common/short_url_routes'", ";", "export", "const", "createShortUrlRedirectApp", "=", "(", "core", ",", "location", ")", "=>", "(", "{", "id", ":", "'short_url_redirect'", ",", "appRoute", ":", "GOTO_PREFIX", ",", "chromeless", ":", "true", ",", "title", ":", "'Short URL Redirect'", ",", "async", "mount", "(", ")", "{", "const", "urlId", "=", "getUrlIdFromGotoRoute", "(", "location", ".", "pathname", ")", ";", "if", "(", "!", "urlId", ")", "{", "throw", "new", "Error", "(", "'Url id not present in path'", ")", ";", "}", "const", "response", "=", "await", "core", ".", "http", ".", "get", "<", "{", "url", ":", "string", ";", "}", ">", "(", "getUrlPath", "(", "urlId", ")", ")", ";", "const", "redirectUrl", "=", "response", ".", "url", ";", "const", "{", "hashUrl", "}", "=", "await", "import", "(", "'../../../opensearch_dashboards_utils/public'", ")", ";", "const", "hashedUrl", "=", "hashUrl", "(", "redirectUrl", ")", ";", "const", "url", "=", "core", ".", "http", ".", "basePath", ".", "prepend", "(", "hashedUrl", ")", ";", "location", ".", "href", "=", "url", ";", "return", "(", ")", "=>", "{", "}", ";", "}", ",", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, 501, null, 163, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661941
[ "import", "{", "UrlGeneratorId", ",", "UrlGeneratorStateMapping", "}", "from", "'./url_generator_definition'", ";", "export", "interface", "UrlGeneratorContract", "<", "Id", "extends", "UrlGeneratorId", ">", "{", "id", ":", "Id", ";", "createUrl", "(", "state", ")", ":", "Promise", "<", "string", ">", ";", "isDeprecated", ":", "boolean", ";", "migrate", "(", "state", ")", ":", "Promise", "<", "{", "state", ":", "UrlGeneratorStateMapping", "[", "Id", "]", "[", "'MigratedState'", "]", ";", "id", ":", "UrlGeneratorStateMapping", "[", "Id", "]", "[", "'MigratedId'", "]", ";", "}", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661942
[ "import", "{", "CoreSetup", ",", "CoreStart", ",", "Plugin", "}", "from", "'src/core/public'", ";", "import", "{", "i18n", "}", "from", "'@osd/i18n'", ";", "import", "{", "UrlGeneratorId", ",", "UrlGeneratorsDefinition", "}", "from", "'./url_generator_definition'", ";", "import", "{", "UrlGeneratorInternal", "}", "from", "'./url_generator_internal'", ";", "import", "{", "UrlGeneratorContract", "}", "from", "'./url_generator_contract'", ";", "export", "interface", "UrlGeneratorsStart", "{", "getUrlGenerator", ":", "<", "T", "extends", "UrlGeneratorId", ">", "(", "urlGeneratorId", ":", "T", ")", "=>", "UrlGeneratorContract", "<", "T", ">", ";", "}", "export", "interface", "UrlGeneratorsSetup", "{", "registerUrlGenerator", ":", "<", "Id", "extends", "UrlGeneratorId", ">", "(", "generator", ":", "UrlGeneratorsDefinition", "<", "Id", ">", ")", "=>", "UrlGeneratorContract", "<", "Id", ">", ";", "}", "export", "class", "UrlGeneratorsService", "implements", "Plugin", "<", "UrlGeneratorsSetup", ",", "UrlGeneratorsStart", ">", "{", "private", "urlGenerators", ":", "Map", "<", "string", ",", "UrlGeneratorInternal", "<", "any", ">", ">", "=", "new", "Map", "(", ")", ";", "constructor", "(", ")", "{", "}", "public", "setup", "(", "core", ")", "{", "const", "setup", "=", "{", "registerUrlGenerator", ":", "<", "Id", "extends", "UrlGeneratorId", ">", "(", "generatorOptions", ")", "=>", "{", "const", "generator", "=", "new", "UrlGeneratorInternal", "<", "Id", ">", "(", "generatorOptions", ",", "this", ".", "getUrlGenerator", ")", ";", "this", ".", "urlGenerators", ".", "set", "(", "generatorOptions", ".", "id", ",", "generator", ")", ";", "return", "generator", ".", "getPublicContract", "(", ")", ";", "}", ",", "}", ";", "return", "setup", ";", "}", "public", "start", "(", "core", ")", "{", "const", "start", "=", "{", "getUrlGenerator", ":", "this", ".", "getUrlGenerator", ",", "}", ";", "return", "start", ";", "}", "public", "stop", "(", ")", "{", "}", "private", "readonly", "getUrlGenerator", "=", "(", "id", ")", "=>", "{", "const", "generator", "=", "this", ".", "urlGenerators", ".", "get", "(", "id", ")", ";", "if", "(", "!", "generator", ")", "{", "throw", "new", "Error", "(", "i18n", ".", "translate", "(", "'share.urlGenerators.errors.noGeneratorWithId'", ",", "{", "defaultMessage", ":", "'No generator found with id {id}'", ",", "values", ":", "{", "id", "}", ",", "}", ")", ")", ";", "}", "return", "generator", ".", "getPublicContract", "(", ")", ";", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11648, null, 501, null, null, null, 11648, null, null, null, null, null, null, null, null, null, null, 7660, null, null, null, null, 12296, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11649, null, 557, null, null, null, 11649, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 23191, null, null, null, null, 12296, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661943
[ "import", "'./index.scss'", ";", "import", "{", "CoreSetup", ",", "CoreStart", ",", "Plugin", "}", "from", "'src/core/public'", ";", "import", "{", "ShareMenuManager", ",", "ShareMenuManagerStart", "}", "from", "'./services'", ";", "import", "{", "ShareMenuRegistry", ",", "ShareMenuRegistrySetup", "}", "from", "'./services'", ";", "import", "{", "createShortUrlRedirectApp", "}", "from", "'./services/short_url_redirect_app'", ";", "import", "{", "UrlGeneratorsService", ",", "UrlGeneratorsSetup", ",", "UrlGeneratorsStart", ",", "}", "from", "'./url_generators/url_generator_service'", ";", "export", "class", "SharePlugin", "implements", "Plugin", "<", "SharePluginSetup", ",", "SharePluginStart", ">", "{", "private", "readonly", "shareMenuRegistry", "=", "new", "ShareMenuRegistry", "(", ")", ";", "private", "readonly", "shareContextMenu", "=", "new", "ShareMenuManager", "(", ")", ";", "private", "readonly", "urlGeneratorsService", "=", "new", "UrlGeneratorsService", "(", ")", ";", "public", "setup", "(", "core", ")", "{", "core", ".", "application", ".", "register", "(", "createShortUrlRedirectApp", "(", "core", ",", "window", ".", "location", ")", ")", ";", "return", "{", "...", "this", ".", "shareMenuRegistry", ".", "setup", "(", ")", ",", "urlGenerators", ":", "this", ".", "urlGeneratorsService", ".", "setup", "(", "core", ")", ",", "}", ";", "}", "public", "start", "(", "core", ")", "{", "return", "{", "...", "this", ".", "shareContextMenu", ".", "start", "(", "core", ",", "this", ".", "shareMenuRegistry", ".", "start", "(", ")", ")", ",", "urlGenerators", ":", "this", ".", "urlGeneratorsService", ".", "start", "(", "core", ")", ",", "}", ";", "}", "}", "public", "export", "type", "SharePluginSetup", "=", "ShareMenuRegistrySetup", "&", "{", "urlGenerators", ":", "UrlGeneratorsSetup", ";", "}", ";", "public", "export", "type", "SharePluginStart", "=", "ShareMenuManagerStart", "&", "{", "urlGenerators", ":", "UrlGeneratorsStart", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21804, null, 501, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 19715, null, 557, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661944
[ "export", "class", "OpenSearchDashboardsURL", "{", "public", "readonly", "path", ":", "string", ";", "public", "readonly", "appName", ":", "string", ";", "public", "readonly", "appPath", ":", "string", ";", "constructor", "(", "path", ")", "{", "const", "match", "=", "path", ".", "match", "(", "/^.*\\/app\\/([^\\/#]+)(.+)$/", ")", ";", "if", "(", "!", "match", ")", "{", "throw", "new", "Error", "(", "'Unexpected URL path.'", ")", ";", "}", "const", "[", ",", "appName", ",", "appPath", "]", "=", "match", ";", "if", "(", "!", "appName", "||", "!", "appPath", ")", "{", "throw", "new", "Error", "(", "'Could not parse URL path.'", ")", ";", "}", "this", ".", "path", "=", "path", ";", "this", ".", "appName", "=", "appName", ";", "this", ".", "appPath", "=", "appPath", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, 63, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661945
[ "export", "{", "CSV_QUOTE_VALUES_SETTING", ",", "CSV_SEPARATOR_SETTING", "}", "from", "'../common/constants'", ";", "export", "{", "UrlGeneratorStateMapping", "}", "from", "'./url_generators/url_generator_definition'", ";", "export", "{", "SharePluginSetup", ",", "SharePluginStart", "}", "from", "'./plugin'", ";", "export", "{", "ShareContext", ",", "ShareMenuProvider", ",", "ShareMenuItem", ",", "ShowShareMenuOptions", ",", "ShareContextMenuPanelItem", ",", "}", "from", "'./types'", ";", "export", "{", "UrlGeneratorId", ",", "UrlGeneratorState", ",", "UrlGeneratorsDefinition", ",", "UrlGeneratorContract", ",", "UrlGeneratorsService", ",", "}", "from", "'./url_generators'", ";", "import", "{", "SharePlugin", "}", "from", "'./plugin'", ";", "export", "{", "OpenSearchDashboardsURL", "}", "from", "'./opensearch_dashboards_url'", ";", "export", "const", "plugin", "=", "(", ")", "=>", "new", "SharePlugin", "(", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 18849, null, null, null, null, null, null, null, null, null ]
661946
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "ReactDOM", "from", "'react-dom'", ";", "import", "{", "EuiText", ",", "EuiPageContent", ",", "EuiCard", ",", "EuiPageContentHeader", ",", "EuiFlexGroup", ",", "EuiFlexItem", ",", "EuiFieldSearch", ",", "EuiListGroup", ",", "EuiHighlight", ",", "EuiLink", ",", "EuiButtonIcon", ",", "}", "from", "'@elastic/eui'", ";", "import", "{", "AppMountParameters", "}", "from", "'../../../src/core/public'", ";", "import", "{", "ExampleDefinition", "}", "from", "'./types'", ";", "interface", "Props", "{", "examples", ":", "ExampleDefinition", "[", "]", ";", "navigateToApp", ":", "(", "appId", ":", "string", ")", "=>", "void", ";", "getUrlForApp", ":", "(", "appId", ":", "string", ")", "=>", "string", ";", "}", "function", "DeveloperExamples", "(", "{", "examples", ",", "navigateToApp", ",", "getUrlForApp", "}", ")", "{", "const", "[", "search", ",", "setSearch", "]", "=", "useState", "<", "string", ">", "(", "''", ")", ";", "const", "lcSearch", "=", "search", ".", "toLowerCase", "(", ")", ";", "const", "filteredExamples", "=", "!", "lcSearch", "?", "examples", ":", "examples", ".", "filter", "(", "(", "def", ")", "=>", "{", "if", "(", "def", ".", "description", ".", "toLowerCase", "(", ")", ".", "indexOf", "(", "lcSearch", ")", ">=", "0", ")", "return", "true", ";", "if", "(", "def", ".", "title", ".", "toLowerCase", "(", ")", ".", "indexOf", "(", "lcSearch", ")", ">=", "0", ")", "return", "true", ";", "return", "false", ";", "}", ")", ";", "return", "(", "<", "EuiPageContent", ">", "<", "EuiPageContentHeader", ">", "<", "EuiText", ">", "<", "h1", ">", "Developer", "examples", "<", "/h1>", "<", "p", ">", "The", "following", "examples", "showcase", "services", "and", "APIs", "that", "are", "available", "to", "developers", ".", "<", "EuiFieldSearch", "placeholder", "=", "\"Search\"", "value", "=", "{", "search", "}", "onChange", "=", "{", "(", "e", ")", "=>", "setSearch", "(", "e", ".", "target", ".", "value", ")", "}", "isClearable", "=", "{", "true", "}", "aria", "-", "label", "=", "\"Search developer examples\"", "/", ">", "<", "/p>", "<", "/EuiText>", "<", "/EuiPageContentHeader>", "<", "EuiFlexGroup", "wrap", ">", "{", "filteredExamples", ".", "map", "(", "(", "def", ")", "=>", "(", "<", "EuiFlexItem", "style", "=", "{", "{", "minWidth", ":", "300", ",", "maxWidth", ":", "500", "}", "}", "key", "=", "{", "def", ".", "appId", "}", ">", "<", "EuiCard", "description", "=", "{", "<", "EuiHighlight", "search", "=", "{", "search", "}", "highlightAll", "=", "{", "true", "}", ">", "{", "def", ".", "description", "}", "<", "/EuiHighlight>} title={<React.Fragment>", "<", "EuiLink", "onClick", "=", "{", "(", ")", "=>", "{", "navigateToApp", "(", "def", ".", "appId", ")", ";", "}", "}", ">", "<", "EuiHighlight", "search", "=", "{", "search", "}", "highlightAll", "=", "{", "true", "}", ">", "{", "def", ".", "title", "}", "<", "/EuiHighlight>", "<", "/EuiLink>", "<", "EuiButtonIcon", "iconType", "=", "\"popout\"", "onClick", "=", "{", "(", ")", "=>", "window", ".", "open", "(", "getUrlForApp", "(", "def", ".", "appId", ")", ",", "'_blank'", ",", "'noopener, noreferrer'", ")", "}", ">", "Open", "in", "new", "tab", "<", "/EuiButtonIcon>", "<", "/React.Fragment>} image={def.image} footer={def.links ? <EuiListGroup size={'s'} listItems={def.links}/", ">", ":", "undefined", "}", "/>", "<", "/EuiFlexItem>))}", "<", "/EuiFlexGroup>", "<", "/EuiPageContent>);", "}", "export", "const", "renderApp", "=", "(", "props", ",", "element", ")", "=>", "{", "ReactDOM", ".", "render", "(", "<", "DeveloperExamples", "{", "...", "props", "}", "/", ">", ",", "element", ")", ";", "return", "(", ")", "=>", "ReactDOM", ".", "unmountComponentAtNode", "(", "element", ")", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661947
[ "import", "{", "CoreSetup", ",", "Plugin", ",", "AppMountParameters", ",", "DEFAULT_APP_CATEGORIES", ",", "}", "from", "'../../../src/core/public'", ";", "import", "{", "ExampleDefinition", "}", "from", "'./types'", ";", "export", "interface", "DeveloperExamplesSetup", "{", "register", ":", "(", "def", ":", "ExampleDefinition", ")", "=>", "void", ";", "}", "export", "class", "DeveloperExamplesPlugin", "implements", "Plugin", "<", "DeveloperExamplesSetup", ",", "void", ">", "{", "private", "examplesRegistry", ":", "ExampleDefinition", "[", "]", "=", "[", "]", ";", "public", "setup", "(", "core", ")", "{", "const", "examples", "=", "this", ".", "examplesRegistry", ";", "core", ".", "application", ".", "register", "(", "{", "id", ":", "'developerExamples'", ",", "title", ":", "'Developer examples'", ",", "order", ":", "-", "2000", ",", "category", ":", "DEFAULT_APP_CATEGORIES", ".", "opensearchDashboards", ",", "async", "mount", "(", "params", ")", "{", "const", "{", "renderApp", "}", "=", "await", "import", "(", "'./app'", ")", ";", "const", "[", "coreStart", "]", "=", "await", "core", ".", "getStartServices", "(", ")", ";", "return", "renderApp", "(", "{", "examples", ",", "navigateToApp", ":", "(", "appId", ")", "=>", "coreStart", ".", "application", ".", "navigateToApp", "(", "appId", ")", ",", "getUrlForApp", ":", "(", "appId", ")", "=>", "coreStart", ".", "application", ".", "getUrlForApp", "(", "appId", ")", ",", "}", ",", "params", ".", "element", ")", ";", "}", ",", "}", ")", ";", "const", "api", "=", "{", "register", ":", "(", "def", ")", "=>", "{", "this", ".", "examplesRegistry", ".", "push", "(", "def", ")", ";", "}", ",", "}", ";", "return", "api", ";", "}", "public", "start", "(", ")", "{", "}", "public", "stop", "(", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21829, null, 501, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 1602, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21829, null, null, null, null, null, 14869, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, 4, null, null, null, null, null ]
661948
[ "import", "{", "DeveloperExamplesPlugin", "}", "from", "'./plugin'", ";", "export", "const", "plugin", "=", "(", ")", "=>", "new", "DeveloperExamplesPlugin", "(", ")", ";", "export", "{", "DeveloperExamplesSetup", "}", "from", "'./plugin'", ";" ]
[ null, null, null, null, null, null, null, null, null, 42502, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661949
[ "import", "url", "from", "'url'", ";", "import", "{", "UrlGeneratorState", ",", "UrlGeneratorsDefinition", "}", "from", "'../../../src/plugins/share/public'", ";", "/**\n * The name of the latest variable can always stay the same so code that\n * uses this link generator statically will switch to the latest version.\n * Typescript will warn the developer if incorrect state is being passed\n * down.\n */", "export", "const", "HELLO_URL_GENERATOR", "=", "'HELLO_URL_GENERATOR_V2'", ";", "export", "interface", "HelloLinkState", "{", "firstName", ":", "string", ";", "lastName", ":", "string", ";", "}", "export", "type", "HelloLinkGeneratorState", "=", "UrlGeneratorState", "<", "HelloLinkState", ">", ";", "export", "const", "createHelloPageLinkGenerator", "=", "(", "getStartServices", ")", ":", "UrlGeneratorsDefinition", "<", "typeof", "HELLO_URL_GENERATOR", ">", "=>", "(", "{", "id", ":", "HELLO_URL_GENERATOR", ",", "createUrl", ":", "async", "(", "state", ")", "=>", "{", "const", "startServices", "=", "await", "getStartServices", "(", ")", ";", "const", "appBasePath", "=", "startServices", ".", "appBasePath", ";", "const", "parsedUrl", "=", "url", ".", "parse", "(", "window", ".", "location", ".", "href", ")", ";", "return", "url", ".", "format", "(", "{", "protocol", ":", "parsedUrl", ".", "protocol", ",", "host", ":", "parsedUrl", ".", "host", ",", "pathname", ":", "`${", "appBasePath", "}/hello`", ",", "query", ":", "{", "...", "state", ",", "}", ",", "}", ")", ";", "}", ",", "}", ")", ";", "/**\n * The name of this legacy generator id changes, but the *value* stays the same.\n */", "export", "const", "HELLO_URL_GENERATOR_V1", "=", "'HELLO_URL_GENERATOR'", ";", "export", "interface", "HelloLinkStateV1", "{", "name", ":", "string", ";", "}", "export", "type", "LegacyHelloLinkGeneratorState", "=", "UrlGeneratorState", "<", "HelloLinkStateV1", ",", "typeof", "HELLO_URL_GENERATOR", ",", "HelloLinkState", ">", ";", "export", "const", "helloPageLinkGeneratorV1", "=", "{", "id", ":", "HELLO_URL_GENERATOR_V1", ",", "isDeprecated", ":", "true", ",", "migrate", ":", "async", "(", "state", ")", "=>", "{", "return", "{", "id", ":", "HELLO_URL_GENERATOR", ",", "state", ":", "{", "firstName", ":", "state", ".", "name", ",", "lastName", ":", "''", "}", "}", ";", "}", ",", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7660, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, 802, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7660, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661950
[ "import", "React", ",", "{", "useState", ",", "useEffect", "}", "from", "'react'", ";", "import", "ReactDOM", "from", "'react-dom'", ";", "import", "{", "EuiPage", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiButton", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiPageBody", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiPageContent", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiPageContentBody", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiSpacer", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiText", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiFieldText", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiPageHeader", "}", "from", "'@elastic/eui'", ";", "import", "{", "EuiLink", "}", "from", "'@elastic/eui'", ";", "import", "{", "AppMountParameters", "}", "from", "'../../../src/core/public'", ";", "import", "{", "UrlGeneratorsService", "}", "from", "'../../../src/plugins/share/public'", ";", "import", "{", "HELLO_URL_GENERATOR", ",", "HELLO_URL_GENERATOR_V1", ",", "}", "from", "'../../url_generators_examples/public/url_generator'", ";", "interface", "Props", "{", "getLinkGenerator", ":", "UrlGeneratorsService", "[", "'getUrlGenerator'", "]", ";", "}", "interface", "MigratedLink", "{", "isDeprecated", ":", "boolean", ";", "linkText", ":", "string", ";", "link", ":", "string", ";", "}", "const", "ActionsExplorer", "=", "(", "{", "getLinkGenerator", "}", ")", "=>", "{", "const", "[", "migratedLinks", ",", "setMigratedLinks", "]", "=", "useState", "(", "[", "]", "as", "MigratedLink", "[", "]", ")", ";", "const", "[", "buildingLinks", ",", "setBuildingLinks", "]", "=", "useState", "(", "false", ")", ";", "const", "[", "firstName", ",", "setFirstName", "]", "=", "useState", "(", "''", ")", ";", "const", "[", "lastName", ",", "setLastName", "]", "=", "useState", "(", "''", ")", ";", "/**\n * Lets pretend we grabbed these links from a persistent store, like a saved object.\n * Some of these links were created with older versions of the hello link generator.\n * They use deprecated generator ids.\n */", "const", "[", "persistedLinks", ",", "setPersistedLinks", "]", "=", "useState", "(", "[", "{", "id", ":", "HELLO_URL_GENERATOR_V1", ",", "linkText", ":", "'Say hello to Mary'", ",", "state", ":", "{", "name", ":", "'Mary'", ",", "}", ",", "}", ",", "{", "id", ":", "HELLO_URL_GENERATOR", ",", "linkText", ":", "'Say hello to George'", ",", "state", ":", "{", "firstName", ":", "'George'", ",", "lastName", ":", "'Washington'", ",", "}", ",", "}", ",", "]", ")", ";", "useEffect", "(", "(", ")", "=>", "{", "setBuildingLinks", "(", "true", ")", ";", "const", "updateLinks", "=", "async", "(", ")", "=>", "{", "const", "updatedLinks", "=", "await", "Promise", ".", "all", "(", "persistedLinks", ".", "map", "(", "async", "(", "savedLink", ")", "=>", "{", "const", "generator", "=", "getLinkGenerator", "(", "savedLink", ".", "id", ")", ";", "const", "link", "=", "await", "generator", ".", "createUrl", "(", "savedLink", ".", "state", ")", ";", "return", "{", "isDeprecated", ":", "generator", ".", "isDeprecated", ",", "linkText", ":", "savedLink", ".", "linkText", ",", "link", ",", "}", ";", "}", ")", ")", ";", "setMigratedLinks", "(", "updatedLinks", ")", ";", "setBuildingLinks", "(", "false", ")", ";", "}", ";", "updateLinks", "(", ")", ";", "}", ",", "[", "getLinkGenerator", ",", "persistedLinks", "]", ")", ";", "return", "(", "<", "EuiPage", ">", "<", "EuiPageBody", ">", "<", "EuiPageHeader", ">", "Access", "links", "explorer", "<", "/EuiPageHeader>", "<", "EuiPageContent", ">", "<", "EuiPageContentBody", ">", "<", "EuiText", ">", "<", "p", ">", "Create", "new", "links", "using", "the", "most", "recent", "version", "of", "a", "url", "generator", ".", "<", "/p>", "<", "/EuiText>", "<", "EuiFieldText", "prepend", "=", "\"First name\"", "onChange", "=", "{", "(", "e", ")", "=>", "{", "setFirstName", "(", "e", ".", "target", ".", "value", ")", ";", "}", "}", "/>", "<", "EuiFieldText", "prepend", "=", "\"Last name\"", "onChange", "=", "{", "(", "e", ")", "=>", "setLastName", "(", "e", ".", "target", ".", "value", ")", "}", "/>", "<", "EuiButton", "onClick", "=", "{", "(", ")", "=>", "setPersistedLinks", "(", "[", "...", "persistedLinks", ",", "{", "id", ":", "HELLO_URL_GENERATOR", ",", "state", ":", "{", "firstName", ",", "lastName", "}", ",", "linkText", ":", "`Say hello to ${", "firstName", "} ${", "lastName", "}`", ",", "}", ",", "]", ")", "}", ">", "Add", "new", "link", "<", "/EuiButton>", "<", "EuiSpacer", "/", ">", "<", "EuiText", ">", "<", "p", ">", "Existing", "links", "retrieved", "from", "storage", ".", "The", "links", "that", "were", "generated", "from", "legacy", "generators", "are", "in", "red", ".", "This", "can", "be", "useful", "for", "developers", "to", "know", "they", "will", "have", "to", "migrate", "persisted", "state", "or", "in", "a", "future", "version", "of", "OpenSearch", "Dashboards", ",", "these", "links", "may", "no", "longer", "work", ".", "They", "still", "work", "now", "because", "legacy", "url", "generators", "must", "provide", "a", "state", "migration", "function", ".", "<", "/p>", "<", "/EuiText>", "{", "buildingLinks", "?", "(", "<", "div", ">", "loading", "...", "<", "/div>) : (migratedLinks.map((link) => (<React.Fragment>", "<", "EuiLink", "color", "=", "{", "link", ".", "isDeprecated", "?", "'danger'", ":", "'primary'", "}", "data", "-", "test", "-", "subj", "=", "\"linkToHelloPage\"", "href", "=", "{", "link", ".", "link", "}", "target", "=", "\"_blank\"", ">", "{", "link", ".", "linkText", "}", "<", "/EuiLink>", "<", "br", "/", ">", "<", "/React.Fragment>)))}", "<", "/EuiPageContentBody>", "<", "/EuiPageContent>", "<", "/EuiPageBody>", "<", "/EuiPage>);", "}", ";", "export", "const", "renderApp", "=", "(", "props", ",", "{", "element", "}", ")", "=>", "{", "ReactDOM", ".", "render", "(", "<", "ActionsExplorer", "{", "...", "props", "}", "/", ">", ",", "element", ")", ";", "return", "(", ")", "=>", "ReactDOM", ".", "unmountComponentAtNode", "(", "element", ")", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661951
[ "import", "{", "SharePluginStart", "}", "from", "'../../../src/plugins/share/public'", ";", "import", "{", "Plugin", ",", "CoreSetup", ",", "AppMountParameters", ",", "AppNavLinkStatus", "}", "from", "'../../../src/core/public'", ";", "import", "{", "DeveloperExamplesSetup", "}", "from", "'../../developer_examples/public'", ";", "interface", "StartDeps", "{", "share", ":", "SharePluginStart", ";", "}", "interface", "SetupDeps", "{", "developerExamples", ":", "DeveloperExamplesSetup", ";", "}", "export", "class", "AccessLinksExplorerPlugin", "implements", "Plugin", "<", "void", ",", "void", ",", "SetupDeps", ",", "StartDeps", ">", "{", "public", "setup", "(", "core", ",", "{", "developerExamples", "}", ")", "{", "core", ".", "application", ".", "register", "(", "{", "id", ":", "'urlGeneratorsExplorer'", ",", "title", ":", "'Access links explorer'", ",", "navLinkStatus", ":", "AppNavLinkStatus", ".", "hidden", ",", "async", "mount", "(", "params", ")", "{", "const", "depsStart", "=", "(", "await", "core", ".", "getStartServices", "(", ")", ")", "[", "1", "]", ";", "const", "{", "renderApp", "}", "=", "await", "import", "(", "'./app'", ")", ";", "return", "renderApp", "(", "{", "getLinkGenerator", ":", "depsStart", ".", "share", ".", "urlGenerators", ".", "getUrlGenerator", ",", "}", ",", "params", ")", ";", "}", ",", "}", ")", ";", "developerExamples", ".", "register", "(", "{", "title", ":", "'Url generators'", ",", "description", ":", "`Url generators offer are a backward compatible safe way to persist a URL in a saved object.\n Store the url generator id and state, instead of the href string. When the link is recreated at run time, the service\n will run the state through any necessary migrations. Registrators can change their URL structure\n without breaking these links stored in saved objects.\n `", ",", "appId", ":", "'urlGeneratorsExplorer'", ",", "links", ":", "[", "{", "label", ":", "'README'", ",", "href", ":", "'https://github.com/opensearch-project/OpenSearch-Dashboards/blob/master/src/plugins/share/public/url_generators/README.md'", ",", "iconType", ":", "'logoGithub'", ",", "size", ":", "'s'", ",", "target", ":", "'_blank'", ",", "}", ",", "]", ",", "}", ")", ";", "}", "public", "start", "(", ")", "{", "}", "public", "stop", "(", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 501, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661952
[ "import", "{", "AccessLinksExplorerPlugin", "}", "from", "'./plugin'", ";", "export", "const", "plugin", "=", "(", ")", "=>", "new", "AccessLinksExplorerPlugin", "(", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null ]
661953
[ "import", "React", "from", "'react'", ";", "import", "{", "EuiPageBody", ",", "EuiPageContent", ",", "EuiPageContentBody", ",", "EuiPageHeader", ",", "EuiPageHeaderSection", ",", "EuiTitle", ",", "}", "from", "'@elastic/eui'", ";", "interface", "PageProps", "{", "title", ":", "string", ";", "children", ":", "React", ".", "ReactNode", ";", "}", "export", "function", "Page", "(", "{", "title", ",", "children", "}", ")", "{", "return", "(", "<", "EuiPageBody", "data", "-", "test", "-", "subj", "=", "\"searchTestPage\"", ">", "<", "EuiPageHeader", ">", "<", "EuiPageHeaderSection", ">", "<", "EuiTitle", "size", "=", "\"l\"", ">", "<", "h1", ">", "{", "title", "}", "<", "/h1>", "<", "/EuiTitle>", "<", "/EuiPageHeaderSection>", "<", "/EuiPageHeader>", "<", "EuiPageContent", ">", "<", "EuiPageContentBody", ">", "{", "children", "}", "<", "/EuiPageContentBody>", "<", "/EuiPageContent>", "<", "/EuiPageBody>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661954
[ "const", "path", "=", "require", "(", "\"path\"", ")", ";", "const", "fs", "=", "require", "(", "\"fs\"", ")", ";", "param", "{", "string", "}", "projRoot", "param", "{", "string", "}", "out", "param", "{", "string", "}", "moduleName", "param", "{", "string", "[", "]", "}", "exclude", "param", "{", "boolean", "}", "isGlobal", "param", "{", "boolean", "}", "log", "function", "genDts", "(", "projRoot", ",", "out", ",", "moduleName", ",", "exclude", ",", "isGlobal", ",", "log", ")", "{", "type", "{", "any", "}", "const", "dtsg", "=", "require", "(", "\"dts-generator\"", ")", ";", "type", "{", "dtsGenerator", "}", "const", "dtsGen", "=", "dtsg", ".", "default", ";", "const", "tsconfigFile", "=", "path", ".", "join", "(", "projRoot", ",", "\"tsconfig.json\"", ")", ";", "let", "tsconfigExclude", ";", "try", "{", "const", "tsconfig", "=", "require", "(", "tsconfigFile", ")", ";", "tsconfigExclude", "=", "tsconfig", ".", "exclude", ";", "}", "catch", "(", "error", ")", "{", "}", "let", "dtsGenExclude", "=", "[", "\"node_modules/**/*.d.ts\"", "]", ".", "concat", "(", "exclude", "?", "exclude", ":", "[", "]", ")", ".", "concat", "(", "tsconfigExclude", "?", "tsconfigExclude", ":", "[", "]", ")", ";", "const", "logPrint", "=", "(", "msg", ")", "=>", "{", "log", "&&", "console", ".", "log", "(", "`[EGF-CLI] ${", "msg", "}`", ")", ";", "}", ";", "type", "{", "Partial", "<", "import", "(", "'dts-generator'", ")", ".", "DtsGeneratorOptions", ">", "}", "const", "dtsGOpt", "=", "{", "baseDir", ":", "projRoot", ",", "exclude", ":", "dtsGenExclude", ",", "out", ":", "out", ",", "sendMessage", ":", "logPrint", ",", "verbose", ":", "logPrint", ",", "resolveModuleId", ":", "function", "(", "params", ")", "{", "return", "moduleName", ";", "}", ",", "resolveModuleImport", ":", "function", "(", "params", ")", "{", "if", "(", "!", "params", ".", "isDeclaredExternalModule", ")", "{", "if", "(", "!", "params", ".", "importedModuleId", ".", "includes", "(", "\".\"", ")", ")", "{", "return", "params", ".", "importedModuleId", ";", "}", "return", "moduleName", ";", "}", "return", "params", ".", "importedModuleId", ";", "}", "}", ";", "console", ".", "log", "(", "`[EGF-CLI] 开始生成声明文件:${", "path", ".", "relative", "(", "projRoot", ",", "out", ")", "}`", ")", ";", "dtsGen", "(", "dtsGOpt", ")", ".", "then", "(", "(", "args", ")", "=>", "{", "if", "(", "isGlobal", ")", "{", "console", ".", "log", "(", "`[EGF-CLI] 开始处理成全局声明`", ")", ";", "const", "ts", "=", "require", "(", "\"typescript\"", ")", ";", "let", "dtsFileStr", "=", "fs", ".", "readFileSync", "(", "dtsGOpt", ".", "out", ",", "\"utf-8\"", ")", ";", "const", "source", "=", "ts", ".", "createSourceFile", "(", "`${", "moduleName", "}.d.ts`", ",", "dtsFileStr", ",", "ts", ".", "ScriptTarget", ".", "ESNext", ",", "true", ")", ";", "const", "statements", "=", "source", ".", "statements", ";", "type", "{", "ts", ".", "Statement", "}", "let", "statement", ";", "param", "{", "ts", ".", "Statement", "}", "statement", "returns", "{", "statement", "is", "ts", ".", "ModuleDeclaration", "}", "const", "isModuleDeclare", "=", "function", "(", "statement", ")", "{", "return", "statement", ".", "kind", "===", "ts", ".", "SyntaxKind", ".", "ModuleDeclaration", ";", "}", ";", "let", "namespacesStr", "=", "`\\ndeclare namespace ${", "moduleName", "} {`", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "statements", ".", "length", ";", "i", "++", ")", "{", "statement", "=", "statements", "[", "i", "]", ";", "if", "(", "isModuleDeclare", "(", "statement", ")", ")", "{", "type", "{", "ts", ".", "ModuleBlock", "}", "let", "moduleBlock", "=", "statement", ".", "body", ";", "let", "childStatements", "=", "moduleBlock", ".", "statements", ";", "for", "(", "let", "k", "=", "0", ";", "k", "<", "childStatements", ".", "length", ";", "k", "++", ")", "{", "type", "{", "ts", ".", "ClassDeclaration", "}", "let", "childeStatement", "=", "childStatements", "[", "k", "]", ";", "if", "(", "childStatements", "[", "k", "]", ".", "kind", "===", "ts", ".", "SyntaxKind", ".", "ClassDeclaration", ")", "{", "const", "typeParameters", "=", "childeStatement", ".", "typeParameters", ";", "let", "typeStr", "=", "\"\"", ";", "let", "refTypeStr", "=", "\"\"", ";", "if", "(", "typeParameters", "&&", "typeParameters", ".", "length", ">", "0", ")", "{", "typeStr", "=", "\"<\"", ";", "refTypeStr", "=", "\"<\"", ";", "for", "(", "let", "j", "=", "0", ";", "j", "<", "typeParameters", ".", "length", ";", "j", "++", ")", "{", "typeStr", "+=", "typeParameters", "[", "j", "]", ".", "getFullText", "(", ")", ";", "refTypeStr", "+=", "typeParameters", "[", "j", "]", ".", "name", ".", "escapedText", ";", "if", "(", "j", "<", "typeParameters", ".", "length", "-", "1", ")", "{", "typeStr", "+=", "\", \"", ";", "refTypeStr", "+=", "\", \"", ";", "}", "}", "typeStr", "+=", "\">\"", ";", "refTypeStr", "+=", "\">\"", ";", "}", "let", "className", "=", "childeStatement", ".", "name", ".", "escapedText", ";", "namespacesStr", "+=", "`\\n\\ttype ${", "className", "+", "typeStr", "} = import('${", "moduleName", "}').${", "className", "+", "refTypeStr", "};`", ";", "}", "}", "}", "}", "namespacesStr", "+=", "\"\\n}\"", ";", "dtsFileStr", "=", "dtsFileStr", ".", "replace", "(", "new", "RegExp", "(", "`export \\\\* from '${", "moduleName", "}';`", ",", "\"g\"", ")", ",", "\"\"", ")", ";", "dtsFileStr", "=", "dtsFileStr", ".", "replace", "(", "/export {};/g", ",", "\"\"", ")", ";", "dtsFileStr", "=", "dtsFileStr", ".", "replace", "(", "/export default /g", ",", "\"\"", ")", ";", "dtsFileStr", "=", "dtsFileStr", ".", "replace", "(", "/export /g", ",", "\"\"", ")", ";", "dtsFileStr", "+=", "namespacesStr", ";", "dtsFileStr", "+=", "`\\ndeclare const ${", "moduleName", "}:typeof import(\"${", "moduleName", "}\");`", ";", "fs", ".", "writeFileSync", "(", "dtsGOpt", ".", "out", ",", "dtsFileStr", ")", ";", "}", "console", ".", "log", "(", "`[EGF-CLI] 声明文件生成完毕`", ")", ";", "}", ")", ";", "}", "module", ".", "exports", "=", "genDts", ";" ]
[ null, 1555, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 2, null, 2, null, 5, null, 8, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 77, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 303, null, null, null, null, null, null, null, null, null, null, null, null, 391, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, 391, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8386, null, null, null, null, null, null, 303, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 816, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 303, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1585, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661955
[ "type", "{", "any", "}", "const", "typescript", "=", "require", "(", "'rollup-plugin-typescript2'", ")", ";", "const", "rollup", "=", "require", "(", "\"rollup\"", ")", ";", "type", "{", "any", "}", "const", "rollupCjs", "=", "require", "(", "\"rollup-plugin-commonjs\"", ")", ";", "type", "{", "any", "}", "const", "nodeResolve", "=", "require", "(", "\"rollup-plugin-node-resolve\"", ")", ";", "const", "path", "=", "require", "(", "\"path\"", ")", ";", "const", "fs", "=", "require", "(", "\"fs\"", ")", ";", "type", "{", "any", "}", "const", "jsonPlugin", "=", "require", "(", "\"@rollup/plugin-json\"", ")", ";", "type", "{", "any", "}", "const", "terser", "=", "require", "(", "\"rollup-plugin-terser\"", ")", ";", "const", "{", "TypeScritIndexWriter", "}", "=", "require", "(", "'./cti/TypeScritIndexWriter'", ")", ";", "const", "genDts", "=", "require", "(", "'./genDts'", ")", ";", "const", "tsconfigOverride", "=", "{", "compilerOptions", ":", "{", "}", "}", ";", "param", "{", "import", "(", "\"@ailhc/egf-cli\"", ")", ".", "IEgfCompileOption", "}", "option", "async", "function", "rollupBuild", "(", "option", ")", "{", "let", "moduleName", ";", "let", "useFooter", ";", "let", "projRoot", "=", "option", ".", "proj", ";", "if", "(", "!", "projRoot", ")", "{", "projRoot", "=", "process", ".", "cwd", "(", ")", ";", "}", "if", "(", "!", "path", ".", "isAbsolute", "(", "projRoot", ")", ")", "{", "projRoot", "=", "path", ".", "join", "(", "process", ".", "cwd", "(", ")", ",", "projRoot", ")", ";", "}", "type", "{", "import", "(", "\"@ailhc/egf-cli\"", ")", ".", "IEgfCompileOption", "}", "let", "configOption", ";", "let", "configPath", "=", "typeof", "option", ".", "config", "===", "\"string\"", "?", "option", ".", "config", ":", "\"egf.compile.js\"", ";", "if", "(", "!", "path", ".", "isAbsolute", "(", "configPath", ")", ")", "{", "configPath", "=", "path", ".", "join", "(", "projRoot", ",", "configPath", ")", ";", "}", "if", "(", "fs", ".", "existsSync", "(", "configPath", ")", ")", "{", "try", "{", "configOption", "=", "require", "(", "configPath", ")", ";", "}", "catch", "(", "error", ")", "{", "console", ".", "error", "(", "`配置文件有问题:${", "configPath", "}`", ")", ";", "}", "if", "(", "configOption", ")", "{", "option", "=", "Object", ".", "assign", "(", "configOption", ",", "option", ")", ";", "}", "}", "let", "format", "=", "option", ".", "format", "?", "option", ".", "format", ":", "\"cjs\"", ";", "const", "isIIFE", "=", "format", ".", "includes", "(", "\"iife\"", ")", "||", "format", ".", "includes", "(", "\"umd\"", ")", ";", "if", "(", "isIIFE", ")", "{", "type", "{", "any", "[", "]", "}", "const", "strs", "=", "format", ".", "split", "(", "\":\"", ")", ";", "format", "=", "strs", "[", "0", "]", ";", "moduleName", "=", "strs", "[", "1", "]", ";", "if", "(", "!", "moduleName", "||", "moduleName", ".", "trim", "(", ")", "===", "\"\"", ")", "{", "const", "pkgName", "=", "process", ".", "env", ".", "npm_package_name", ";", "if", "(", "pkgName", ".", "includes", "(", "\"/\"", ")", ")", "{", "moduleName", "=", "pkgName", ".", "split", "(", "\"/\"", ")", "[", "1", "]", ";", "}", "else", "{", "moduleName", "=", "pkgName", ";", "}", "function", "camelize", "(", "str", ")", "{", "return", "str", ".", "replace", "(", "/-(\\w)/g", ",", "(", "_", ",", "c", ")", "=>", "c", "?", "c", ".", "toUpperCase", "(", ")", ":", "''", ")", ";", "}", "moduleName", "=", "camelize", "(", "moduleName", ")", ";", "}", "useFooter", "=", "true", ";", "}", "if", "(", "format", ".", "includes", "(", "\"system\"", ")", ")", "{", "type", "{", "any", "[", "]", "}", "const", "strs", "=", "format", ".", "split", "(", "\":\"", ")", ";", "format", "=", "strs", "[", "0", "]", ";", "moduleName", "=", "strs", "[", "1", "]", ";", "}", "if", "(", "!", "moduleName", ")", "{", "moduleName", "=", "process", ".", "env", ".", "npm_package_name", ";", "}", "if", "(", "!", "format", ")", "{", "format", "=", "\"cjs\"", ";", "}", "let", "entrys", "=", "option", ".", "entry", "?", "option", ".", "entry", ":", "undefined", ";", "if", "(", "!", "entrys", ")", "{", "entrys", "=", "[", "\"src/index.ts\"", "]", ";", "}", "if", "(", "typeof", "entrys", "===", "\"string\"", ")", "{", "entrys", "=", "[", "entrys", "]", ";", "}", "else", "if", "(", "typeof", "entrys", "===", "\"object\"", ")", "{", "entrys", "=", "[", "]", ".", "concat", "(", "entrys", ")", ";", "}", "for", "(", "let", "i", "=", "0", ";", "i", "<", "entrys", ".", "length", ";", "i", "++", ")", "{", "entrys", "[", "i", "]", "=", "path", ".", "join", "(", "projRoot", ",", "entrys", "[", "i", "]", ")", ";", "}", "let", "output", "=", "option", ".", "output", ";", "let", "outputDir", "=", "option", ".", "outputDir", ";", "if", "(", "entrys", ".", "length", ">", "1", ")", "{", "if", "(", "!", "outputDir", ")", "{", "outputDir", "=", "`dist/${", "format", "}/lib`", ";", "}", "output", "=", "undefined", ";", "}", "else", "{", "if", "(", "!", "output", "&&", "(", "format", "===", "\"es\"", "||", "format", "===", "\"esm\"", ")", ")", "{", "output", "=", "`dist/${", "format", "}/lib/index.mjs`", ";", "}", "if", "(", "!", "output", ")", "{", "if", "(", "isIIFE", ")", "{", "output", "=", "`dist/${", "format", "}/${", "moduleName", "}.js`", ";", "}", "else", "{", "output", "=", "`dist/${", "format", "}/lib/index.js`", ";", "}", "}", "}", "if", "(", "output", "&&", "!", "path", ".", "isAbsolute", "(", "output", ")", ")", "{", "output", "=", "path", ".", "join", "(", "projRoot", ",", "output", ")", ";", "}", "if", "(", "outputDir", "&&", "!", "path", ".", "isAbsolute", "(", "outputDir", ")", ")", "{", "outputDir", "=", "path", ".", "join", "(", "projRoot", ",", "outputDir", ")", ";", "}", "let", "typesDir", "=", "option", ".", "typesDir", ";", "if", "(", "!", "typesDir", ")", "{", "if", "(", "isIIFE", ")", "{", "typesDir", "=", "`dist/${", "format", "}`", ";", "}", "else", "{", "typesDir", "=", "`dist/${", "format", "}/types`", ";", "}", "}", "tsconfigOverride", ".", "compilerOptions", ".", "declaration", "=", "false", ";", "tsconfigOverride", ".", "compilerOptions", ".", "sourceMap", "=", "true", ";", "let", "removeComments", "=", "option", ".", "removeComments", ";", "if", "(", "removeComments", "!==", "undefined", ")", "{", "tsconfigOverride", ".", "compilerOptions", ".", "removeComments", "=", "removeComments", ";", "}", "let", "target", "=", "option", ".", "target", ";", "if", "(", "target", ")", "{", "tsconfigOverride", ".", "compilerOptions", ".", "target", "=", "target", ";", "}", "const", "tsconfigPath", "=", "path", ".", "join", "(", "projRoot", ",", "`tsconfig.json`", ")", ";", "let", "externalTag", "=", "option", ".", "externalTag", ";", "type", "{", "any", "}", "type", "{", "Partial", "<", "import", "(", "'rollup-plugin-typescript2/dist/ioptions'", ")", ".", "IOptions", ">", "}", "const", "tsOptions", "=", "{", "tsconfig", ":", "tsconfigPath", ",", "clean", ":", "true", ",", "abortOnError", ":", "false", ",", "tsconfigOverride", ":", "tsconfigOverride", ",", "useTsconfigDeclarationDir", ":", "true", "}", ";", "const", "customPlugins", "=", "option", ".", "plugins", "?", "option", ".", "plugins", ":", "[", "]", ";", "type", "{", "import", "(", "\"rollup\"", ")", ".", "ExternalOption", "}", "param", "{", "*", "}", "source", "param", "{", "*", "}", "importer", "param", "{", "*", "}", "isResolved", "returns", "let", "customExternal", ";", "if", "(", "externalTag", ")", "{", "customExternal", "=", "(", "source", ",", "importer", ",", "isResolved", ")", "=>", "{", "if", "(", "!", "externalTag", "||", "externalTag", "===", "\"\"", ")", "return", "false", ";", "let", "tag", "=", "externalTag", ";", "let", "isExternal", "=", "false", ";", "if", "(", "typeof", "externalTag", "===", "\"object\"", "&&", "externalTag", ".", "length", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "externalTag", ".", "length", ";", "i", "++", ")", "{", "tag", "=", "externalTag", "[", "i", "]", ";", "isExternal", "=", "source", ".", "includes", "(", "tag", ")", ";", "if", "(", "isExternal", ")", "break", ";", "}", "}", "else", "if", "(", "typeof", "tag", "===", "\"string\"", ")", "{", "isExternal", "=", "source", ".", "includes", "(", "tag", ")", ";", "}", "if", "(", "isExternal", ")", "{", "console", ".", "log", "(", "`'${", "source", "}' is imported by ${", "importer", "}, is custom external – treating it as an external dependency`", ")", ";", "}", "return", "isExternal", ";", "}", ";", "}", "type", "{", "import", "(", "'rollup'", ")", ".", "InputOptions", "}", "let", "buildConfig", "=", "{", "external", ":", "customExternal", ",", "input", ":", "entrys", ",", "plugins", ":", "[", "jsonPlugin", "(", ")", ",", "typescript", "(", "tsOptions", ")", ",", "rollupCjs", "(", ")", ",", "nodeResolve", "(", "{", "customResolveOptions", ":", "{", "moduleDirectory", ":", "\"node_modules\"", "}", "}", ")", "]", ".", "concat", "(", "customPlugins", ")", "}", ";", "if", "(", "option", ".", "owInput", ")", "{", "buildConfig", "=", "Object", ".", "assign", "(", "buildConfig", ",", "option", ".", "owInput", ")", ";", "}", "let", "footerStr", "=", "option", ".", "footer", "?", "option", ".", "footer", ":", "\"\"", ";", "footerStr", "=", "`${", "footerStr", "}\n `", "+", "(", "moduleName", "&&", "useFooter", "?", "`var globalTarget =window?window:global;\n globalTarget.${", "moduleName", "}?Object.assign({},globalTarget.${", "moduleName", "}):(globalTarget.${", "moduleName", "} = ${", "moduleName", "})`", ":", "\"\"", ")", ";", "const", "entryFileNames", "=", "option", ".", "entryFileNames", "?", "option", ".", "entryFileNames", ":", "(", "chunkInfo", ")", "=>", "{", "if", "(", "format", "===", "\"es\"", "||", "format", "===", "\"esm\"", ")", "{", "return", "`[name]${", "option", ".", "minify", "?", "\".min\"", ":", "\"\"", "}.mjs`", ";", "}", "else", "{", "return", "`[name]${", "option", ".", "minify", "?", "\".min\"", ":", "\"\"", "}.js`", ";", "}", "}", ";", "const", "chunkFileNames", "=", "option", ".", "chunkFileNames", "?", "option", ".", "chunkFileNames", ":", "(", "chunkInfo", ")", "=>", "{", "if", "(", "format", "===", "\"es\"", "||", "format", "===", "\"esm\"", ")", "{", "return", "`[name]${", "option", ".", "minify", "?", "\".min\"", ":", "\"\"", "}.mjs`", ";", "}", "else", "{", "return", "`[name]${", "option", ".", "minify", "?", "\".min\"", ":", "\"\"", "}.js`", ";", "}", "}", ";", "const", "pkgName", "=", "process", ".", "env", ".", "npm_package_name", ";", "const", "isSpecialSourceMapPath", "=", "option", ".", "specialSourcemapPath", ";", "const", "sourceMapPathTransform", "=", "isSpecialSourceMapPath", "&&", "(", "(", "relativePath", ",", "sourcemapPath", ")", "=>", "{", "let", "sourceFilePath", "=", "require", "(", "\"path\"", ")", ".", "join", "(", "sourcemapPath", ",", "\"../\"", ",", "relativePath", ")", ";", "sourceFilePath", "=", "sourceFilePath", ".", "replace", "(", "projRoot", ",", "pkgName", ")", ";", "return", "sourceFilePath", ";", "}", ")", ";", "type", "{", "import", "(", "'rollup'", ")", ".", "OutputOptions", "}", "let", "outputOption", "=", "{", "file", ":", "output", ",", "chunkFileNames", ":", "chunkFileNames", ",", "entryFileNames", ":", "entryFileNames", ",", "dir", ":", "outputDir", ",", "format", ":", "format", ",", "name", ":", "moduleName", ",", "sourcemap", ":", "option", ".", "sourcemap", ",", "sourcemapPathTransform", ":", "sourceMapPathTransform", ",", "banner", ":", "option", ".", "banner", ",", "footer", ":", "footerStr", "}", ";", "if", "(", "option", ".", "owOutput", ")", "{", "outputOption", "=", "Object", ".", "assign", "(", "outputOption", ",", "option", ".", "owOutput", ")", ";", "}", "const", "isGenDts", "=", "option", ".", "genDts", ";", "if", "(", "option", ".", "autoCti", ")", "{", "await", "autoCreateIndex", "(", "option", ".", "ctiMode", ",", "entrys", ",", "option", ".", "ctiOption", ")", ";", "}", "if", "(", "option", ".", "watch", ")", "{", "console", ".", "log", "(", "`[EGF-CLI] 监听模式开启`", ")", ";", "type", "{", "import", "(", "'rollup'", ")", ".", "RollupWatchOptions", "}", "const", "watchConfig", "=", "buildConfig", ";", "watchConfig", ".", "output", "=", "outputOption", ";", "watchConfig", ".", "watch", "=", "{", "chokidar", ":", "{", "awaitWriteFinish", ":", "true", "}", ",", "clearScreen", ":", "true", "}", ";", "const", "rollupWatcher", "=", "await", "rollup", ".", "watch", "(", "watchConfig", ")", ";", "rollupWatcher", ".", "on", "(", "\"event\"", ",", "async", "(", "event", ")", "=>", "{", "if", "(", "event", ".", "code", "===", "\"START\"", ")", "{", "console", ".", "log", "(", "\"[EGF-CLI] 开始\"", ")", ";", "}", "else", "if", "(", "event", ".", "code", "===", "\"BUNDLE_START\"", ")", "{", "console", ".", "log", "(", "\"[EGF-CLI] BUNDLE开始\"", ")", ";", "}", "else", "if", "(", "event", ".", "code", "===", "\"BUNDLE_END\"", ")", "{", "console", ".", "log", "(", "\"[EGF-CLI] BUNDLE构建结束\"", ")", ";", "}", "else", "if", "(", "event", ".", "code", "===", "\"END\"", ")", "{", "console", ".", "log", "(", "`[EGF-CLI] 构建结束`", ")", ";", "isGenDts", "&&", "doGenDts", "(", "projRoot", ",", "entrys", ",", "format", ",", "typesDir", ",", "moduleName", ",", "option", ")", ";", "}", "else", "if", "(", "event", ".", "code", "===", "\"ERROR\"", ")", "{", "console", ".", "error", "(", "`[EGF-CLI] 构建错误`", ",", "event", ".", "error", ")", ";", "}", "}", ")", ";", "}", "else", "{", "console", ".", "log", "(", "\"[EGF-CLI] 开始构建js\"", ")", ";", "type", "{", "import", "(", "'rollup'", ")", ".", "RollupBuild", "}", "let", "rollupBuild", ";", "rollupBuild", "=", "await", "rollup", ".", "rollup", "(", "buildConfig", ")", ";", "console", ".", "log", "(", "\"[EGF-CLI] 构建js结束\"", ")", ";", "const", "writeResult", "=", "await", "rollupBuild", ".", "write", "(", "outputOption", ")", ";", "const", "minify", "=", "option", ".", "minify", ";", "if", "(", "minify", ")", "{", "console", ".", "log", "(", "\"[EGF-CLI] 生成压缩js\"", ")", ";", "type", "{", "import", "(", "\"rollup-plugin-terser\"", ")", ".", "Options", "}", "const", "terserOption", "=", "{", "output", ":", "{", "ascii_only", ":", "true", "}", ",", "compress", ":", "{", "}", "}", ";", "const", "terserPlugin", "=", "terser", ".", "terser", "(", "terserOption", ")", ";", "outputOption", ".", "sourcemap", "=", "!", "!", "option", ".", "minifySourcemap", ";", "outputOption", ".", "plugins", "=", "[", "terserPlugin", "]", ";", "if", "(", "!", "(", "entrys", ".", "length", ">", "1", ")", ")", "{", "outputOption", ".", "file", "=", "outputOption", ".", "file", ".", "replace", "(", "\".\"", ",", "\".min.\"", ")", ";", "}", "await", "rollupBuild", ".", "write", "(", "outputOption", ")", ";", "}", "isGenDts", "&&", "doGenDts", "(", "projRoot", ",", "entrys", ",", "format", ",", "typesDir", ",", "moduleName", ",", "option", ")", ";", "}", "}", "param", "{", "string", "}", "projRoot", "param", "{", "string", "[", "]", "}", "entrys", "param", "{", "string", "}", "format", "param", "{", "string", "}", "typesDir", "param", "{", "string", "}", "moduleName", "param", "{", "import", "(", "\"@ailhc/egf-cli\"", ")", ".", "IEgfCompileOption", "}", "option", "function", "doGenDts", "(", "projRoot", ",", "entrys", ",", "format", ",", "typesDir", ",", "moduleName", ",", "option", ")", "{", "const", "typesDirPath", "=", "path", ".", "join", "(", "projRoot", ",", "typesDir", ")", ";", "const", "isGlobal", "=", "format", "===", "\"iife\"", "||", "format", "===", "\"umd\"", ";", "const", "pkgName", "=", "process", ".", "env", ".", "npm_package_name", ";", "let", "dtsGenExclude", "=", "[", "\"node_modules/**/*.d.ts\"", ",", "]", ".", "concat", "(", "option", ".", "dtsGenExclude", "?", "option", ".", "dtsGenExclude", ":", "[", "]", ")", ";", "const", "out", "=", "path", ".", "join", "(", "typesDirPath", ",", "isGlobal", "?", "`${", "moduleName", "}.d.ts`", ":", "`index.d.ts`", ")", ";", "moduleName", "=", "isGlobal", "?", "moduleName", ":", "pkgName", ";", "genDts", "(", "projRoot", ",", "out", ",", "moduleName", ",", "dtsGenExclude", ",", "isGlobal", ",", "false", ")", ";", "}", "param", "{", "\"create\"", "|", "\"entrypoint\"", "}", "ctiMode", "param", "{", "string", "[", "]", "}", "entrys", "param", "{", "import", "(", "\"./cti/options/ICreateTsIndexOption\"", ")", ".", "ICreateTsIndexOption", "}", "option", "async", "function", "autoCreateIndex", "(", "ctiMode", ",", "entrys", ",", "option", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "entrys", ".", "length", ";", "i", "++", ")", "{", "const", "dirPath", "=", "path", ".", "dirname", "(", "entrys", "[", "i", "]", ")", ";", "await", "createIndex", "(", "dirPath", ",", "ctiMode", ",", "option", ")", ";", "}", "}", "const", "tsIndexWriter", "=", "new", "TypeScritIndexWriter", "(", ")", ";", "param", "{", "string", "}", "dirPath", "param", "{", "\"create\"", "|", "\"entrypoint\"", "}", "mode", "param", "{", "import", "(", "\"./cti/options/ICreateTsIndexOption\"", ")", ".", "ICreateTsIndexOption", "}", "option", "async", "function", "createIndex", "(", "dirPath", ",", "mode", ",", "option", ")", "{", "if", "(", "!", "option", ")", "{", "option", "=", "tsIndexWriter", ".", "getDefaultOption", "(", "dirPath", ")", ";", "}", "if", "(", "!", "mode", "||", "mode", "===", "\"create\"", ")", "{", "await", "tsIndexWriter", ".", "create", "(", "option", ",", "dirPath", ")", ";", "}", "else", "{", "await", "tsIndexWriter", ".", "createEntrypoint", "(", "option", ",", "dirPath", ")", ";", "}", "}", "module", ".", "exports", "=", "{", "build", ":", "rollupBuild", ",", "createIndex", ":", "createIndex", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1555, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 0, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 5, null, 2, null, 2, null, 2, null, 0, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, 5, null, 0, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, 2, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661956
[ "function", "getIPAdress", "(", ")", "{", "let", "interfaces", "=", "require", "(", "'os'", ")", ".", "networkInterfaces", "(", ")", ";", "for", "(", "var", "devName", "in", "interfaces", ")", "{", "var", "iface", "=", "interfaces", "[", "devName", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "iface", ".", "length", ";", "i", "++", ")", "{", "let", "alias", "=", "iface", "[", "i", "]", ";", "if", "(", "alias", ".", "family", "===", "'IPv4'", "&&", "alias", ".", "address", "!==", "'127.0.0.1'", "&&", "!", "alias", ".", "internal", ")", "{", "return", "alias", ".", "address", ";", "}", "}", "}", "}", "param", "{", "string", "}", "moduleName", "function", "camelizePkgName", "(", "moduleName", ")", "{", "if", "(", "moduleName", ".", "includes", "(", "\"/\"", ")", ")", "{", "moduleName", "=", "moduleName", ".", "split", "(", "\"/\"", ")", "[", "1", "]", ";", "}", "if", "(", "moduleName", ".", "includes", "(", "\"-\"", ")", ")", "{", "let", "camelizeRE", "=", "/-(\\w)/g", ";", "moduleName", "=", "moduleName", ".", "replace", "(", "camelizeRE", ",", "function", "(", "_", ",", "c", ")", "{", "return", "c", "?", "c", ".", "toUpperCase", "(", ")", ":", "''", ";", "}", ")", ";", "}", "return", "moduleName", ";", "}", "module", ".", "exports", "=", "{", "getIPAdress", ":", "getIPAdress", ",", "camelizePkgName", ":", "camelizePkgName", "}", ";" ]
[ null, 2, null, null, null, null, 458, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4433, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661957
[ "const", "program", "=", "require", "(", "'commander'", ")", ";", "const", "package", "=", "require", "(", "\"./package.json\"", ")", ";", "const", "rollupDo", "=", "require", "(", "\"./libs/rollupdo\"", ")", ";", "const", "path", "=", "require", "(", "\"path\"", ")", ";", "const", "fs", "=", "require", "(", "\"fs-extra\"", ")", ";", "const", "genDts", "=", "require", "(", "'./libs/genDts'", ")", ";", "const", "{", "camelizePkgName", "}", "=", "require", "(", "'./libs/utils'", ")", ";", "program", ".", "version", "(", "package", ".", "version", ")", ".", "description", "(", "'a build tool'", ")", ".", "usage", "(", "\"egf [command] [args]\"", ")", ";", "program", ".", "command", "(", "\"create\"", ")", ".", "description", "(", "`创建/初始化模板项目`", ")", ".", "option", "(", "'-n, --name [name]'", ",", "'项目名,没有则默认'", ")", ".", "option", "(", "'-p, --path [path]'", ",", "\"创建路径\"", ")", ".", "action", "(", "async", "function", "(", "option", ")", "{", "let", "projPath", "=", "option", ".", "path", "?", "option", ".", "path", ":", "\"./\"", ";", "const", "isReleative", "=", "projPath", ".", "includes", "(", "\"./\"", ")", ";", "projPath", "=", "isReleative", "?", "path", ".", "join", "(", "process", ".", "cwd", "(", ")", ",", "projPath", ")", ":", "projPath", ";", "if", "(", "!", "fs", ".", "existsSync", "(", "projPath", ")", ")", "{", "console", ".", "error", "(", "`目标路径不存在:${", "projPath", "}`", ")", ";", "return", ";", "}", "const", "packageJson", "=", "path", ".", "join", "(", "projPath", ",", "\"package.json\"", ")", ";", "if", "(", "fs", ".", "existsSync", "(", "packageJson", ")", ")", "{", "console", ".", "error", "(", "`指定路径文件夹不为空:${", "projPath", "}`", ")", ";", "return", ";", "}", "console", ".", "log", "(", "`创建项目中...`", ")", ";", "await", "fs", ".", "copyAsync", "(", "path", ".", "join", "(", "__dirname", ",", "\"./package-template\"", ")", ",", "projPath", ")", ";", "let", "newPkg", "=", "JSON", ".", "parse", "(", "fs", ".", "readFileSync", "(", "packageJson", ",", "\"utf-8\"", ")", ")", ";", "if", "(", "option", ".", "name", ")", "{", "newPkg", ".", "name", "=", "option", ".", "name", ";", "}", "fs", ".", "writeFileSync", "(", "packageJson", ",", "JSON", ".", "stringify", "(", "newPkg", ",", "null", ",", "\"\\t\"", ")", ")", ";", "console", ".", "log", "(", "`创建项目完成`", ")", ";", "}", ")", ";", "program", ".", "command", "(", "\"build\"", ")", ".", "description", "(", "`构建`", ")", ".", "option", "(", "'-p, --proj [proj]'", ",", "'项目根路径,默认为执行命令处 process.cwd()'", ")", ".", "option", "(", "'-c, --config [config]'", ",", "'配置文件路径,做更多的自定义处理,默认egf.compile.js'", ")", ".", "option", "(", "'-w, --watch [watch]'", ",", "'是否监听自动编译'", ")", ".", "option", "(", "'-acti, --auto-cti [autoCti]'", ",", "'是否自动生成入口文件,默认否'", ")", ".", "option", "(", "'-ctim, --cti-mode [ctiMode]'", ",", "'自动生成入口文件模式,默认create,可选:create,entrypoint,两种模式差异可见文档'", ")", ".", "option", "(", "'-e, --entry [entry...]'", ",", "'入口文件 默认src/index.ts,可以是数组,多个入口'", ")", ".", "option", "(", "'-o, --output [output]'", ",", "'输出文件 默认dist/index.js'", ")", ".", "option", "(", "'-od, --output-dir [outputDir]'", ",", "'多入口编译输出文件夹 默认dist/${format}'", ")", ".", "option", "(", "'-f, --format [format]'", ",", "'输出格式 默认cjs,可选iife,umd,es <br>如果是iife和umd 需要加:<globalName> 冒号+全局变量名'", ")", ".", "option", "(", "'-d, --types-dir [typesDir]'", ",", "'声明文件输出目录 默认 dist/${format}/types'", ")", ".", "option", "(", "'-nrc, --no-remove-comments [removeComments]'", ",", "'是否移除注释,默认移除'", ")", ".", "option", "(", "'-t, --target [target]'", ",", "'编译目标,默认使用tsconfig中的编译目标'", ")", ".", "option", "(", "'-m, --minify [minify]'", ",", "'是否压缩,默认不压缩'", ")", ".", "option", "(", "'-ms, --minify-sourcemap [minifySourcemap]'", ",", "'是否生成压缩后的js的sourcemap,默认不生成'", ")", ".", "option", "(", "'-ngd, --no-gen-dts [genDts]'", ",", "\"是否不生成声明文件,默认生成\"", ")", ".", "option", "(", "'-bn, --banner [banner]'", ",", "\"自定义输出文件顶部文本\"", ")", ".", "option", "(", "'-ft, --footer [footer]'", ",", "\"自定义输出文件尾部文本,在iife规范和umd规范输出中,会有默认全局变量脚本插入\"", ")", ".", "option", "(", "'-s, --no-sourcemap [sourcemap]'", ",", "'默认true,输出sourcemap的形式,inline就是在js里以base64编码存在,false就不生成sourcemap,true就生成单独的xxx.js.map'", ")", ".", "option", "(", "'-spsmp, --special-sourcemap-path [special-sourcemap-path]'", ",", "'默认false,输出sourcemap里的路径类型,true则可以输出在cocoscreator项目中调试的sourcemap'", ")", ".", "action", "(", "function", "(", "option", ")", "{", "rollupDo", ".", "build", "(", "option", ")", ";", "}", ")", ";", "program", ".", "command", "(", "\"cti\"", ")", ".", "description", "(", "`\n 基于create-ts-index库\n 创建入口文件,一般用于生成库的index.ts比如fairygui`", ")", ".", "option", "(", "'-m, --mode [mode]'", ",", "'创建模式,默认create,可选create、entrypoint'", ")", ".", "option", "(", "'-d, --dir [dir]'", ",", "'文件夹路径,可以相对也可以绝对,相对路径相对于process.cwd()执行命令处'", ")", ".", "action", "(", "function", "(", "option", ")", "{", "rollupDo", ".", "createIndex", "(", "option", ".", "dir", ",", "option", ".", "mode", ")", ";", "}", ")", ";", "program", ".", "command", "(", "\"dts\"", ")", ".", "description", "(", "`声明文件生成`", ")", ".", "option", "(", "'-p, --proj [proj]'", ",", "'根目录,可以是相对路径(相对于 process.cwd())要构建生成dts的基本目录,将排除在此目录之外发现的任何依赖项,默认process.cwd()'", ")", ".", "option", "(", "'-o, --out [out]'", ",", "'输出文件路径,可以是相对路径(相对于 proj),默认dist/index.d.ts'", ")", ".", "option", "(", "'-n, --module-name [moduleName]'", ",", "'模块名,默认读package.name'", ")", ".", "option", "(", "'-e, --exclude [exclude...]'", ",", "'忽略列表'", ")", ".", "option", "(", "'-g, --global [global]'", ",", "'是否为全局声明,默认否'", ")", ".", "option", "(", "'-l, --log [log]'", ",", "'是否输出log,默认否'", ")", ".", "action", "(", "function", "(", "option", ")", "{", "let", "projRoot", "=", "option", ".", "proj", "?", "option", ".", "proj", ":", "process", ".", "cwd", "(", ")", ";", "if", "(", "!", "path", ".", "isAbsolute", "(", "projRoot", ")", ")", "{", "projRoot", "=", "path", ".", "join", "(", "process", ".", "cwd", "(", ")", ",", "projRoot", ")", ";", "}", "let", "isGlobal", "=", "!", "!", "option", ".", "global", ";", "let", "moduleName", "=", "option", ".", "moduleName", "?", "option", ".", "moduleName", ":", "process", ".", "env", ".", "npm_package_name", ";", "if", "(", "isGlobal", ")", "{", "moduleName", "=", "camelizePkgName", "(", "moduleName", ")", ";", "}", "let", "out", "=", "option", ".", "out", "?", "option", ".", "out", ":", "isGlobal", "?", "`./dist/${", "moduleName", "}.d.ts`", ":", "'./dist/index.d.ts'", ";", "if", "(", "!", "path", ".", "isAbsolute", "(", "out", ")", ")", "{", "out", "=", "path", ".", "join", "(", "projRoot", ",", "out", ")", ";", "}", "let", "exclude", "=", "option", ".", "exclude", "?", "option", ".", "exclude", ":", "[", "]", ";", "genDts", "(", "projRoot", ",", "out", ",", "moduleName", ",", "exclude", ",", "isGlobal", ",", "!", "!", "option", ".", "log", ")", ";", "}", ")", ";", "program", ".", "parse", "(", "process", ".", "argv", ")", ";", "program", ".", "on", "(", "'command:*'", ",", "function", "(", ")", "{", "console", ".", "error", "(", "'Invalid command: %s\\nSee --help for a list of available commands.'", ",", "program", ".", "args", ".", "join", "(", "' '", ")", ")", ";", "process", ".", "exit", "(", "1", ")", ";", "}", ")", ";", "program", ".", "on", "(", "'option:verbose'", ",", "function", "(", ")", "{", "process", ".", "env", ".", "VERBOSE", "=", "this", ".", "verbose", ";", "}", ")", ";", "program", ".", "on", "(", "'--help'", ",", "(", ")", "=>", "{", "console", ".", "log", "(", "`\\r\\nRun ${", "chalk", ".", "greenBright", "(", "'egf <command> --help'", ")", "} for detailed usage of given command.`", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, 1555, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661958
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661959
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661960
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661961
[ "var", "testModule", "=", "(", "function", "(", "exports", ")", "{", "'use strict'", ";", "var", "classA", "=", "(", "function", "(", ")", "{", "function", "classA", "(", ")", "{", "}", "classA", ".", "prototype", ".", "sayA", "=", "function", "(", "a", ")", "{", "}", ";", "return", "classA", ";", "}", "(", ")", ")", ";", "var", "classB", "=", "(", "function", "(", ")", "{", "function", "classB", "(", ")", "{", "}", "classB", ".", "prototype", ".", "sayb", "=", "function", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", ";", "return", "classB", ";", "}", "(", ")", ")", ";", "var", "classC", "=", "(", "function", "(", ")", "{", "function", "classC", "(", ")", "{", "}", "classC", ".", "prototype", ".", "sayd", "=", "function", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", ";", "return", "classC", ";", "}", "(", ")", ")", ";", "var", "bc", "=", "(", "function", "(", ")", "{", "function", "bc", "(", ")", "{", "console", ".", "log", "(", "\"bc\"", ")", ";", "}", "return", "bc", ";", "}", "(", ")", ")", ";", "var", "extendStatics", "=", "function", "(", "d", ",", "b", ")", "{", "extendStatics", "=", "Object", ".", "setPrototypeOf", "||", "(", "{", "__proto__", ":", "[", "]", "}", "instanceof", "Array", "&&", "function", "(", "d", ",", "b", ")", "{", "d", ".", "__proto__", "=", "b", ";", "}", ")", "||", "function", "(", "d", ",", "b", ")", "{", "for", "(", "var", "p", "in", "b", ")", "if", "(", "b", ".", "hasOwnProperty", "(", "p", ")", ")", "d", "[", "p", "]", "=", "b", "[", "p", "]", ";", "}", ";", "return", "extendStatics", "(", "d", ",", "b", ")", ";", "}", ";", "function", "__extends", "(", "d", ",", "b", ")", "{", "extendStatics", "(", "d", ",", "b", ")", ";", "function", "__", "(", ")", "{", "this", ".", "constructor", "=", "d", ";", "}", "d", ".", "prototype", "=", "b", "===", "null", "?", "Object", ".", "create", "(", "b", ")", ":", "(", "__", ".", "prototype", "=", "b", ".", "prototype", ",", "new", "__", "(", ")", ")", ";", "}", "function", "__awaiter", "(", "thisArg", ",", "_arguments", ",", "P", ",", "generator", ")", "{", "return", "new", "(", "P", "||", "(", "P", "=", "Promise", ")", ")", "(", "function", "(", "resolve", ",", "reject", ")", "{", "function", "fulfilled", "(", "value", ")", "{", "try", "{", "step", "(", "generator", ".", "next", "(", "value", ")", ")", ";", "}", "catch", "(", "e", ")", "{", "reject", "(", "e", ")", ";", "}", "}", "function", "rejected", "(", "value", ")", "{", "try", "{", "step", "(", "generator", "[", "\"throw\"", "]", "(", "value", ")", ")", ";", "}", "catch", "(", "e", ")", "{", "reject", "(", "e", ")", ";", "}", "}", "function", "step", "(", "result", ")", "{", "result", ".", "done", "?", "resolve", "(", "result", ".", "value", ")", ":", "new", "P", "(", "function", "(", "resolve", ")", "{", "resolve", "(", "result", ".", "value", ")", ";", "}", ")", ".", "then", "(", "fulfilled", ",", "rejected", ")", ";", "}", "step", "(", "(", "generator", "=", "generator", ".", "apply", "(", "thisArg", ",", "_arguments", "||", "[", "]", ")", ")", ".", "next", "(", ")", ")", ";", "}", ")", ";", "}", "function", "__generator", "(", "thisArg", ",", "body", ")", "{", "var", "_", "=", "{", "label", ":", "0", ",", "sent", ":", "function", "(", ")", "{", "if", "(", "t", "[", "0", "]", "&", "1", ")", "throw", "t", "[", "1", "]", ";", "return", "t", "[", "1", "]", ";", "}", ",", "trys", ":", "[", "]", ",", "ops", ":", "[", "]", "}", ",", "f", ",", "y", ",", "t", ",", "g", ";", "return", "g", "=", "{", "next", ":", "verb", "(", "0", ")", ",", "\"throw\"", ":", "verb", "(", "1", ")", ",", "\"return\"", ":", "verb", "(", "2", ")", "}", ",", "typeof", "Symbol", "===", "\"function\"", "&&", "(", "g", "[", "Symbol", ".", "iterator", "]", "=", "function", "(", ")", "{", "return", "this", ";", "}", ")", ",", "g", ";", "function", "verb", "(", "n", ")", "{", "return", "function", "(", "v", ")", "{", "return", "step", "(", "[", "n", ",", "v", "]", ")", ";", "}", ";", "}", "function", "step", "(", "op", ")", "{", "if", "(", "f", ")", "throw", "new", "TypeError", "(", "\"Generator is already executing.\"", ")", ";", "while", "(", "_", ")", "try", "{", "if", "(", "f", "=", "1", ",", "y", "&&", "(", "t", "=", "op", "[", "0", "]", "&", "2", "?", "y", "[", "\"return\"", "]", ":", "op", "[", "0", "]", "?", "y", "[", "\"throw\"", "]", "||", "(", "(", "t", "=", "y", "[", "\"return\"", "]", ")", "&&", "t", ".", "call", "(", "y", ")", ",", "0", ")", ":", "y", ".", "next", ")", "&&", "!", "(", "t", "=", "t", ".", "call", "(", "y", ",", "op", "[", "1", "]", ")", ")", ".", "done", ")", "return", "t", ";", "if", "(", "y", "=", "0", ",", "t", ")", "op", "=", "[", "op", "[", "0", "]", "&", "2", ",", "t", ".", "value", "]", ";", "switch", "(", "op", "[", "0", "]", ")", "{", "case", "0", ":", "case", "1", ":", "t", "=", "op", ";", "break", ";", "case", "4", ":", "_", ".", "label", "++", ";", "return", "{", "value", ":", "op", "[", "1", "]", ",", "done", ":", "false", "}", ";", "case", "5", ":", "_", ".", "label", "++", ";", "y", "=", "op", "[", "1", "]", ";", "op", "=", "[", "0", "]", ";", "continue", ";", "case", "7", ":", "op", "=", "_", ".", "ops", ".", "pop", "(", ")", ";", "_", ".", "trys", ".", "pop", "(", ")", ";", "continue", ";", "default", ":", "if", "(", "!", "(", "t", "=", "_", ".", "trys", ",", "t", "=", "t", ".", "length", ">", "0", "&&", "t", "[", "t", ".", "length", "-", "1", "]", ")", "&&", "(", "op", "[", "0", "]", "===", "6", "||", "op", "[", "0", "]", "===", "2", ")", ")", "{", "_", "=", "0", ";", "continue", ";", "}", "if", "(", "op", "[", "0", "]", "===", "3", "&&", "(", "!", "t", "||", "(", "op", "[", "1", "]", ">", "t", "[", "0", "]", "&&", "op", "[", "1", "]", "<", "t", "[", "3", "]", ")", ")", ")", "{", "_", ".", "label", "=", "op", "[", "1", "]", ";", "break", ";", "}", "if", "(", "op", "[", "0", "]", "===", "6", "&&", "_", ".", "label", "<", "t", "[", "1", "]", ")", "{", "_", ".", "label", "=", "t", "[", "1", "]", ";", "t", "=", "op", ";", "break", ";", "}", "if", "(", "t", "&&", "_", ".", "label", "<", "t", "[", "2", "]", ")", "{", "_", ".", "label", "=", "t", "[", "2", "]", ";", "_", ".", "ops", ".", "push", "(", "op", ")", ";", "break", ";", "}", "if", "(", "t", "[", "2", "]", ")", "_", ".", "ops", ".", "pop", "(", ")", ";", "_", ".", "trys", ".", "pop", "(", ")", ";", "continue", ";", "}", "op", "=", "body", ".", "call", "(", "thisArg", ",", "_", ")", ";", "}", "catch", "(", "e", ")", "{", "op", "=", "[", "6", ",", "e", "]", ";", "y", "=", "0", ";", "}", "finally", "{", "f", "=", "t", "=", "0", ";", "}", "if", "(", "op", "[", "0", "]", "&", "5", ")", "throw", "op", "[", "1", "]", ";", "return", "{", "value", ":", "op", "[", "0", "]", "?", "op", "[", "1", "]", ":", "void", "0", ",", "done", ":", "true", "}", ";", "}", "}", "var", "App", "=", "(", "function", "(", ")", "{", "function", "App", "(", ")", "{", "this", ".", "_state", "=", "0", ";", "this", ".", "_moduleMap", "=", "{", "}", ";", "}", "Object", ".", "defineProperty", "(", "App", ".", "prototype", ",", "\"state\"", ",", "{", "get", ":", "function", "(", ")", "{", "return", "this", ".", "_state", ";", "}", ",", "enumerable", ":", "false", ",", "configurable", ":", "true", "}", ")", ";", "Object", ".", "defineProperty", "(", "App", ".", "prototype", ",", "\"moduleMap\"", ",", "{", "get", ":", "function", "(", ")", "{", "return", "this", ".", "_moduleMap", ";", "}", ",", "enumerable", ":", "false", ",", "configurable", ":", "true", "}", ")", ";", "App", ".", "prototype", ".", "bootstrap", "=", "function", "(", "bootLoaders", ")", "{", "return", "__awaiter", "(", "this", ",", "void", "0", ",", "void", "0", ",", "function", "(", ")", "{", "var", "bootPromises", ",", "_loop_1", ",", "i", ",", "e_1", ";", "var", "_this", "=", "this", ";", "return", "__generator", "(", "this", ",", "function", "(", "_a", ")", "{", "switch", "(", "_a", ".", "label", ")", "{", "case", "0", ":", "this", ".", "setState", "(", "App", ".", "BOOTING", ")", ";", "if", "(", "!", "bootLoaders", "||", "bootLoaders", ".", "length", "<=", "0", ")", "{", "this", ".", "setState", "(", "App", ".", "BOOTEND", ")", ";", "return", "[", "2", ",", "true", "]", ";", "}", "if", "(", "!", "(", "bootLoaders", "&&", "bootLoaders", ".", "length", ">", "0", ")", ")", "return", "[", "3", ",", "4", "]", ";", "bootPromises", "=", "[", "]", ";", "_loop_1", "=", "function", "(", "i", ")", "{", "var", "bootLoader", "=", "bootLoaders", "[", "i", "]", ";", "bootPromises", ".", "push", "(", "new", "Promise", "(", "function", "(", "res", ",", "rej", ")", "{", "bootLoader", ".", "onBoot", "(", "_this", ",", "function", "(", "isOk", ")", "{", "if", "(", "isOk", ")", "{", "res", "(", ")", ";", "}", "else", "{", "rej", "(", ")", ";", "}", "}", ")", ";", "}", ")", ")", ";", "}", ";", "for", "(", "i", "=", "0", ";", "i", "<", "bootLoaders", ".", "length", ";", "i", "++", ")", "{", "_loop_1", "(", "i", ")", ";", "}", "_a", ".", "label", "=", "1", ";", "case", "1", ":", "_a", ".", "trys", ".", "push", "(", "[", "1", ",", "3", ",", ",", "4", "]", ")", ";", "return", "[", "4", ",", "Promise", ".", "all", "(", "bootPromises", ")", "]", ";", "case", "2", ":", "_a", ".", "sent", "(", ")", ";", "this", ".", "setState", "(", "App", ".", "BOOTEND", ")", ";", "return", "[", "2", ",", "true", "]", ";", "case", "3", ":", "e_1", "=", "_a", ".", "sent", "(", ")", ";", "console", ".", "error", "(", "e_1", ")", ";", "this", ".", "setState", "(", "App", ".", "BOOTEND", ")", ";", "return", "[", "2", ",", "false", "]", ";", "case", "4", ":", "return", "[", "2", "]", ";", "}", "}", ")", ";", "}", ")", ";", "}", ";", "App", ".", "prototype", ".", "init", "=", "function", "(", ")", "{", "var", "moduleMap", "=", "this", ".", "_moduleMap", ";", "var", "moduleIns", ";", "if", "(", "this", ".", "state", "===", "App", ".", "RUNING", ")", "return", ";", "for", "(", "var", "key", "in", "moduleMap", ")", "{", "moduleIns", "=", "moduleMap", "[", "key", "]", ";", "moduleIns", ".", "onInit", "&&", "moduleIns", ".", "onInit", "(", "this", ")", ";", "}", "for", "(", "var", "key", "in", "moduleMap", ")", "{", "moduleIns", "=", "moduleMap", "[", "key", "]", ";", "moduleIns", ".", "onAfterInit", "&&", "moduleIns", ".", "onAfterInit", "(", "this", ")", ";", "}", "this", ".", "setState", "(", "App", ".", "RUNING", ")", ";", "}", ";", "App", ".", "prototype", ".", "loadModule", "=", "function", "(", "moduleIns", ",", "key", ")", "{", "if", "(", "this", ".", "_state", "===", "App", ".", "STOP", ")", "return", "false", ";", "var", "res", "=", "false", ";", "if", "(", "!", "key", ")", "{", "key", "=", "moduleIns", ".", "key", ";", "}", "if", "(", "key", "&&", "typeof", "key", "===", "\"string\"", ")", "{", "if", "(", "moduleIns", ")", "{", "if", "(", "!", "this", ".", "_moduleMap", "[", "key", "]", ")", "{", "this", ".", "_moduleMap", "[", "key", "]", "=", "moduleIns", ";", "res", "=", "true", ";", "if", "(", "this", ".", "_state", "===", "App", ".", "RUNING", ")", "{", "moduleIns", ".", "onInit", "&&", "moduleIns", ".", "onInit", "(", "this", ")", ";", "moduleIns", ".", "onAfterInit", "&&", "moduleIns", ".", "onAfterInit", "(", ")", ";", "}", "}", "else", "{", "this", ".", "_log", "(", "\"\\u52A0\\u8F7D\\u6A21\\u5757:\\u6A21\\u5757:\"", "+", "key", "+", "\"\\u5DF2\\u7ECF\\u5B58\\u5728,\\u4E0D\\u91CD\\u590D\\u52A0\\u8F7D\"", ")", ";", "}", "}", "else", "{", "this", ".", "_log", "(", "\"\\u52A0\\u8F7D\\u6A21\\u5757:\\u6A21\\u5757:\"", "+", "key", "+", "\"\\u5B9E\\u4F8B\\u4E3A\\u7A7A\"", ")", ";", "}", "}", "else", "{", "this", ".", "_log", "(", "\"\\u52A0\\u8F7D\\u6A21\\u5757:\\u6A21\\u5757key\\u4E3A\\u7A7A\"", ")", ";", "}", "return", "res", ";", "}", ";", "App", ".", "prototype", ".", "hasModule", "=", "function", "(", "moduleKey", ")", "{", "return", "!", "!", "this", ".", "_moduleMap", "[", "moduleKey", "]", ";", "}", ";", "App", ".", "prototype", ".", "stop", "=", "function", "(", ")", "{", "var", "moduleMap", "=", "this", ".", "_moduleMap", ";", "var", "moduleIns", ";", "this", ".", "setState", "(", "App", ".", "STOP", ")", ";", "for", "(", "var", "key", "in", "moduleMap", ")", "{", "moduleIns", "=", "moduleMap", "[", "key", "]", ";", "moduleIns", ".", "onStop", "&&", "moduleIns", ".", "onStop", "(", ")", ";", "}", "}", ";", "App", ".", "prototype", ".", "getModule", "=", "function", "(", "moduleKey", ")", "{", "return", "this", ".", "_moduleMap", "[", "moduleKey", "]", ";", "}", ";", "App", ".", "prototype", ".", "setState", "=", "function", "(", "state", ")", "{", "if", "(", "!", "isNaN", "(", "this", ".", "_state", ")", ")", "{", "if", "(", "this", ".", "_state", ">=", "state", ")", "return", ";", "}", "this", ".", "_state", "=", "state", ";", "}", ";", "App", ".", "prototype", ".", "_log", "=", "function", "(", "msg", ",", "level", ")", "{", "switch", "(", "level", ")", "{", "case", "1", ":", "console", ".", "warn", "(", "\"\\u3010\\u4E3B\\u7A0B\\u5E8F\\u3011\"", "+", "msg", ")", ";", "break", ";", "case", "2", ":", "console", ".", "error", "(", "\"\\u3010\\u4E3B\\u7A0B\\u5E8F\\u3011\"", "+", "msg", ")", ";", "break", ";", "default", ":", "console", ".", "warn", "(", "\"\\u3010\\u4E3B\\u7A0B\\u5E8F\\u3011\"", "+", "msg", ")", ";", "break", ";", "}", "}", ";", "App", ".", "UN_RUN", "=", "0", ";", "App", ".", "BOOTING", "=", "1", ";", "App", ".", "BOOTEND", "=", "2", ";", "App", ".", "RUNING", "=", "3", ";", "App", ".", "STOP", "=", "4", ";", "return", "App", ";", "}", "(", ")", ")", ";", "var", "RefOtherPkg", "=", "(", "function", "(", "_super", ")", "{", "__extends", "(", "RefOtherPkg", ",", "_super", ")", ";", "function", "RefOtherPkg", "(", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ")", "||", "this", ";", "var", "a", "=", "new", "App", "(", ")", ";", "console", ".", "log", "(", "a", ")", ";", "return", "_this", ";", "}", "return", "RefOtherPkg", ";", "}", "(", "App", ")", ")", ";", "exports", ".", "RefOtherPkg", "=", "RefOtherPkg", ";", "exports", ".", "bc", "=", "bc", ";", "exports", ".", "classA", "=", "classA", ";", "exports", ".", "classB", "=", "classB", ";", "exports", ".", "classC", "=", "classC", ";", "Object", ".", "defineProperty", "(", "exports", ",", "'__esModule'", ",", "{", "value", ":", "true", "}", ")", ";", "return", "exports", ";", "}", "(", "{", "}", ")", ")", ";", "var", "globalTarget", "=", "window", "?", "window", ":", "global", ";", "globalTarget", ".", "testModule", "?", "Object", ".", "assign", "(", "{", "}", ",", "globalTarget", ".", "testModule", ")", ":", "(", "globalTarget", ".", "testModule", "=", "testModule", ")", ";" ]
[ null, 6, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 189, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661962
[ "type", "{", "import", "(", "\"@ailhc/egf-cli\"", ")", ".", "IEgfCompileOption", "}", "const", "config", "=", "{", "entry", ":", "\"src/index.ts\"", ",", "\"dtsGenExclude\"", ":", "[", "\"__tests__/**/*\"", "]", ",", "\"externalTag\"", ":", "[", "\"@ailhc\"", "]", ",", "}", ";", "module", ".", "exports", "=", "config", ";" ]
[ null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661963
[ "type", "{", "import", "(", "\"@ailhc/egf-cli\"", ")", ".", "IEgfCompileOption", "}", "const", "option", "=", "{", "/**测试命令行参数优先 */", "format", ":", "\"iife\"", ",", "moduleName", ":", "\"testSingle2\"", ",", "footer", ":", "\"testFoot\"", "}", ";", "module", ".", "exports", "=", "option", ";" ]
[ null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661964
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661965
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661966
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661967
[ "export", "class", "subclassA", "{", "param", "a", "sayA", "(", "a", ")", "{", "console", ".", "log", "(", "\"\"", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null, null, null, null, null, null, null, null ]
661968
[ "import", "{", "classC", "}", "from", "\"../src\"", ";", "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "const", "c", "=", "new", "classC", "(", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null ]
661969
[ "export", "class", "TestExclude", "{", "testExclude", "(", ")", "{", "console", ".", "log", "(", "\"hahah\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null ]
661970
[ "export", "class", "TestExclude2", "{", "testExclude", "(", ")", "{", "console", ".", "log", "(", "\"hahah\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null ]
661971
[ "\"use strict\"", ";", "Object", ".", "defineProperty", "(", "exports", ",", "\"__esModule\"", ",", "{", "value", ":", "!", "0", "}", ")", ";", "var", "o", "=", "function", "(", ")", "{", "function", "o", "(", ")", "{", "}", "return", "o", ".", "prototype", ".", "sayA", "=", "function", "(", "o", ")", "{", "}", ",", "o", ";", "}", "(", ")", ",", "t", "=", "function", "(", ")", "{", "function", "o", "(", ")", "{", "}", "return", "o", ".", "prototype", ".", "sayb", "=", "function", "(", "o", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", ",", "o", ";", "}", "(", ")", ",", "n", "=", "function", "(", ")", "{", "function", "o", "(", ")", "{", "}", "return", "o", ".", "prototype", ".", "sayb", "=", "function", "(", "o", ")", "{", "console", ".", "log", "(", "\"FDfsfsaS\"", ")", ";", "}", ",", "o", ";", "}", "(", ")", ";", "exports", ".", "classA", "=", "o", ",", "exports", ".", "classB", "=", "t", ",", "exports", ".", "classD", "=", "n", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661972
[ "'use strict'", ";", "Object", ".", "defineProperty", "(", "exports", ",", "'__esModule'", ",", "{", "value", ":", "true", "}", ")", ";", "var", "classA", "=", "(", "function", "(", ")", "{", "function", "classA", "(", ")", "{", "}", "classA", ".", "prototype", ".", "sayA", "=", "function", "(", "a", ")", "{", "}", ";", "return", "classA", ";", "}", "(", ")", ")", ";", "var", "classB", "=", "(", "function", "(", ")", "{", "function", "classB", "(", ")", "{", "}", "classB", ".", "prototype", ".", "sayb", "=", "function", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", ";", "return", "classB", ";", "}", "(", ")", ")", ";", "var", "classD", "=", "(", "function", "(", ")", "{", "function", "classD", "(", ")", "{", "}", "classD", ".", "prototype", ".", "sayb", "=", "function", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDfsfsaS\"", ")", ";", "}", ";", "return", "classD", ";", "}", "(", ")", ")", ";", "exports", ".", "classA", "=", "classA", ";", "exports", ".", "classB", "=", "classB", ";", "exports", ".", "classD", "=", "classD", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661973
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661974
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661975
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661976
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661977
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661978
[ "export", "class", "classD", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDfsfsaS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661979
[ "const", "typescript", "=", "require", "(", "'rollup-plugin-typescript2'", ")", ";", "type", "{", "any", "}", "const", "rollupCjs", "=", "require", "(", "\"rollup-plugin-commonjs\"", ")", ";", "type", "{", "any", "}", "const", "nodeResolve", "=", "require", "(", "\"rollup-plugin-node-resolve\"", ")", ";", "type", "{", "any", "}", "const", "jsonPlugin", "=", "require", "(", "\"@rollup/plugin-json\"", ")", ";", "const", "terser", "=", "require", "(", "\"rollup-plugin-terser\"", ")", ";", "type", "{", "import", "(", "\"rollup-plugin-terser\"", ")", ".", "Options", "}", "const", "terserOption", "=", "{", "output", ":", "{", "ascii_only", ":", "true", "}", ",", "compress", ":", "{", "}", "}", ";", "type", "{", "import", "(", "\"@ailhc/egf-cli\"", ")", ".", "IEgfCompileOption", "}", "const", "config", "=", "{", "\"dtsGenExclude\"", ":", "[", "\"__tests__/**/*\"", "]", ",", "\"externalTag\"", ":", "[", "\"@ailhc\"", "]", ",", "owInput", ":", "{", "input", ":", "[", "\"./__tests__/owinput-output/src/index.ts\"", "]", ",", "}", ",", "owOutput", ":", "{", "plugins", ":", "[", "terser", ".", "terser", "(", "terserOption", ")", "]", ",", "footer", ":", "\"fjdsjfas\"", "}", "}", ";", "module", ".", "exports", "=", "config", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661980
[ "\"use strict\"", ";", "Object", ".", "defineProperty", "(", "exports", ",", "\"__esModule\"", ",", "{", "value", ":", "!", "0", "}", ")", ";", "var", "o", "=", "require", "(", "\"@ailhc/egf-core\"", ")", ",", "t", "=", "function", "(", ")", "{", "function", "o", "(", ")", "{", "}", "return", "o", ".", "prototype", ".", "sayA", "=", "function", "(", "o", ")", "{", "}", ",", "o", ";", "}", "(", ")", ",", "n", "=", "function", "(", ")", "{", "function", "o", "(", ")", "{", "}", "return", "o", ".", "prototype", ".", "sayb", "=", "function", "(", "o", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", ",", "o", ";", "}", "(", ")", ",", "e", "=", "function", "(", ")", "{", "function", "o", "(", ")", "{", "}", "return", "o", ".", "prototype", ".", "sayd", "=", "function", "(", "o", ")", "{", "console", ".", "log", "(", "o", ")", ";", "}", ",", "o", ";", "}", "(", ")", ",", "r", "=", "function", "(", ")", "{", "console", ".", "log", "(", "\"bc\"", ")", ";", "}", ",", "c", "=", "function", "(", "o", ",", "t", ")", "{", "return", "(", "c", "=", "Object", ".", "setPrototypeOf", "||", "{", "__proto__", ":", "[", "]", "}", "instanceof", "Array", "&&", "function", "(", "o", ",", "t", ")", "{", "o", ".", "__proto__", "=", "t", ";", "}", "||", "function", "(", "o", ",", "t", ")", "{", "for", "(", "var", "n", "in", "t", ")", "t", ".", "hasOwnProperty", "(", "n", ")", "&&", "(", "o", "[", "n", "]", "=", "t", "[", "n", "]", ")", ";", "}", ")", "(", "o", ",", "t", ")", ";", "}", ";", "var", "s", "=", "function", "(", "t", ")", "{", "function", "n", "(", ")", "{", "var", "n", "=", "t", ".", "call", "(", "this", ")", "||", "this", ",", "e", "=", "new", "o", ".", "App", ";", "return", "console", ".", "log", "(", "e", ")", ",", "n", ";", "}", "return", "function", "(", "o", ",", "t", ")", "{", "function", "n", "(", ")", "{", "this", ".", "constructor", "=", "o", ";", "}", "c", "(", "o", ",", "t", ")", ",", "o", ".", "prototype", "=", "null", "===", "t", "?", "Object", ".", "create", "(", "t", ")", ":", "(", "n", ".", "prototype", "=", "t", ".", "prototype", ",", "new", "n", ")", ";", "}", "(", "n", ",", "t", ")", ",", "n", ";", "}", "(", "o", ".", "App", ")", ";", "exports", ".", "RefOtherPkg", "=", "s", ",", "exports", ".", "bc", "=", "r", ",", "exports", ".", "classA", "=", "t", ",", "exports", ".", "classB", "=", "n", ",", "exports", ".", "classC", "=", "e", ",", "fjdsjfas", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661981
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661982
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661983
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661984
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661985
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661986
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661987
[ "'use strict'", ";", "Object", ".", "defineProperty", "(", "exports", ",", "'__esModule'", ",", "{", "value", ":", "true", "}", ")", ";", "var", "egfCore", "=", "require", "(", "'@ailhc/egf-core'", ")", ";", "class", "classA", "{", "sayA", "(", "a", ")", "{", "}", "}", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}", "class", "bc", "{", "constructor", "(", ")", "{", "console", ".", "log", "(", "\"bc\"", ")", ";", "}", "}", "class", "RefOtherPkg", "extends", "egfCore", ".", "App", "{", "constructor", "(", ")", "{", "super", "(", ")", ";", "const", "a", "=", "new", "egfCore", ".", "App", "(", ")", ";", "console", ".", "log", "(", "a", ")", ";", "}", "}", "exports", ".", "RefOtherPkg", "=", "RefOtherPkg", ";", "exports", ".", "bc", "=", "bc", ";", "exports", ".", "classA", "=", "classA", ";", "exports", ".", "classB", "=", "classB", ";", "exports", ".", "classC", "=", "classC", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661988
[ "var", "testModule", "=", "(", "function", "(", "exports", ",", "egfCore", ")", "{", "'use strict'", ";", "var", "classA", "=", "(", "function", "(", ")", "{", "function", "classA", "(", ")", "{", "}", "classA", ".", "prototype", ".", "sayA", "=", "function", "(", "a", ")", "{", "}", ";", "return", "classA", ";", "}", "(", ")", ")", ";", "var", "classB", "=", "(", "function", "(", ")", "{", "function", "classB", "(", ")", "{", "}", "classB", ".", "prototype", ".", "sayb", "=", "function", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", ";", "return", "classB", ";", "}", "(", ")", ")", ";", "var", "classC", "=", "(", "function", "(", ")", "{", "function", "classC", "(", ")", "{", "}", "classC", ".", "prototype", ".", "sayd", "=", "function", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", ";", "return", "classC", ";", "}", "(", ")", ")", ";", "var", "bc", "=", "(", "function", "(", ")", "{", "function", "bc", "(", ")", "{", "console", ".", "log", "(", "\"bc\"", ")", ";", "}", "return", "bc", ";", "}", "(", ")", ")", ";", "var", "extendStatics", "=", "function", "(", "d", ",", "b", ")", "{", "extendStatics", "=", "Object", ".", "setPrototypeOf", "||", "(", "{", "__proto__", ":", "[", "]", "}", "instanceof", "Array", "&&", "function", "(", "d", ",", "b", ")", "{", "d", ".", "__proto__", "=", "b", ";", "}", ")", "||", "function", "(", "d", ",", "b", ")", "{", "for", "(", "var", "p", "in", "b", ")", "if", "(", "b", ".", "hasOwnProperty", "(", "p", ")", ")", "d", "[", "p", "]", "=", "b", "[", "p", "]", ";", "}", ";", "return", "extendStatics", "(", "d", ",", "b", ")", ";", "}", ";", "function", "__extends", "(", "d", ",", "b", ")", "{", "extendStatics", "(", "d", ",", "b", ")", ";", "function", "__", "(", ")", "{", "this", ".", "constructor", "=", "d", ";", "}", "d", ".", "prototype", "=", "b", "===", "null", "?", "Object", ".", "create", "(", "b", ")", ":", "(", "__", ".", "prototype", "=", "b", ".", "prototype", ",", "new", "__", "(", ")", ")", ";", "}", "var", "RefOtherPkg", "=", "(", "function", "(", "_super", ")", "{", "__extends", "(", "RefOtherPkg", ",", "_super", ")", ";", "function", "RefOtherPkg", "(", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ")", "||", "this", ";", "var", "a", "=", "new", "egfCore", ".", "App", "(", ")", ";", "console", ".", "log", "(", "a", ")", ";", "return", "_this", ";", "}", "return", "RefOtherPkg", ";", "}", "(", "egfCore", ".", "App", ")", ")", ";", "exports", ".", "RefOtherPkg", "=", "RefOtherPkg", ";", "exports", ".", "bc", "=", "bc", ";", "exports", ".", "classA", "=", "classA", ";", "exports", ".", "classB", "=", "classB", ";", "exports", ".", "classC", "=", "classC", ";", "Object", ".", "defineProperty", "(", "exports", ",", "'__esModule'", ",", "{", "value", ":", "true", "}", ")", ";", "return", "exports", ";", "}", "(", "{", "}", ",", "egfCore", ")", ")", ";", "var", "globalTarget", "=", "window", "?", "window", ":", "global", ";", "globalTarget", ".", "testModule", "?", "Object", ".", "assign", "(", "{", "}", ",", "globalTarget", ".", "testModule", ")", ":", "(", "globalTarget", ".", "testModule", "=", "testModule", ")", ";" ]
[ null, 6, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661989
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661990
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661991
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661992
[ "export", "class", "classA", "{", "param", "a", "sayA", "(", "a", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, 4, null, 3, null, null, null, null ]
661993
[ "export", "class", "classB", "{", "sayb", "(", "b", ")", "{", "console", ".", "log", "(", "\"FDS\"", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
661994
[ "export", "class", "classC", "{", "sayd", "(", "cc", ")", "{", "console", ".", "log", "(", "cc", ")", ";", "}", "}" ]
[ null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661995
[ "import", "{", "App", "}", "from", "\"@ailhc/egf-core\"", ";", "export", "class", "RefOtherPkg", "extends", "App", "{", "constructor", "(", ")", "{", "super", "(", ")", ";", "const", "a", "=", "new", "App", "(", ")", ";", "console", ".", "log", "(", "a", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661996
[ "\"use strict\"", ";", "Object", ".", "defineProperty", "(", "exports", ",", "\"__esModule\"", ",", "{", "value", ":", "true", "}", ")", ";", "exports", ".", "EN_CLI_OPTION", "=", "void", "0", ";", "var", "EN_CLI_OPTION", ";", "(", "function", "(", "EN_CLI_OPTION", ")", "{", "EN_CLI_OPTION", "[", "\"FILEFIRST\"", "]", "=", "\"filefirst\"", ";", "EN_CLI_OPTION", "[", "\"ADD_NEWLINE\"", "]", "=", "\"addnewline\"", ";", "EN_CLI_OPTION", "[", "\"USE_SEMICOLON\"", "]", "=", "\"usesemicolon\"", ";", "EN_CLI_OPTION", "[", "\"INCLUDE_CWD\"", "]", "=", "\"includecwd\"", ";", "EN_CLI_OPTION", "[", "\"USE_TIMESTAMP\"", "]", "=", "\"usetimestamp\"", ";", "EN_CLI_OPTION", "[", "\"EXCLUDES\"", "]", "=", "\"excludes\"", ";", "EN_CLI_OPTION", "[", "\"FILE_EXCLUDES\"", "]", "=", "\"fileexcludes\"", ";", "EN_CLI_OPTION", "[", "\"TARGET_EXTS\"", "]", "=", "\"targetexts\"", ";", "EN_CLI_OPTION", "[", "\"VERBOSE\"", "]", "=", "\"verbose\"", ";", "EN_CLI_OPTION", "[", "\"QUOTE\"", "]", "=", "\"quote\"", ";", "EN_CLI_OPTION", "[", "\"WITHOUT_COMMENT\"", "]", "=", "\"withoutcomment\"", ";", "EN_CLI_OPTION", "[", "\"WITHOUT_BACKUP\"", "]", "=", "\"withoutbackup\"", ";", "}", ")", "(", "EN_CLI_OPTION", "=", "exports", ".", "EN_CLI_OPTION", "||", "(", "exports", ".", "EN_CLI_OPTION", "=", "{", "}", ")", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661997
[ "\"use strict\"", ";", "Object", ".", "defineProperty", "(", "exports", ",", "\"__esModule\"", ",", "{", "value", ":", "true", "}", ")", ";", "exports", ".", "TypeScritIndexWriter", "=", "void", "0", ";", "const", "tslib_1", "=", "require", "(", "\"tslib\"", ")", ";", "const", "CreateCommandModule_1", "=", "require", "(", "\"./commands/CreateCommandModule\"", ")", ";", "const", "EntrypointCommandModule_1", "=", "require", "(", "\"./commands/EntrypointCommandModule\"", ")", ";", "const", "configure_1", "=", "require", "(", "\"./options/configure\"", ")", ";", "const", "CTIUtility_1", "=", "require", "(", "\"./tools/CTIUtility\"", ")", ";", "class", "TypeScritIndexWriter", "{", "getDefaultOption", "(", "cwd", ")", "{", "if", "(", "CTIUtility_1", ".", "isNotEmpty", "(", "cwd", ")", ")", "{", "const", "option", "=", "configure_1", ".", "getDeafultOptions", "(", ")", ";", "option", ".", "globOptions", ".", "cwd", "=", "cwd", ";", "return", "option", ";", "}", "return", "configure_1", ".", "getDeafultOptions", "(", ")", ";", "}", "create", "(", "option", ",", "_cliCwd", ")", "{", "return", "tslib_1", ".", "__awaiter", "(", "this", ",", "void", "0", ",", "void", "0", ",", "function", "*", "(", ")", "{", "const", "cliCwd", "=", "(", "(", ")", "=>", "{", "if", "(", "CTIUtility_1", ".", "isNotEmpty", "(", "_cliCwd", ")", ")", "{", "return", "_cliCwd", ";", "}", "if", "(", "CTIUtility_1", ".", "isNotEmpty", "(", "option", ".", "globOptions", ".", "cwd", ")", ")", "{", "return", "option", ".", "globOptions", ".", "cwd", ";", "}", "return", "process", ".", "cwd", "(", ")", ";", "}", ")", "(", ")", ";", "const", "createCommand", "=", "new", "CreateCommandModule_1", ".", "CreateCommandModule", "(", ")", ";", "const", "result", "=", "yield", "createCommand", ".", "do", "(", "cliCwd", ",", "option", ")", ";", "return", "result", ";", "}", ")", ";", "}", "createEntrypoint", "(", "option", ",", "_cliCwd", ")", "{", "return", "tslib_1", ".", "__awaiter", "(", "this", ",", "void", "0", ",", "void", "0", ",", "function", "*", "(", ")", "{", "const", "cliCwd", "=", "(", "(", ")", "=>", "{", "if", "(", "CTIUtility_1", ".", "isNotEmpty", "(", "_cliCwd", ")", ")", "{", "return", "_cliCwd", ";", "}", "if", "(", "CTIUtility_1", ".", "isNotEmpty", "(", "option", ".", "globOptions", ".", "cwd", ")", ")", "{", "return", "option", ".", "globOptions", ".", "cwd", ";", "}", "return", "process", ".", "cwd", "(", ")", ";", "}", ")", "(", ")", ";", "const", "entrypointCommand", "=", "new", "EntrypointCommandModule_1", ".", "EntrypointCommandModule", "(", ")", ";", "const", "result", "=", "yield", "entrypointCommand", ".", "do", "(", "cliCwd", ",", "option", ")", ";", "return", "result", ";", "}", ")", ";", "}", "}", "exports", ".", "TypeScritIndexWriter", "=", "TypeScritIndexWriter", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661998
[ "\"use strict\"", ";", "Object", ".", "defineProperty", "(", "exports", ",", "\"__esModule\"", ",", "{", "value", ":", "true", "}", ")", ";", "exports", ".", "CleanCommandModule", "=", "void", "0", ";", "const", "tslib_1", "=", "require", "(", "\"tslib\"", ")", ";", "const", "chalk_1", "=", "tslib_1", ".", "__importDefault", "(", "require", "(", "\"chalk\"", ")", ")", ";", "const", "my_easy_fp_1", "=", "require", "(", "\"my-easy-fp\"", ")", ";", "const", "path", "=", "tslib_1", ".", "__importStar", "(", "require", "(", "\"path\"", ")", ")", ";", "const", "configure_1", "=", "require", "(", "\"../options/configure\"", ")", ";", "const", "CTILogger_1", "=", "require", "(", "\"../tools/CTILogger\"", ")", ";", "const", "CTIUtility_1", "=", "require", "(", "\"../tools/CTIUtility\"", ")", ";", "const", "CommandModule_1", "=", "require", "(", "\"./CommandModule\"", ")", ";", "class", "CleanCommandModule", "{", "do", "(", "executePath", ",", "passed", ")", "{", "return", "tslib_1", ".", "__awaiter", "(", "this", ",", "void", "0", ",", "void", "0", ",", "function", "*", "(", ")", "{", "const", "workDir", "=", "CTIUtility_1", ".", "isNotEmpty", "(", "passed", ".", "globOptions", ")", "&&", "CTIUtility_1", ".", "isNotEmpty", "(", "passed", ".", "globOptions", ".", "cwd", ")", "?", "passed", ".", "globOptions", ".", "cwd", ":", "process", ".", "cwd", "(", ")", ";", "const", "configFromExecutePath", "=", "yield", "configure_1", ".", "readConfigRC", "(", "configure_1", ".", "getRCFilename", "(", "executePath", ")", ")", ";", "const", "configFromWorkDir", "=", "yield", "configure_1", ".", "readConfigRC", "(", "configure_1", ".", "getRCFilename", "(", "workDir", ")", ")", ";", "const", "option", "=", "configure_1", ".", "concreteConfig", "(", "configure_1", ".", "merging", "(", "configure_1", ".", "merging", "(", "my_easy_fp_1", ".", "isPass", "(", "configFromExecutePath", ")", "?", "configFromExecutePath", ".", "pass", ":", "configure_1", ".", "getDeafultOptions", "(", ")", ",", "my_easy_fp_1", ".", "isPass", "(", "configFromWorkDir", ")", "?", "configFromWorkDir", ".", "pass", ":", "configure_1", ".", "getDeafultOptions", "(", ")", ")", ",", "passed", ")", ")", ";", "const", "logger", "=", "new", "CTILogger_1", ".", "CTILogger", "(", "option", ".", "verbose", ")", ";", "logger", ".", "log", "(", "chalk_1", ".", "default", ".", "yellowBright", "(", "'Option: '", ")", ",", "option", ")", ";", "const", "indexFiles", "=", "yield", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "glob", "(", "'**/index.ts'", ",", "{", "cwd", ":", "workDir", ",", "nonull", ":", "false", ",", "}", ")", ";", "const", "indexBackupFiles", "=", "yield", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "glob", "(", "'**/index.ts.bak'", ",", "{", "cwd", ":", "workDir", ",", "nonull", ":", "false", ",", "}", ")", ";", "const", "entrypointFiles", "=", "yield", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "glob", "(", "'**/entrypoint.ts'", ",", "{", "cwd", ":", "workDir", ",", "nonull", ":", "false", ",", "}", ")", ";", "const", "entrypointBackupFiles", "=", "yield", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "glob", "(", "'**/entrypoint.ts.bak'", ",", "{", "cwd", ":", "workDir", ",", "nonull", ":", "false", ",", "}", ")", ";", "const", "outputFiles", "=", "yield", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "glob", "(", "`**/${", "option", ".", "output", "}`", ",", "{", "cwd", ":", "workDir", ",", "nonull", ":", "false", ",", "}", ")", ";", "const", "outputBackupFiles", "=", "yield", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "glob", "(", "`**/${", "option", ".", "output", "}.bak`", ",", "{", "cwd", ":", "workDir", ",", "nonull", ":", "false", ",", "}", ")", ";", "const", "concatted", "=", "indexFiles", ".", "concat", "(", "indexBackupFiles", ")", ".", "concat", "(", "entrypointFiles", ")", ".", "concat", "(", "entrypointBackupFiles", ")", ".", "concat", "(", "outputFiles", ")", ".", "concat", "(", "outputBackupFiles", ")", ";", "const", "concattedSet", "=", "new", "Set", "(", "concatted", ")", ";", "if", "(", "concatted", ".", "length", "===", "0", ")", "{", "logger", ".", "flog", "(", "chalk_1", ".", "default", ".", "yellow", "(", "`Cannot find target file on working directory: ${", "workDir", "}`", ")", ")", ";", "}", "yield", "Promise", ".", "all", "(", "Array", ".", "from", "(", "concattedSet", ")", ".", "map", "(", "(", "file", ")", "=>", "{", "logger", ".", "log", "(", "chalk_1", ".", "default", ".", "redBright", "(", "'delete file: '", ")", ",", "path", ".", "join", "(", "workDir", ",", "file", ")", ")", ";", "return", "CommandModule_1", ".", "CommandModule", ".", "promisify", ".", "unlink", "(", "path", ".", "join", "(", "workDir", ",", "file", ")", ")", ";", "}", ")", ")", ";", "logger", ".", "flog", "(", "chalk_1", ".", "default", ".", "green", "(", "`clean succeeded: ${", "workDir", "}`", ")", ")", ";", "}", ")", ";", "}", "write", "(", "_param", ")", "{", "return", "tslib_1", ".", "__awaiter", "(", "this", ",", "void", "0", ",", "void", "0", ",", "function", "*", "(", ")", "{", "throw", "new", "Error", "(", "'Not Implemented'", ")", ";", "}", ")", ";", "}", "}", "exports", ".", "CleanCommandModule", "=", "CleanCommandModule", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661999
[ "\"use strict\"", ";", "Object", ".", "defineProperty", "(", "exports", ",", "\"__esModule\"", ",", "{", "value", ":", "true", "}", ")", ";", "exports", ".", "CommandModule", "=", "void", "0", ";", "const", "tslib_1", "=", "require", "(", "\"tslib\"", ")", ";", "const", "chalk", "=", "tslib_1", ".", "__importStar", "(", "require", "(", "\"chalk\"", ")", ")", ";", "const", "debug_1", "=", "tslib_1", ".", "__importDefault", "(", "require", "(", "\"debug\"", ")", ")", ";", "const", "fs", "=", "tslib_1", ".", "__importStar", "(", "require", "(", "\"fs\"", ")", ")", ";", "const", "glob_1", "=", "tslib_1", ".", "__importDefault", "(", "require", "(", "\"glob\"", ")", ")", ";", "const", "minimatch_1", "=", "tslib_1", ".", "__importDefault", "(", "require", "(", "\"minimatch\"", ")", ")", ";", "const", "path", "=", "tslib_1", ".", "__importStar", "(", "require", "(", "\"path\"", ")", ")", ";", "const", "util", "=", "tslib_1", ".", "__importStar", "(", "require", "(", "\"util\"", ")", ")", ";", "const", "log", "=", "debug_1", ".", "default", "(", "'cti:CommandModule'", ")", ";", "class", "CommandModule", "{", "static", "targetFileFilter", "(", "{", "filenames", ",", "option", ",", "logger", ",", "}", ")", "{", "const", "targetExts", "=", "option", ".", "targetExts", ".", "map", "(", "(", "ext", ")", "=>", "(", "ext", ".", "startsWith", "(", "'.'", ")", "?", "ext", ":", "`.${", "ext", "}`", ")", ")", ";", "try", "{", "log", "(", "'Start filter logic'", ",", "option", ".", "fileExcludePatterns", ",", "filenames", ")", ";", "const", "filteredFiles", "=", "filenames", ".", "filter", "(", "(", "filename", ")", "=>", "targetExts", ".", "indexOf", "(", "path", ".", "extname", "(", "filename", ")", ")", ">=", "0", ")", ".", "filter", "(", "(", "filename", ")", "=>", "{", "return", "!", "option", ".", "excludes", ".", "reduce", "(", "(", "result", ",", "exclude", ")", "=>", "{", "return", "result", "||", "path", ".", "dirname", "(", "filename", ")", ".", "indexOf", "(", "exclude", ")", ">=", "0", ";", "}", ",", "false", ")", ";", "}", ")", ".", "filter", "(", "(", "filename", ")", "=>", "!", "filename", ".", "endsWith", "(", "'.d.ts'", ")", ")", ".", "filter", "(", "(", "filename", ")", "=>", "{", "return", "!", "option", ".", "fileExcludePatterns", ".", "reduce", "(", "(", "result", ",", "excludePattern", ")", "=>", "{", "log", "(", "'ExcludePattern: '", ",", "glob_1", ".", "default", ".", "hasMagic", "(", "excludePattern", ",", "option", ".", "globOptions", ")", ",", "result", "||", "minimatch_1", ".", "default", "(", "filename", ",", "excludePattern", ")", ")", ";", "if", "(", "!", "glob_1", ".", "default", ".", "hasMagic", "(", "excludePattern", ",", "option", ".", "globOptions", ")", ")", "{", "return", "result", "||", "minimatch_1", ".", "default", "(", "filename", ",", "`*${", "excludePattern", "}*`", ")", ";", "}", "return", "result", "||", "minimatch_1", ".", "default", "(", "filename", ",", "excludePattern", ")", ";", "}", ",", "false", ")", ";", "}", ")", ".", "filter", "(", "(", "filename", ")", "=>", "{", "return", "!", "option", ".", "targetExts", ".", "map", "(", "(", "ext", ")", "=>", "`index.${", "ext", "}`", ")", ".", "reduce", "(", "(", "result", ",", "indexFile", ")", "=>", "{", "return", "result", "||", "filename", ".", "indexOf", "(", "indexFile", ")", ">=", "0", ";", "}", ",", "false", ")", ";", "}", ")", ".", "filter", "(", "(", "filename", ")", "=>", "{", "return", "filename", "!==", "'.'", ";", "}", ")", ";", "return", "filteredFiles", ";", "}", "catch", "(", "err", ")", "{", "logger", ".", "error", "(", "chalk", ".", "default", ".", "redBright", "(", "'Error occured: '", ",", "err", ")", ")", ";", "return", "[", "]", ";", "}", "}", "}", "exports", ".", "CommandModule", "=", "CommandModule", ";", "CommandModule", ".", "promisify", "=", "{", "exists", ":", "util", ".", "promisify", "(", "fs", ".", "exists", ")", ",", "glob", ":", "util", ".", "promisify", "(", "glob_1", ".", "default", ")", ",", "readDir", ":", "util", ".", "promisify", "(", "fs", ".", "readdir", ")", ",", "readFile", ":", "util", ".", "promisify", "(", "fs", ".", "readFile", ")", ",", "stat", ":", "util", ".", "promisify", "(", "fs", ".", "stat", ")", ",", "unlink", ":", "util", ".", "promisify", "(", "fs", ".", "unlink", ")", ",", "writeFile", ":", "util", ".", "promisify", "(", "fs", ".", "writeFile", ")", ",", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]