is-loopback-addr
Advanced tools
| /** | ||
| * Check if a given ip address is a loopback address | ||
| */ | ||
| export declare function isLoopbackAddr(ip: string): boolean; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,cAAc,CAAE,EAAE,EAAE,MAAM,WAGzC"} |
| /** | ||
| * Check if a given ip address is a loopback address | ||
| */ | ||
| export function isLoopbackAddr(ip) { | ||
| return /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(ip) || | ||
| /^::1$/.test(ip); | ||
| } | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,cAAc,CAAE,EAAU;IACxC,OAAO,kDAAkD,CAAC,IAAI,CAAC,EAAE,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACpB,CAAC"} |
| /** | ||
| * Check if a given ip address is a loopback address | ||
| */ | ||
| export function isLoopbackAddr (ip: string) { | ||
| return /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(ip) || | ||
| /^::1$/.test(ip) | ||
| } |
+123
-19
| { | ||
| "name": "is-loopback-addr", | ||
| "version": "1.0.1", | ||
| "version": "2.0.0", | ||
| "description": "Check if a IP address is a loopback address", | ||
| "main": "index.js", | ||
| "author": "Vasco Santos", | ||
| "type": "module", | ||
| "types": "./dist/src/index.d.ts", | ||
| "files": [ | ||
| "src", | ||
| "dist/src", | ||
| "!dist/test", | ||
| "!**/*.tsbuildinfo" | ||
| ], | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/src/index.js" | ||
| } | ||
| }, | ||
| "eslintConfig": { | ||
| "extends": "ipfs", | ||
| "parserOptions": { | ||
| "sourceType": "module" | ||
| } | ||
| }, | ||
| "release": { | ||
| "branches": [ | ||
| "main" | ||
| ], | ||
| "plugins": [ | ||
| [ | ||
| "@semantic-release/commit-analyzer", | ||
| { | ||
| "preset": "conventionalcommits", | ||
| "releaseRules": [ | ||
| { | ||
| "breaking": true, | ||
| "release": "major" | ||
| }, | ||
| { | ||
| "revert": true, | ||
| "release": "patch" | ||
| }, | ||
| { | ||
| "type": "feat", | ||
| "release": "minor" | ||
| }, | ||
| { | ||
| "type": "fix", | ||
| "release": "patch" | ||
| }, | ||
| { | ||
| "type": "chore", | ||
| "release": "patch" | ||
| }, | ||
| { | ||
| "type": "docs", | ||
| "release": "patch" | ||
| }, | ||
| { | ||
| "type": "test", | ||
| "release": "patch" | ||
| }, | ||
| { | ||
| "scope": "no-release", | ||
| "release": false | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/release-notes-generator", | ||
| { | ||
| "preset": "conventionalcommits", | ||
| "presetConfig": { | ||
| "types": [ | ||
| { | ||
| "type": "feat", | ||
| "section": "Features" | ||
| }, | ||
| { | ||
| "type": "fix", | ||
| "section": "Bug Fixes" | ||
| }, | ||
| { | ||
| "type": "chore", | ||
| "section": "Trivial Changes" | ||
| }, | ||
| { | ||
| "type": "docs", | ||
| "section": "Trivial Changes" | ||
| }, | ||
| { | ||
| "type": "test", | ||
| "section": "Tests" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ], | ||
| "@semantic-release/changelog", | ||
| "@semantic-release/npm", | ||
| "@semantic-release/github", | ||
| "@semantic-release/git" | ||
| ] | ||
| }, | ||
| "scripts": { | ||
| "test": "aegir test -t node -t browser", | ||
| "test:browser": "aegir test -t browser", | ||
| "test:node": "aegir test -t node", | ||
| "lint": "aegir lint", | ||
| "release": "aegir release --docs", | ||
| "release-minor": "aegir release --type minor --docs", | ||
| "release-major": "aegir release -t node -t browser --type major --docs", | ||
| "build": "aegir build" | ||
| "dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js", | ||
| "build": "tsc", | ||
| "pretest": "npm run build", | ||
| "test": "aegir test -f ./dist/test", | ||
| "test:chrome": "npm run test -- -t browser", | ||
| "test:chrome-webworker": "npm run test -- -t webworker", | ||
| "test:firefox": "npm run test -- -t browser -- --browser firefox", | ||
| "test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox", | ||
| "test:node": "npm run test -- -t node --cov", | ||
| "test:electron-main": "npm run test -- -t electron-main", | ||
| "release": "semantic-release" | ||
| }, | ||
| "files": [ | ||
| "src", | ||
| "dist" | ||
| ], | ||
| "author": "Vasco Santos", | ||
| "license": "MIT", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/vasco-santos/is-loopback-addr.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/vasco-santos/is-loopback-addr/issues" | ||
| }, | ||
| "homepage": "https://github.com/vasco-santos/is-loopback-addr#readme", | ||
| "devDependencies": { | ||
| "aegir": "^27.0.0" | ||
| }, | ||
| "contributors": [ | ||
| "Vasco Santos <vasco.santos@ua.pt>" | ||
| ] | ||
| "aegir": "^36.1.3" | ||
| } | ||
| } |
+5
-2
| # is-loopback-addr | ||
| [](https://travis-ci.org/vasco-santos/is-loopback-addr) | ||
| [](https://github.com/vasco-santos/is-loopback-addr/actions/workflows/js-test-and-release.yml) | ||
| [](https://david-dm.org/vasco-santos/is-loopback-addr) | ||
| [](https://standardjs.com) | ||
| [](https://www.npmjs.com/package/is-loopback-addr) | ||
| [](https://bundlephobia.com/result?p=is-loopback-addr) | ||
| [](https://codecov.io/gh/vasco-santos/is-loopback-addr) | ||
@@ -20,3 +23,3 @@ > Check if a IP address is a loopback address | ||
| ```js | ||
| const isLoopbackAddr = require('is-loopback-addr') | ||
| import { isLoopbackAddr } from 'is-loopback-addr' | ||
@@ -23,0 +26,0 @@ console.log(isLoopbackAddr('127.0.0.1')) // true |
-15
| <a name="1.0.1"></a> | ||
| ## [1.0.1](https://github.com/vasco-santos/is-loopback-addr/compare/v1.0.0...v1.0.1) (2020-10-10) | ||
| <a name="1.0.0"></a> | ||
| # 1.0.0 (2020-10-07) | ||
| ### Features | ||
| * initial implementation ([#1](https://github.com/vasco-santos/is-loopback-addr/issues/1)) ([879e5b1](https://github.com/vasco-santos/is-loopback-addr/commit/879e5b1)) | ||
| !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IsLoopbackAddr=t():e.IsLoopbackAddr=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";e.exports=function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^::1$/.test(e)}}])})); |
-14
| 'use strict' | ||
| /** | ||
| * Check if a given ip address is a loopback address | ||
| * | ||
| * @param {string} ip - ip address to check | ||
| * @returns {boolean} | ||
| */ | ||
| function isLoopbackAddr (ip) { | ||
| return /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(ip) || | ||
| /^::1$/.test(ip) | ||
| } | ||
| module.exports = isLoopbackAddr |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
7314
40.2%8
33.33%18
50%0
-100%0
-100%38
8.57%0
-100%0
-100%Yes
NaN