summaryrefslogtreecommitdiffstats
path: root/node_modules/regexp-clone/README.md
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/regexp-clone/README.md
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/regexp-clone/README.md')
-rw-r--r--node_modules/regexp-clone/README.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/node_modules/regexp-clone/README.md b/node_modules/regexp-clone/README.md
new file mode 100644
index 0000000..4a16bad
--- /dev/null
+++ b/node_modules/regexp-clone/README.md
@@ -0,0 +1,42 @@
+#regexp-clone
+==============
+
+Clones RegExps with flag and `lastIndex` preservation.
+
+```js
+const regexpClone = require('regexp-clone');
+
+const a = /somethin/misguy;
+console.log(a.global); // true
+console.log(a.ignoreCase); // true
+console.log(a.multiline); // true
+console.log(a.dotAll); // true
+console.log(a.unicode); // true
+console.log(a.sticky); // true
+
+const b = regexpClone(a);
+console.log(b.global); // true
+console.log(b.ignoreCase); // true
+console.log(b.multiline); // true
+console.log(b.dotAll); // true
+console.log(b.unicode); // true
+console.log(b.sticky); // true
+
+const c = /hi/g;
+c.test('this string hi there');
+assert.strictEqual(c.lastIndex, 3);
+
+const d = regexpClone(c);
+assert.strictEqual(d.lastIndex, 3);
+d.test('this string hi there');
+assert.strictEqual(d.lastIndex, 14);
+assert.strictEqual(c.lastIndex, 3);
+```
+
+```
+npm install regexp-clone
+```
+
+## License
+
+[MIT](https://github.com/aheckmann/regexp-clone/blob/master/LICENSE)