initial commit
This commit is contained in:
12
node_modules/hsl-regex/.editorconfig
generated
vendored
Normal file
12
node_modules/hsl-regex/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
1
node_modules/hsl-regex/.npmignore
generated
vendored
Normal file
1
node_modules/hsl-regex/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
5
node_modules/hsl-regex/.travis.yml
generated
vendored
Normal file
5
node_modules/hsl-regex/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 0.10
|
||||
- 0.11
|
||||
21
node_modules/hsl-regex/LICENSE.md
generated
vendored
Normal file
21
node_modules/hsl-regex/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 John Otander
|
||||
|
||||
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.
|
||||
51
node_modules/hsl-regex/README.md
generated
vendored
Normal file
51
node_modules/hsl-regex/README.md
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# hsl-regex
|
||||
|
||||
[](https://travis-ci.org/regexps/hsl-regex)
|
||||
|
||||
Regex for matching HSL colors.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install --save hsl-regex
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var hslRegex = require('hsl-regex');
|
||||
|
||||
hslRegex({ exact: true }).test('hsl(123, 45%, 67%)'); // => true
|
||||
hslRegex({ exact: true }).test('foo bar'); // => false
|
||||
|
||||
hslRegex({ exact: true }).exec('hsl(1, 1.111%, 1.1111%)');
|
||||
// => [
|
||||
// 'hsl(1, 1.111%, 1.1111%)',
|
||||
// '1',
|
||||
// '1.111%',
|
||||
// '1.1111%',
|
||||
// index: 0,
|
||||
// input: 'hsl(1, 1.111%, 1.1111%)'
|
||||
// ]
|
||||
|
||||
'hsl(123, 45%, 67%) cats and dogs'.match(hslRegex());
|
||||
// = ['hsl(123, 45%, 67%)']
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork it
|
||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. Create new Pull Request
|
||||
|
||||
Crafted with <3 by John Otander ([@4lpine](https://twitter.com/4lpine)).
|
||||
|
||||
***
|
||||
|
||||
> This package was initially generated with [yeoman](http://yeoman.io) and the [p generator](https://github.com/johnotander/generator-p.git).
|
||||
9
node_modules/hsl-regex/index.js
generated
vendored
Normal file
9
node_modules/hsl-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function hslRegex(options) {
|
||||
options = options || {};
|
||||
|
||||
return options.exact ?
|
||||
/^hsl\(\s*(\d+)\s*,\s*(\d*(?:\.\d+)?%)\s*,\s*(\d*(?:\.\d+)?%)\)$/ :
|
||||
/hsl\(\s*(\d+)\s*,\s*(\d*(?:\.\d+)?%)\s*,\s*(\d*(?:\.\d+)?%)\)/ig;
|
||||
}
|
||||
60
node_modules/hsl-regex/package.json
generated
vendored
Normal file
60
node_modules/hsl-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"_from": "hsl-regex@^1.0.0",
|
||||
"_id": "hsl-regex@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=",
|
||||
"_location": "/hsl-regex",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "hsl-regex@^1.0.0",
|
||||
"name": "hsl-regex",
|
||||
"escapedName": "hsl-regex",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/is-color-stop"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz",
|
||||
"_shasum": "d49330c789ed819e276a4c0d272dffa30b18fe6e",
|
||||
"_spec": "hsl-regex@^1.0.0",
|
||||
"_where": "D:\\Air66 Files\\dev_sites\\www.airurl.dev.cc\\user\\plugins\\air66Theme\\node_modules\\is-color-stop",
|
||||
"author": {
|
||||
"name": "John Otander"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/regexps/hsl-regex/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Regex for matching HSL colors.",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "https://github.com/regexps/hsl-regex",
|
||||
"keywords": [
|
||||
"hsl",
|
||||
"regex",
|
||||
"regexp",
|
||||
"color",
|
||||
"css"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "hsl-regex",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/regexps/hsl-regex.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha test"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
52
node_modules/hsl-regex/test/test.js
generated
vendored
Normal file
52
node_modules/hsl-regex/test/test.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
var assert = require('assert');
|
||||
var hslRegex = require('..');
|
||||
|
||||
var hslStrings = [
|
||||
'hsl(111, 12.343%, 0.9%)',
|
||||
'hsl(123, 45%, 67%)',
|
||||
'hsl(1, 1.111%, 1.1111%)',
|
||||
'hsl(1, .111%, .1111%)'
|
||||
];
|
||||
|
||||
var inexactHslStrings = [
|
||||
'hsl(,,,)',
|
||||
'hsl(12,,)',
|
||||
'hsl(1, 1.111%, 1.1111%) ',
|
||||
' hSl(1, 1.111%, 1.1111%)',
|
||||
'hsla(1, .111%, .1111%, .9)'
|
||||
];
|
||||
|
||||
describe('hsl-regex', function() {
|
||||
|
||||
describe('exact: true', function() {
|
||||
|
||||
it('should return a regex that matches exact hsl strings', function() {
|
||||
hslStrings.forEach(function(hsl) {
|
||||
assert.ok(hslRegex({ exact: true }).test(hsl));
|
||||
});
|
||||
});
|
||||
|
||||
it('should return a regex that does not match invalid hsl strings', function() {
|
||||
inexactHslStrings.forEach(function(invalidHsl) {
|
||||
assert.ok(!hslRegex({ exact: true }).test(invalidHsl));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('g', function() {
|
||||
|
||||
it('should match hsl strings', function() {
|
||||
assert.deepEqual(
|
||||
hslStrings.join('foobar').match(hslRegex()),
|
||||
hslStrings
|
||||
)
|
||||
});
|
||||
|
||||
it('should not match non hsl strings', function() {
|
||||
assert.deepEqual(
|
||||
inexactHslStrings.join('foobar').match(hslRegex()),
|
||||
['hsl(1, 1.111%, 1.1111%)', 'hSl(1, 1.111%, 1.1111%)']
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user