Skip to content

Commit

Permalink
feat: add package.json parser #20
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed Apr 23, 2020
1 parent f4c70a5 commit 44e6bbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/utils/predicateBuilder/stringSplitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const commaSplitter = (str: string): string[] => {
});
};

const quouteStip = () => {
const quoteStrip = (): ((str: string, quote: string) => string) => {
let stripped = false;
return (str: string, quote: string): string => {
if (!stripped && str.startsWith(quote) && str.endsWith(quote)) {
Expand All @@ -48,7 +48,7 @@ const quouteStip = () => {
};

const trimmer = (str: string): string => {
return quotes.reduce(quouteStip(), str);
return quotes.reduce(quoteStrip(), str);
};

export const split = (str: string | undefined): (string | RegExp)[] => {
Expand Down
1 change: 0 additions & 1 deletion test/src/utils/predicateBuilder/stringSplitter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ describe(`string splitter`, () => {
it(`should handle regex flags 2`, () => {
expect(split(`/a/i`)).toEqual([/a/i]);
});

});
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6091,9 +6091,9 @@ [email protected]:
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=

[email protected], resolve@^1.10.0, resolve@^1.15.1, resolve@^1.3.2:
version "1.16.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.16.1.tgz#49fac5d8bacf1fd53f200fa51247ae736175832c"
integrity sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig==
version "1.17.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
dependencies:
path-parse "^1.0.6"

Expand Down

0 comments on commit 44e6bbe

Please sign in to comment.