Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #220: npm audit returns 23 vulnerabilities (11 low, 8 high, 4 critical) #221

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

chezearth
Copy link

@chezearth chezearth commented Oct 9, 2018

You can see what I've done here from the commit history. I advanced the version patch just for my own reference -- not sure these changes warrant it. The updated packages only seemed to break the gulpfile (as Gulp itself jumped big) and the tests (as Mocha jumped too). On my Mac Growl throws an error if the notifier isn't installed, which causes Mocha to do the same. I tried but couldn't find a way to test for the notifier before deciding whether to include growl: 1 in the argument for the mocha() method. Tests ran fine -- I will try and work on some new ones when I get some bandwidth.

$ npm test

> @chezearth/[email protected] test /Users/charles/Code/npm-packages/string.js
> gulp test

[11:59:33] Using gulpfile ~/Code/npm-packages/string.js/gulpfile.js
[11:59:33] Starting 'test'...
[11:59:33] Starting 'bro'...
[11:59:33] Finished 'bro' after 235 ms
[11:59:33] Starting '<anonymous>'...


  string.js
    ✓ should import native JavaScript string methods
    - constructor
      ✓ should set the internal "s" property
    - between(left, right)
      ✓ should extract string between `left` and `right`
    - camelize()
      ✓ should remove any underscores or dashes and convert a string into camel casing
    - capitalize()
      ✓ should capitalize the string
    - charAt(index)
      ✓ should return a native JavaScript string with the character at the specified position
    - chompLeft(prefix)
      ✓ should remove `prefix` from start of string
    - chompRight(suffix)
      ✓ should remove `suffix` from end of string
    - collapseWhitespace()
      ✓ should convert all adjacent whitespace characters to a single space and trim the ends
    - contains(substring)
      ✓ should return true if the string contains the specified input string
    - count(substring)
      ✓ should return the count of all substrings
    - equalsIgnoreCase()
      ✓ should be equal
      ✓ should not be equal
    - dasherize()
      ✓ should convert a camel cased string into a string delimited by dashes
    - decodeHTMLEntities()
      ✓ should decode HTML entities into their proper string representation
    - endsWith(suffixe1[, suffix2, ..])
      ✓ should return true if the string ends with the input string
    - ensureLeft(prefix)
      ✓ should prepend `prefix` if string does not start with prefix
    - ensureRight(suffix)
      ✓ should append `suffix` if string does not end with suffix
    - escapeHTML()
      ✓ should escape the html
    + extendPrototype()
      ✓ should extend the String prototype with the extra methods
    - humanize()
      ✓ should humanize the string
    - include(substring)
      ✓ should return true if the string contains the specified input string
    - isAlpha()
      ✓ should return true if the string contains only letters
    - isAlphaNumeric()
      ✓ should return true if the string contains only letters and digits
    - isEmpty()
      ✓ should return true if the string is solely composed of whitespace or is null
    - isLower()
      ✓ should return true if the character or string is lowercase
    - isNumeric()
      ✓ should return true if the string only contains digits, this would not include Infinity or -Infinity
    - isUpper()
      ✓ should return true if the character or string is uppercase
    - latinise
      ✓ should remove diacritics from Latin characters
    - length
      ✓ should return the length of the string
    - left(N)
      ✓ should return the substring denoted by N positive left-most characters
      ✓ should return the substring denoted by N negative left-most characters, equivalent to calling right(-N)
    - pad(len, [char])
      ✓ should pad the string in the center with specified character
      ✓ should work on numbers
      ✓ should use the default padding character when given null
    - padLeft(len, [char])
      ✓ should left pad the string
      ✓ should work on numbers
      ✓ should use the default padding character when given null
    - padRight(len, [char])
      ✓ should right pad the string
      ✓ should work on numbers
      ✓ should use the default padding character when given null
    - parseCSV([delim],[qualifier],[escape],[lineDelimiter])
      ✓ should parse a CSV line into an array
    - repeat(n)
      ✓ should return the string concatenated with itself n times
    - replaceAll(substring, replacement)
      ✓ should return the new string with all occurrences of substring replaced with the replacment string
    - splitLeft(sep, [maxSplit, [limit]])
      ✓ should return an array of strings, split from the left at sep, at most maxSplit splits, at most limit elements
    - splitRight(sep, [maxSplit, [limit]])
      ✓ should return an array of strings, split from the right at sep, at most maxSplit splits, at most limit elements
    - strip([string1],[string2],...)
      ✓ should return the new string with all occurrences of [string1],[string2],... removed
    - stripLeft(chars)
      ✓ should return the new string with all occurences of `chars` removed from left
    - stripRight(chars)
      ✓ should return the new string with all occurences of `chars` removed from right
    + restorePrototype()
      ✓ should restore the original String prototype
    - right(N)
      ✓ should return the substring denoted by N positive right-most characters
      ✓ should return the substring denoted by N negative right-most characters, equivalent to calling left(-N)
    - s
      ✓ should return the native string
    - slugify
      ✓ should convert the text to url slug
    - startsWith(prefix1 [, prefix2, ...])
      ✓ should return true if the string starts with the input string
    - stripPunctuation()
      ✓ should strip all of the punctuation
    - stripTags([tag1],[tag2],...)
      ✓ should strip all of the html tags or tags specified by the parameters
    - template(values, [open], [close])
      ✓ should return the string replaced with template values
      ✓ should return the string replaces with template values with regex chars () as Open/Close
      ✓ should return the string replaces with template values with regex chars [] as Open/Close
      ✓ should return the string replaces with template values with regex chars ** as Open/Close
      ✓ should return the string replaces with template values with regex chars ** as Open/Close
      > when a key has an empty value
        ✓ should still replace with the empty value
      > when a key does not exist
        ✓ should still replace with the empty value
    - times(n)
      ✓ should return the string concatenated with itself n times
    - titleCase()
      ✓ should upperCase all words in a camel cased string
      ✓ should upperCase all words in a string with spaces, underscores, or dashes
      ✓ can be combined with humanize to create nice titles out of ugly developer strings
      ✓ does not fail on edge cases
    - toFloat([precision])
      ✓ should return the float value, wraps parseFloat
    - toBoolean
      ✓ should convert a logical truth string to boolean
    - toCSV(options)
      ✓ should convert the array to csv
    - toInt()
      ✓ should return the integer value, wraps parseInt
    - toString()
      ✓ should return the native string
    - trim()
      ✓ should return the string with leading and trailing whitespace removed
    - trimLeft()
      ✓ should return the string with leading whitespace removed
    - trimRight()
      ✓ should return the string with trailing whitespace removed
    - truncate(length, [chars])
      ✓ should truncate the string, accounting for word placement and chars count
    - underscore()
      ✓ should convert a camel cased string into a string separated by underscores
    - unescapeHTML
      ✓ should unescape the HTML
    - valueOf()
      ✓ should return the primitive value of the string, wraps native valueOf()
    - wrapHTML()
      ✓ should return the string with wrapped HTML Element and their attributes
    + VERSION
      ✓ should exist


  83 passing (105ms)

[11:59:34] Finished '<anonymous>' after 570 ms
[11:59:34] Finished 'test' after 809 ms

@az7arul
Copy link
Collaborator

az7arul commented Dec 7, 2018

Thanks for the PR @chezearth. I will have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants