opennms
Version:
Client API for the OpenNMS network monitoring platform
1 lines • 7.24 kB
JSON
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/ip-address/lib/v6/attributes.js","dependencies":[{"path":"/data/node_modules/ip-address/lib/v6/attributes.js","mtime":1553611387684},{"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\nvar common = require('../common.js');\nvar v6 = require('./constants.js');\n\n/**\n * Returns true if the address is valid, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isValid = function () {\n return this.valid;\n};\n\n/**\n * Returns true if the given address is in the subnet of the current address\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isInSubnet = common.isInSubnet;\n\n/**\n * Returns true if the address is correct, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isCorrect = common.isCorrect(v6.BITS);\n\n/**\n * Returns true if the address is in the canonical form, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isCanonical = common.falseIfInvalid(function () {\n return this.addressMinusSuffix === this.canonicalForm();\n});\n\n/**\n * Returns true if the address is a link local address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isLinkLocal = common.falseIfInvalid(function () {\n // Zeroes are required, i.e. we can't check isInSubnet with 'fe80::/10'\n if (this.getBitsBase2(0, 64) === '1111111010000000000000000000000000000000000000000000000000000000') {\n return true;\n }\n\n return false;\n});\n\n/**\n * Returns true if the address is a multicast address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isMulticast = common.falseIfInvalid(function () {\n return this.getType() === 'Multicast';\n});\n\n/**\n * Returns true if the address is a v4-in-v6 address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.is4 = common.falseIfInvalid(function () {\n return this.v4;\n});\n\n/**\n * Returns true if the address is a Teredo address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isTeredo = common.falseIfInvalid(function () {\n return this.isInSubnet(new this.constructor('2001::/32'));\n});\n\n/**\n * Returns true if the address is a 6to4 address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.is6to4 = common.falseIfInvalid(function () {\n return this.isInSubnet(new this.constructor('2002::/16'));\n});\n\n/**\n * Returns true if the address is a loopback address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isLoopback = common.falseIfInvalid(function () {\n return this.getType() === 'Loopback';\n});",{"version":3,"sources":["node_modules/ip-address/lib/v6/attributes.js"],"names":["common","require","v6","exports","isValid","valid","isInSubnet","isCorrect","BITS","isCanonical","falseIfInvalid","addressMinusSuffix","canonicalForm","isLinkLocal","getBitsBase2","isMulticast","getType","is4","v4","isTeredo","constructor","is6to4","isLoopback"],"mappings":"AAAA;;AAEA,IAAIA,SAASC,QAAQ,cAAR,CAAb;AACA,IAAIC,KAAKD,QAAQ,gBAAR,CAAT;;AAEA;;;;;;AAMAE,QAAQC,OAAR,GAAkB,YAAY;AAC5B,SAAO,KAAKC,KAAZ;AACD,CAFD;;AAIA;;;;;;AAMAF,QAAQG,UAAR,GAAqBN,OAAOM,UAA5B;;AAEA;;;;;;AAMAH,QAAQI,SAAR,GAAoBP,OAAOO,SAAP,CAAiBL,GAAGM,IAApB,CAApB;;AAEA;;;;;;AAMAL,QAAQM,WAAR,GAAsBT,OAAOU,cAAP,CAAsB,YAAY;AACtD,SAAO,KAAKC,kBAAL,KAA4B,KAAKC,aAAL,EAAnC;AACD,CAFqB,CAAtB;;AAIA;;;;;;AAMAT,QAAQU,WAAR,GAAsBb,OAAOU,cAAP,CAAsB,YAAY;AACtD;AACA,MAAI,KAAKI,YAAL,CAAkB,CAAlB,EAAqB,EAArB,MACF,kEADF,EACsE;AACpE,WAAO,IAAP;AACD;;AAED,SAAO,KAAP;AACD,CARqB,CAAtB;;AAUA;;;;;;AAMAX,QAAQY,WAAR,GAAsBf,OAAOU,cAAP,CAAsB,YAAY;AACtD,SAAO,KAAKM,OAAL,OAAmB,WAA1B;AACD,CAFqB,CAAtB;;AAIA;;;;;;AAMAb,QAAQc,GAAR,GAAcjB,OAAOU,cAAP,CAAsB,YAAY;AAC9C,SAAO,KAAKQ,EAAZ;AACD,CAFa,CAAd;;AAIA;;;;;;AAMAf,QAAQgB,QAAR,GAAmBnB,OAAOU,cAAP,CAAsB,YAAY;AACnD,SAAO,KAAKJ,UAAL,CAAgB,IAAI,KAAKc,WAAT,CAAqB,WAArB,CAAhB,CAAP;AACD,CAFkB,CAAnB;;AAIA;;;;;;AAMAjB,QAAQkB,MAAR,GAAiBrB,OAAOU,cAAP,CAAsB,YAAY;AACjD,SAAO,KAAKJ,UAAL,CAAgB,IAAI,KAAKc,WAAT,CAAqB,WAArB,CAAhB,CAAP;AACD,CAFgB,CAAjB;;AAIA;;;;;;AAMAjB,QAAQmB,UAAR,GAAqBtB,OAAOU,cAAP,CAAsB,YAAY;AACrD,SAAO,KAAKM,OAAL,OAAmB,UAA1B;AACD,CAFoB,CAArB","file":"attributes.js","sourceRoot":"/data","sourcesContent":["'use strict';\n\nvar common = require('../common.js');\nvar v6 = require('./constants.js');\n\n/**\n * Returns true if the address is valid, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isValid = function () {\n return this.valid;\n};\n\n/**\n * Returns true if the given address is in the subnet of the current address\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isInSubnet = common.isInSubnet;\n\n/**\n * Returns true if the address is correct, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isCorrect = common.isCorrect(v6.BITS);\n\n/**\n * Returns true if the address is in the canonical form, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isCanonical = common.falseIfInvalid(function () {\n return this.addressMinusSuffix === this.canonicalForm();\n});\n\n/**\n * Returns true if the address is a link local address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isLinkLocal = common.falseIfInvalid(function () {\n // Zeroes are required, i.e. we can't check isInSubnet with 'fe80::/10'\n if (this.getBitsBase2(0, 64) ===\n '1111111010000000000000000000000000000000000000000000000000000000') {\n return true;\n }\n\n return false;\n});\n\n/**\n * Returns true if the address is a multicast address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isMulticast = common.falseIfInvalid(function () {\n return this.getType() === 'Multicast';\n});\n\n/**\n * Returns true if the address is a v4-in-v6 address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.is4 = common.falseIfInvalid(function () {\n return this.v4;\n});\n\n/**\n * Returns true if the address is a Teredo address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isTeredo = common.falseIfInvalid(function () {\n return this.isInSubnet(new this.constructor('2001::/32'));\n});\n\n/**\n * Returns true if the address is a 6to4 address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.is6to4 = common.falseIfInvalid(function () {\n return this.isInSubnet(new this.constructor('2002::/16'));\n});\n\n/**\n * Returns true if the address is a loopback address, false otherwise\n * @memberof Address6\n * @instance\n * @returns {boolean}\n */\nexports.isLoopback = common.falseIfInvalid(function () {\n return this.getType() === 'Loopback';\n});\n"]}]}