Update Node_modules

This commit is contained in:
2019-07-02 16:05:15 +02:00
parent 95a0ff3913
commit 9dab5e2dbc
3495 changed files with 39728 additions and 465154 deletions
-2
View File
@@ -1,2 +0,0 @@
*.sw*
node_modules/
+12 -3
View File
@@ -1,5 +1,14 @@
sudo: false
language: node_js
node_js:
- 0.6
- 0.8
- 0.10
- 8
- 10
- 12
matrix:
include:
- node_js: "13"
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
allow_failures:
# Allow the nightly installs to fail
- env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
script: "npm test"
+28 -4
View File
@@ -1,16 +1,40 @@
#regexp-clone
==============
Clones RegExps with flag preservation
Clones RegExps with flag and `lastIndex` preservation.
```js
var regexpClone = require('regexp-clone');
const regexpClone = require('regexp-clone');
var a = /somethin/g;
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
var b = regexpClone(a);
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
+10 -3
View File
@@ -1,5 +1,5 @@
var toString = Object.prototype.toString;
const toString = Object.prototype.toString;
function isRegExp (o) {
return 'object' == typeof o
@@ -11,10 +11,17 @@ module.exports = exports = function (regexp) {
throw new TypeError('Not a RegExp');
}
var flags = [];
const flags = [];
if (regexp.global) flags.push('g');
if (regexp.multiline) flags.push('m');
if (regexp.ignoreCase) flags.push('i');
return new RegExp(regexp.source, flags.join(''));
if (regexp.dotAll) flags.push('s');
if (regexp.unicode) flags.push('u');
if (regexp.sticky) flags.push('y');
const result = new RegExp(regexp.source, flags.join(''));
if (typeof regexp.lastIndex === 'number') {
result.lastIndex = regexp.lastIndex;
}
return result;
}
+12 -12
View File
@@ -1,28 +1,28 @@
{
"_from": "regexp-clone@0.0.1",
"_id": "regexp-clone@0.0.1",
"_from": "regexp-clone@1.0.0",
"_id": "regexp-clone@1.0.0",
"_inBundle": false,
"_integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=",
"_integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==",
"_location": "/regexp-clone",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "regexp-clone@0.0.1",
"raw": "regexp-clone@1.0.0",
"name": "regexp-clone",
"escapedName": "regexp-clone",
"rawSpec": "0.0.1",
"rawSpec": "1.0.0",
"saveSpec": null,
"fetchSpec": "0.0.1"
"fetchSpec": "1.0.0"
},
"_requiredBy": [
"/mongoose",
"/mquery"
],
"_resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz",
"_shasum": "a7c2e09891fdbf38fbb10d376fb73003e68ac589",
"_spec": "regexp-clone@0.0.1",
"_where": "D:\\Gitterra\\om\\node_modules\\mongoose",
"_resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz",
"_shasum": "222db967623277056260b992626354a04ce9bf63",
"_spec": "regexp-clone@1.0.0",
"_where": "/home/erik/Documents/workspace_brackets/a1_BME_Project_Ohm/om/node_modules/mongoose",
"author": {
"name": "Aaron Heckmann",
"email": "aaron.heckmann+github@gmail.com"
@@ -34,7 +34,7 @@
"deprecated": false,
"description": "Clone RegExps with options",
"devDependencies": {
"mocha": "1.8.1"
"mocha": "^6.1.4"
},
"homepage": "https://github.com/aheckmann/regexp-clone#readme",
"keywords": [
@@ -51,5 +51,5 @@
"scripts": {
"test": "make test"
},
"version": "0.0.1"
"version": "1.0.0"
}
+110 -51
View File
@@ -1,6 +1,6 @@
var assert = require('assert')
var clone = require('../');
const assert = require('assert')
const clone = require('../');
describe('regexp-clone', function(){
function hasEqualSource (a, b) {
@@ -8,7 +8,7 @@ describe('regexp-clone', function(){
assert.equal(a.source, b.source);
}
function isInsensitive (a) {
function isIgnoreCase (a) {
assert.ok(a.ignoreCase);
}
@@ -20,91 +20,150 @@ describe('regexp-clone', function(){
assert.ok(a.multiline);
}
function insensitiveFlag (a) {
var b = clone(a);
hasEqualSource(a, b);
isInsensitive(a);
isInsensitive(b);
function isDotAll (a) {
assert.ok(a.dotAll);
}
function globalFlag (a) {
var b = clone(a);
hasEqualSource(a, b);
isGlobal(a);
isGlobal(b);
function isUnicode (a) {
assert.ok(a.unicode);
}
function multilineFlag (a) {
var b = clone(a);
function isSticky(a) {
assert.ok(a.sticky);
}
function testFlag (a, method) {
const b = clone(a);
hasEqualSource(a, b);
isMultiline(a);
isMultiline(b);
method(a);
method(b);
}
function lastIndex(a) {
a.test('this string hi there');
assert.strictEqual(a.lastIndex, 3);
const b = clone(a);
assert.strictEqual(b.lastIndex, 3);
assert.strictEqual(a.lastIndex, 3);
b.test('this string hi there');
assert.strictEqual(b.lastIndex, 14);
assert.strictEqual(a.lastIndex, 3);
}
function allFlags(a) {
const b = clone(a);
hasEqualSource(a, b);
testFlag(b, isIgnoreCase);
testFlag(b, isGlobal);
testFlag(b, isMultiline);
testFlag(b, isDotAll);
testFlag(b, isUnicode);
testFlag(b, isSticky);
}
function noFlags(a) {
const b = clone(a);
hasEqualSource(a, b);
assert.ok(!b.ignoreCase);
assert.ok(!b.global);
assert.ok(!b.multiline);
assert.ok(!b.dotAll);
assert.ok(!b.unicode);
assert.ok(!b.sticky);
}
describe('literals', function(){
it('insensitive flag', function(done){
var a = /hello/i;
insensitiveFlag(a);
it('ignoreCase flag', function(done){
const a = /hello/i;
testFlag(a, isIgnoreCase);
done();
})
it('global flag', function(done){
var a = /hello/g;
globalFlag(a);
const a = /hello/g;
testFlag(a, isGlobal);
done();
})
it('multiline flag', function(done){
var a = /hello/m;
multilineFlag(a);
const a = /hello/m;
testFlag(a, isMultiline);
done();
})
it('dotAll flag', function(done){
const a = /hello/s;
testFlag(a, isDotAll);
done();
})
it('unicode flag', function(done){
const a = /hello/u;
testFlag(a, isUnicode);
done();
})
it('sticky flag', function(done){
const a = /hello/y;
testFlag(a, isSticky);
done();
})
it('no flags', function(done){
var a = /hello/;
var b = clone(a);
hasEqualSource(a, b);
assert.ok(!a.insensitive);
assert.ok(!a.global);
assert.ok(!a.global);
const a = /hello/;
noFlags(a);
done();
})
it('all flags', function(done){
var a = /hello/gim;
insensitiveFlag(a);
globalFlag(a);
multilineFlag(a);
const a = /hello/gimsuy;
allFlags(a);
done();
})
it('lastIndex', function(done) {
const a = /hi/g;
lastIndex(a);
done();
})
})
describe('instances', function(){
it('insensitive flag', function(done){
var a = new RegExp('hello', 'i');
insensitiveFlag(a);
it('ignoreCase flag', function(done){
const a = new RegExp('hello', 'i');
testFlag(a, isIgnoreCase);
done();
})
it('global flag', function(done){
var a = new RegExp('hello', 'g');
globalFlag(a);
const a = new RegExp('hello', 'g');
testFlag(a, isGlobal);
done();
})
it('multiline flag', function(done){
var a = new RegExp('hello', 'm');
multilineFlag(a);
const a = new RegExp('hello', 'm');
testFlag(a, isMultiline);
done();
})
it('dotAll flag', function(done){
const a = new RegExp('hello', 's');
testFlag(a, isDotAll);
done();
})
it('unicode flag', function(done){
const a = new RegExp('hello', 'u');
testFlag(a, isUnicode);
done();
})
it('sticky flag', function(done){
const a = new RegExp('hello', 'y');
testFlag(a, isSticky);
done();
})
it('no flags', function(done){
var a = new RegExp('hmm');
var b = clone(a);
hasEqualSource(a, b);
assert.ok(!a.insensitive);
assert.ok(!a.global);
assert.ok(!a.global);
const a = new RegExp('hmm');
noFlags(a);
done();
})
it('all flags', function(done){
var a = new RegExp('hello', 'gim');
insensitiveFlag(a);
globalFlag(a);
multilineFlag(a);
const a = new RegExp('hello', 'misguy');
allFlags(a);
done();
})
it('lastIndex', function(done) {
const a = new RegExp('hi', 'g');
lastIndex(a);
done();
})
})