opennms
Version:
Client API for the OpenNMS network monitoring platform
1 lines • 7.05 kB
JSON
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/source-map/lib/mapping-list.js","dependencies":[{"path":"/data/node_modules/source-map/lib/mapping-list.js","mtime":1553611387364},{"path":"/data/.babelrc","mtime":1553611371556},{"path":"/data/node_modules/cache-loader/dist/cjs.js","mtime":1553611387012},{"path":"/data/node_modules/babel-loader/lib/index.js","mtime":1553611386992}],"contextDependencies":[],"result":["'use strict';\n\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = { generatedLine: -1, generatedColumn: 0 };\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n};\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;",{"version":3,"sources":["node_modules/source-map/lib/mapping-list.js"],"names":["util","require","generatedPositionAfter","mappingA","mappingB","lineA","generatedLine","lineB","columnA","generatedColumn","columnB","compareByGeneratedPositionsInflated","MappingList","_array","_sorted","_last","prototype","unsortedForEach","MappingList_forEach","aCallback","aThisArg","forEach","add","MappingList_add","aMapping","push","toArray","MappingList_toArray","sort","exports"],"mappings":";;AAAA;AACA;;;;;;AAMA,IAAIA,OAAOC,QAAQ,QAAR,CAAX;;AAEA;;;;AAIA,SAASC,sBAAT,CAAgCC,QAAhC,EAA0CC,QAA1C,EAAoD;AAClD;AACA,MAAIC,QAAQF,SAASG,aAArB;AACA,MAAIC,QAAQH,SAASE,aAArB;AACA,MAAIE,UAAUL,SAASM,eAAvB;AACA,MAAIC,UAAUN,SAASK,eAAvB;AACA,SAAOF,QAAQF,KAAR,IAAiBE,SAASF,KAAT,IAAkBK,WAAWF,OAA9C,IACAR,KAAKW,mCAAL,CAAyCR,QAAzC,EAAmDC,QAAnD,KAAgE,CADvE;AAED;;AAED;;;;;AAKA,SAASQ,WAAT,GAAuB;AACrB,OAAKC,MAAL,GAAc,EAAd;AACA,OAAKC,OAAL,GAAe,IAAf;AACA;AACA,OAAKC,KAAL,GAAa,EAACT,eAAe,CAAC,CAAjB,EAAoBG,iBAAiB,CAArC,EAAb;AACD;;AAED;;;;;;AAMAG,YAAYI,SAAZ,CAAsBC,eAAtB,GACE,SAASC,mBAAT,CAA6BC,SAA7B,EAAwCC,QAAxC,EAAkD;AAChD,OAAKP,MAAL,CAAYQ,OAAZ,CAAoBF,SAApB,EAA+BC,QAA/B;AACD,CAHH;;AAKA;;;;;AAKAR,YAAYI,SAAZ,CAAsBM,GAAtB,GAA4B,SAASC,eAAT,CAAyBC,QAAzB,EAAmC;AAC7D,MAAItB,uBAAuB,KAAKa,KAA5B,EAAmCS,QAAnC,CAAJ,EAAkD;AAChD,SAAKT,KAAL,GAAaS,QAAb;AACA,SAAKX,MAAL,CAAYY,IAAZ,CAAiBD,QAAjB;AACD,GAHD,MAGO;AACL,SAAKV,OAAL,GAAe,KAAf;AACA,SAAKD,MAAL,CAAYY,IAAZ,CAAiBD,QAAjB;AACD;AACF,CARD;;AAUA;;;;;;;;;AASAZ,YAAYI,SAAZ,CAAsBU,OAAtB,GAAgC,SAASC,mBAAT,GAA+B;AAC7D,MAAI,CAAC,KAAKb,OAAV,EAAmB;AACjB,SAAKD,MAAL,CAAYe,IAAZ,CAAiB5B,KAAKW,mCAAtB;AACA,SAAKG,OAAL,GAAe,IAAf;AACD;AACD,SAAO,KAAKD,MAAZ;AACD,CAND;;AAQAgB,QAAQjB,WAAR,GAAsBA,WAAtB","file":"mapping-list.js","sourceRoot":"/data","sourcesContent":["/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n"]}]}