Browse Source

Fixing some issues CI linting found.

gh-pages
mike12345567 6 years ago
parent
commit
b42677f657
  1. 2
      packages/string-templates/rollup.config.js
  2. 3
      packages/string-templates/src/helpers/external.js
  3. 3
      packages/string-templates/src/processors/postprocessor.js
  4. 3
      packages/string-templates/src/processors/preprocessor.js
  5. 4
      packages/string-templates/src/utilities.js

2
packages/string-templates/rollup.config.js

@ -4,8 +4,6 @@ import builtins from "rollup-plugin-node-builtins"
import globals from "rollup-plugin-node-globals"
import json from "@rollup/plugin-json"
const production = !process.env.ROLLUP_WATCH
export default {
input: "src/index.js",
output: [

3
packages/string-templates/src/helpers/external.js

@ -24,7 +24,8 @@ exports.registerAll = handlebars => {
for (let collection of EXTERNAL_FUNCTION_COLLECTIONS) {
// collect information about helper
let hbsHelperInfo = helpers[collection]()
for (let [name, func] of Object.entries(hbsHelperInfo)) {
for (let entry of Object.entries(hbsHelperInfo)) {
const name = entry[0]
// skip built in functions and ones seen already
if (
HelperFunctionBuiltin.indexOf(name) !== -1 ||

3
packages/string-templates/src/processors/postprocessor.js

@ -1,5 +1,4 @@
const { FIND_HBS_REGEX } = require("../utilities")
/* eslint-disable no-unused-vars */
class Postprocessor {
constructor(name, fn) {
this.name = name

3
packages/string-templates/src/processors/preprocessor.js

@ -1,5 +1,5 @@
const { HelperNames } = require("../helpers")
const { swapStrings, isAlphaNumeric, FIND_HBS_REGEX } = require("../utilities")
const { swapStrings, isAlphaNumeric } = require("../utilities")
const PreprocessorNames = {
SWAP_TO_DOT: "swap-to-dot-notation",
@ -7,6 +7,7 @@ const PreprocessorNames = {
FINALISE: "finalise",
}
/* eslint-disable no-unused-vars */
class Preprocessor {
constructor(name, fn) {
this.name = name

4
packages/string-templates/src/utilities.js

@ -14,12 +14,10 @@ module.exports.swapStrings = (string, start, length, swap) => {
module.exports.removeNull = obj => {
return Object.fromEntries(
Object.entries(obj)
.filter(([key, value]) => value != null)
.filter(entry => entry[1] != null)
.map(([key, value]) => [
key,
value === Object(value) ? module.exports.removeNull(value) : value,
])
)
}
module.exports.findHbsStatements = string => {}

Loading…
Cancel
Save