* Improve ESLint setup - Uses `eslint:recommended` + a handful more rules. - Uses .eslintignore so that editors can understand which files to lint. - Uses .eslintrc<strong>.js</strong> so more editors get syntax highlighting. * Fix ESLint errors About half of them were fixed by `eslint . --fix`.
17 lines
252 B
JavaScript
17 lines
252 B
JavaScript
"use strict";
|
|
|
|
const RAW = Symbol.for("raw");
|
|
|
|
module.exports = {
|
|
print(val) {
|
|
return val[RAW];
|
|
},
|
|
test(val) {
|
|
return (
|
|
val &&
|
|
Object.prototype.hasOwnProperty.call(val, RAW) &&
|
|
typeof val[RAW] === "string"
|
|
);
|
|
}
|
|
};
|