8889841cindex.js000066600000000304150514457070006222 0ustar00'use strict' var r = /[A-Z]/g module.exports = function (a, b) { a = a.replace(r, replacer) b = b.replace(r, replacer) return a === b } function replacer (m) { return m.toLowerCase() } README.md000066600000001216150514457070006037 0ustar00# dns-equal Compare DNS record strings for equality. Enforces [RFC 1035](https://tools.ietf.org/html/rfc1035) domain comparison. [![Build status](https://travis-ci.org/watson/dns-equal.svg?branch=master)](https://travis-ci.org/watson/dns-equal) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) ## Installation ``` npm install dns-equal --save ``` ## Usage ```js var dnsEqual = require('dns-equal') var domain1 = 'Example.COM' var domain2 = 'example.com' if (dnsEqual(domain1, domain2)) { console.log('The two domains are the same') } ``` ## License MIT .npmignore000066600000000015150514457070006553 0ustar00node_modules .travis.yml000066600000000071150514457070006667 0ustar00language: node_js node_js: - '5' - '4' - '0.12' - '0.10' test.js000066600000000537150514457070006102 0ustar00'use strict' var assert = require('assert') var dnsEqual = require('./') assert.strictEqual(dnsEqual('Foo', 'foo'), true) assert.strictEqual(dnsEqual('FooÆØÅ', 'fooÆØÅ'), true) assert.strictEqual(dnsEqual('foo', 'bar'), false) assert.strictEqual(dnsEqual('FooÆØÅ', 'fooæøå'), false) assert.strictEqual(dnsEqual('café', 'cafe'), false) LICENSE000066600000002076150514457070005572 0ustar00The MIT License (MIT) Copyright (c) 2016 Thomas Watson Steen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package.json000066600000001471150514457070007051 0ustar00{ "name": "dns-equal", "version": "1.0.0", "description": "Compare DNS record strings for equality", "main": "index.js", "dependencies": {}, "devDependencies": { "standard": "^5.4.1" }, "scripts": { "test": "standard && node test.js" }, "repository": { "type": "git", "url": "git+https://github.com/watson/dns-equal.git" }, "keywords": [ "dns", "compare", "comparing", "equal", "equality", "match", "downcase", "lowercase", "case-insensitive" ], "author": "Thomas Watson Steen (https://twitter.com/wa7son)", "license": "MIT", "bugs": { "url": "https://github.com/watson/dns-equal/issues" }, "homepage": "https://github.com/watson/dns-equal#readme", "coordinates": [ 56.010004025953165, 11.961870541375674 ] }