11"use strict" ;
2-
3- const { cloneDeep } = require ( "lodash" ) ;
4- const util = require ( "util" ) ;
2+ var util = require ( "./util" ) ;
53
64/**
75 * Helper object to format and aggragate lines of code.
@@ -12,7 +10,7 @@ const util = require("util");
1210 * @param {string } indentation Desired indentation character for aggregated lines of code
1311 * @param {string } join Desired character to join each line of code
1412 */
15- const CodeBuilder = function ( indentation , join ) {
13+ var CodeBuilder = function ( indentation , join ) {
1614 this . code = [ ] ;
1715 this . indentation = indentation ;
1816 this . lineJoin = join || "\n" ;
@@ -38,8 +36,8 @@ const CodeBuilder = function (indentation, join) {
3836 * // returns: 'console.log("\t\thello world")'
3937 */
4038CodeBuilder . prototype . buildLine = function ( indentationLevel , line ) {
41- let lineIndentation = "" ;
42- let slice = 2 ;
39+ var lineIndentation = "" ;
40+ var slice = 2 ;
4341 if ( Object . prototype . toString . call ( indentationLevel ) === "[object String]" ) {
4442 slice = 1 ;
4543 line = indentationLevel ;
@@ -53,9 +51,8 @@ CodeBuilder.prototype.buildLine = function (indentationLevel, line) {
5351 indentationLevel -- ;
5452 }
5553
56- const format = Array . prototype . slice . call ( arguments , slice , arguments . length ) ;
54+ var format = Array . prototype . slice . call ( arguments , slice , arguments . length ) ;
5755 format . unshift ( lineIndentation + line ) ;
58-
5956 return util . format . apply ( this , format ) ;
6057} ;
6158
@@ -101,12 +98,4 @@ CodeBuilder.prototype.join = function () {
10198 return this . code . join ( this . lineJoin ) ;
10299} ;
103100
104- CodeBuilder . prototype . clone = function ( ) {
105- return cloneDeep ( this ) ;
106- } ;
107-
108- CodeBuilder . prototype . getLength = function ( ) {
109- return this . code . length ;
110- } ;
111-
112101module . exports = CodeBuilder ;
0 commit comments