[Pkg-javascript-commits] [node-escape-string-regexp] 01/10: Imported Upstream version 1.0.5

Mathias Behrle mbehrle at moszumanska.debian.org
Sat Jul 23 13:42:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

mbehrle pushed a commit to branch master
in repository node-escape-string-regexp.

commit fc694ace91892db7c15e0047bd2a7dc4a0589705
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Jul 18 13:21:06 2016 +0200

    Imported Upstream version 1.0.5
---
 .editorconfig |  3 +--
 .jshintrc     | 13 -------------
 .travis.yml   |  2 +-
 index.js      |  2 +-
 package.json  | 15 ++++++++-------
 readme.md     |  8 ++++----
 test.js       | 12 +++++++-----
 7 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 8311fe1..8f9d77e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,3 @@
-# editorconfig.org
 root = true
 
 [*]
@@ -8,7 +7,7 @@ charset = utf-8
 trim_trailing_whitespace = true
 insert_final_newline = true
 
-[package.json]
+[{package.json,*.yml}]
 indent_style = space
 indent_size = 2
 
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 804f8af..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-	"node": true,
-	"esnext": true,
-	"bitwise": true,
-	"camelcase": true,
-	"curly": true,
-	"immed": true,
-	"newcap": true,
-	"noarg": true,
-	"undef": true,
-	"unused": "vars",
-	"strict": true
-}
diff --git a/.travis.yml b/.travis.yml
index dedfc07..52ba159 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 sudo: false
 language: node_js
 node_js:
-  - 'iojs'
+  - 'stable'
   - '0.12'
   - '0.10'
diff --git a/index.js b/index.js
index ac6572c..7834bf9 100644
--- a/index.js
+++ b/index.js
@@ -7,5 +7,5 @@ module.exports = function (str) {
 		throw new TypeError('Expected a string');
 	}
 
-	return str.replace(matchOperatorsRe,  '\\$&');
+	return str.replace(matchOperatorsRe, '\\$&');
 };
diff --git a/package.json b/package.json
index 909ffd0..f307df3 100644
--- a/package.json
+++ b/package.json
@@ -1,40 +1,41 @@
 {
   "name": "escape-string-regexp",
-  "version": "1.0.3",
+  "version": "1.0.5",
   "description": "Escape RegExp special characters",
   "license": "MIT",
   "repository": "sindresorhus/escape-string-regexp",
   "author": {
     "name": "Sindre Sorhus",
     "email": "sindresorhus at gmail.com",
-    "url": "http://sindresorhus.com"
+    "url": "sindresorhus.com"
   },
   "maintainers": [
-    "Sindre Sorhus <sindresorhus at gmail.com> (http://sindresorhus.com)",
-    "Joshua Appelman <jappelman at xebia.com> (http://jbnicolai.com)"
+    "Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)",
+    "Joshua Boy Nicolai Appelman <joshua at jbna.nl> (jbna.nl)"
   ],
   "engines": {
     "node": ">=0.8.0"
   },
   "scripts": {
-    "test": "mocha"
+    "test": "xo && ava"
   },
   "files": [
     "index.js"
   ],
   "keywords": [
+    "escape",
     "regex",
     "regexp",
     "re",
     "regular",
     "expression",
-    "escape",
     "string",
     "str",
     "special",
     "characters"
   ],
   "devDependencies": {
-    "mocha": "*"
+    "ava": "*",
+    "xo": "*"
   }
 }
diff --git a/readme.md b/readme.md
index 808a963..87ac82d 100644
--- a/readme.md
+++ b/readme.md
@@ -5,7 +5,7 @@
 
 ## Install
 
-```sh
+```
 $ npm install --save escape-string-regexp
 ```
 
@@ -13,10 +13,10 @@ $ npm install --save escape-string-regexp
 ## Usage
 
 ```js
-var escapeStringRegexp = require('escape-string-regexp');
+const escapeStringRegexp = require('escape-string-regexp');
 
-var escapedString = escapeStringRegexp('how much $ for a unicorn?');
-//=> how much \$ for a unicorn\?
+const escapedString = escapeStringRegexp('how much $ for a unicorn?');
+//=> 'how much \$ for a unicorn\?'
 
 new RegExp(escapedString);
 ```
diff --git a/test.js b/test.js
index f968b71..cda5ea4 100644
--- a/test.js
+++ b/test.js
@@ -1,7 +1,9 @@
-'use strict';
-var assert = require('assert');
-var escapeStringRegexp = require('./');
+import test from 'ava';
+import fn from './';
 
-it('should escape RegExp special characters', function () {
-	assert.strictEqual(escapeStringRegexp('\\ ^ $ * + ? . ( ) | { } [ ]'), '\\\\ \\^ \\$ \\* \\+ \\? \\. \\( \\) \\| \\{ \\} \\[ \\]');
+test(t => {
+	t.is(
+		fn('\\ ^ $ * + ? . ( ) | { } [ ]'),
+		'\\\\ \\^ \\$ \\* \\+ \\? \\. \\( \\) \\| \\{ \\} \\[ \\]'
+	);
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-escape-string-regexp.git



More information about the Pkg-javascript-commits mailing list