first commit
This commit is contained in:
20
build/node_modules/is-svg/index.js
generated
vendored
Normal file
20
build/node_modules/is-svg/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
var htmlCommentRegex = require('html-comment-regex');
|
||||
|
||||
function isBinary(buf) {
|
||||
var isBuf = Buffer.isBuffer(buf);
|
||||
|
||||
for (var i = 0; i < 24; i++) {
|
||||
var charCode = isBuf ? buf[i] : buf.charCodeAt(i);
|
||||
|
||||
if (charCode === 65533 || charCode <= 8) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = function (buf) {
|
||||
return !isBinary(buf) && /^\s*(?:<\?xml[^>]*>\s*)?(?:<!doctype svg[^>]*\s*(?:<![^>]*>)*[^>]*>\s*)?<svg[^>]*>[^]*<\/svg>\s*$/i.test(buf.toString().replace(htmlCommentRegex, ''));
|
||||
};
|
||||
21
build/node_modules/is-svg/license
generated
vendored
Normal file
21
build/node_modules/is-svg/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.
|
||||
79
build/node_modules/is-svg/package.json
generated
vendored
Normal file
79
build/node_modules/is-svg/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"is-svg@2.1.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "is-svg@2.1.0",
|
||||
"_id": "is-svg@2.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=",
|
||||
"_location": "/is-svg",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "is-svg@2.1.0",
|
||||
"name": "is-svg",
|
||||
"escapedName": "is-svg",
|
||||
"rawSpec": "2.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-svgo"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-svg/-/is-svg-2.1.0.tgz",
|
||||
"_spec": "2.1.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/is-svg/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"html-comment-regex": "^1.1.0"
|
||||
},
|
||||
"description": "Check if a string or buffer is SVG",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "^0.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/is-svg#readme",
|
||||
"keywords": [
|
||||
"svg",
|
||||
"vector",
|
||||
"graphics",
|
||||
"image",
|
||||
"img",
|
||||
"pic",
|
||||
"picture",
|
||||
"type",
|
||||
"detect",
|
||||
"check",
|
||||
"is",
|
||||
"string",
|
||||
"str",
|
||||
"buffer"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "is-svg",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/is-svg.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
}
|
||||
34
build/node_modules/is-svg/readme.md
generated
vendored
Normal file
34
build/node_modules/is-svg/readme.md
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# is-svg [](https://travis-ci.org/sindresorhus/is-svg)
|
||||
|
||||
> Check if a string or buffer is [SVG](http://en.wikipedia.org/wiki/Scalable_Vector_Graphics)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save is-svg
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const isSvg = require('is-svg');
|
||||
|
||||
isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>');
|
||||
//=> true
|
||||
```
|
||||
|
||||
|
||||
## Edge cases
|
||||
|
||||
This module performs a quick-and-dirty check. It's fast, but in certain cases it will give incorrect results.
|
||||
|
||||
- Returns `true` for an SVG-like string that isn't well-formed or valid: `<svg><div></svg>`
|
||||
|
||||
If you want to make certain that your SVG is *valid*, try parsing it with [libxmljs](https://github.com/polotek/libxmljs).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user