pax_global_header00006660000000000000000000000064126623316520014520gustar00rootroot0000000000000052 comment=db124a3e1aae9d692c4899e42a5c6c3e329eaa20 escape-string-regexp-1.0.5/000077500000000000000000000000001266233165200155575ustar00rootroot00000000000000escape-string-regexp-1.0.5/.editorconfig000066400000000000000000000003471266233165200202400ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false escape-string-regexp-1.0.5/.gitattributes000066400000000000000000000000141266233165200204450ustar00rootroot00000000000000* text=auto escape-string-regexp-1.0.5/.gitignore000066400000000000000000000000151266233165200175430ustar00rootroot00000000000000node_modules escape-string-regexp-1.0.5/.travis.yml000066400000000000000000000001121266233165200176620ustar00rootroot00000000000000sudo: false language: node_js node_js: - 'stable' - '0.12' - '0.10' escape-string-regexp-1.0.5/index.js000066400000000000000000000003421266233165200172230ustar00rootroot00000000000000'use strict'; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return str.replace(matchOperatorsRe, '\\$&'); }; escape-string-regexp-1.0.5/license000066400000000000000000000021371266233165200171270ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) 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. escape-string-regexp-1.0.5/package.json000066400000000000000000000014271266233165200200510ustar00rootroot00000000000000{ "name": "escape-string-regexp", "version": "1.0.5", "description": "Escape RegExp special characters", "license": "MIT", "repository": "sindresorhus/escape-string-regexp", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "maintainers": [ "Sindre Sorhus (sindresorhus.com)", "Joshua Boy Nicolai Appelman (jbna.nl)" ], "engines": { "node": ">=0.8.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "escape", "regex", "regexp", "re", "regular", "expression", "string", "str", "special", "characters" ], "devDependencies": { "ava": "*", "xo": "*" } } escape-string-regexp-1.0.5/readme.md000066400000000000000000000010501266233165200173320ustar00rootroot00000000000000# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) > Escape RegExp special characters ## Install ``` $ npm install --save escape-string-regexp ``` ## Usage ```js const escapeStringRegexp = require('escape-string-regexp'); const escapedString = escapeStringRegexp('how much $ for a unicorn?'); //=> 'how much \$ for a unicorn\?' new RegExp(escapedString); ``` ## License MIT © [Sindre Sorhus](http://sindresorhus.com) escape-string-regexp-1.0.5/test.js000066400000000000000000000002541266233165200170750ustar00rootroot00000000000000import test from 'ava'; import fn from './'; test(t => { t.is( fn('\\ ^ $ * + ? . ( ) | { } [ ]'), '\\\\ \\^ \\$ \\* \\+ \\? \\. \\( \\) \\| \\{ \\} \\[ \\]' ); });