save code
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 150
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"func-name-matching": [2, "always"],
|
||||
"id-length": 1,
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"func-name-matching": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Jordan Harband
|
||||
|
||||
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.
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
var functionsHaveNames = function functionsHaveNames() {
|
||||
return typeof function f() {}.name === 'string';
|
||||
};
|
||||
|
||||
var gOPD = Object.getOwnPropertyDescriptor;
|
||||
if (gOPD) {
|
||||
try {
|
||||
gOPD([], 'length');
|
||||
} catch (e) {
|
||||
// IE 8 has a broken gOPD
|
||||
gOPD = null;
|
||||
}
|
||||
}
|
||||
|
||||
functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {
|
||||
if (!functionsHaveNames() || !gOPD) {
|
||||
return false;
|
||||
}
|
||||
var desc = gOPD(function () {}, 'name');
|
||||
return !!desc && !!desc.configurable;
|
||||
};
|
||||
|
||||
var $bind = Function.prototype.bind;
|
||||
|
||||
functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {
|
||||
return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';
|
||||
};
|
||||
|
||||
module.exports = functionsHaveNames;
|
||||
Reference in New Issue
Block a user