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(deps): update dependency sanctuary to ^0.15.0 #1555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"redux-query-react": "^3.3.1",
"reselect": "^4.0.0",
"rmwc": "^5.7.1",
"sanctuary": "^0.13.2",
"sanctuary": "^0.15.0",
"sass": "1.32.13",
"sass-lint": "^1.13.1",
"sass-loader": "10",
Expand Down
22 changes: 10 additions & 12 deletions static/js/lib/sanctuary.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const allJust = R.curry((items: S.Maybe[]) =>
/*
* converts a Maybe<String> to a string
*/
export const mstr = S.maybe("", String);
export const mstr = S.maybe("")(String);

/*
* returns Nothing if the input is undefined|null,
Expand Down Expand Up @@ -49,26 +49,24 @@ export const getm = R.curry((prop, obj) => S.toMaybe(R.prop(prop, obj)));
// A Right value indicates the JSON parsed successfully,
// a Left value indicates the JSON was malformed (a Left contains
// an empty object)
export const parseJSON = S.encaseEither(() => ({}), JSON.parse);
export const parseJSON = S.encaseEither(() => ({}))(JSON.parse);

// filterE :: (Either -> Boolean) -> Either -> Either
// filterE takes a function f and an either E(v).
// if the Either is a Left, it returns it.
// if the f(v) === true, it returns, E. Else,
// if returns Left(v).
export const filterE = R.curry((predicate, either) =>
S.either(
S.Left,
(right) => (predicate(right) ? S.Right(right) : S.Left(right)),
either,
),
);
export const filterE = R.curry((predicate, either) => {
return S.either(S.Left)((right) =>
predicate(right) ? S.Right(right) : S.Left(right),
)(either);
});

// reduceM :: forall a b. b -> (a -> b) -> Maybe a -> b
// this is how I think Sanctuary's `reduce` should handle a maybe
// pass a default value, a function, and a maybe
// if Nothing, return the function called with the default value
// if Just, return the function called with the value in the Just
export const reduceM = R.curry((def, fn, maybe) =>
S.maybe_(() => fn(def), fn, maybe),
);
export const reduceM = R.curry((def, fn, maybe) => {
return S.maybe_(() => fn(def))(fn)(maybe);
});
69 changes: 52 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9736,18 +9736,49 @@ safe-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

sanctuary-def@0.12.1:
version "0.12.1"
resolved "https://registry.yarnpkg.com/sanctuary-def/-/sanctuary-def-0.12.1.tgz#bb9b2ad9407b1519d1ee61fd293b24e86a2044b3"
integrity sha512-u0M9N790dRIGdys0zRCYQZ+LeJcuW/ED6zPw/pRaMvzGehPoAHUmxJnMxE/MclMTJuHnSKkO0mlF7ThW9bDtkg==
dependencies:
sanctuary-type-classes "6.0.x"
sanctuary-def@0.18.1:
version "0.18.1"
resolved "https://registry.yarnpkg.com/sanctuary-def/-/sanctuary-def-0.18.1.tgz#580af82a3fbbd651e8dddc0ab34b11727ef63b5f"
integrity sha512-Ltu/gU5ZskRln8NI6YJru5JbpkcMe4XqFx5zJMZysTKPmOVkETys5eVvZmclNLzPNrOIPvqBGJtD/D2q9yvP/A==
dependencies:
sanctuary-either "1.0.x"
sanctuary-show "1.0.x"
sanctuary-type-classes "9.0.x"
sanctuary-type-identifiers "2.0.x"

sanctuary-type-classes@6.0.0, sanctuary-type-classes@6.0.x:
version "6.0.0"
resolved "https://registry.yarnpkg.com/sanctuary-type-classes/-/sanctuary-type-classes-6.0.0.tgz#1db3f8c1247de018471e978fe4956a03eb62f464"
integrity sha512-RNnvWOY+ODai3AjZWEvYLRRCAvKCS9Szy/vYp3lSnhB/Tbi6os8LFtHbiSegieo3dH8o81/WhkqzZiJO2OS8AQ==
sanctuary-either@1.0.0, sanctuary-either@1.0.x:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sanctuary-either/-/sanctuary-either-1.0.0.tgz#b6041e54c639700048be757ba4d6c026c2c2f67c"
integrity sha512-j4WAlwILU83wawXJQCSh5kVK27gxOykMuCfUfUOba/qUcFE+FxwHkt7lnHVYDjt7jG9SENe8bTQzPH/Zmhy3Ag==
dependencies:
sanctuary-show "1.0.x"
sanctuary-type-classes "9.0.0"

sanctuary-maybe@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sanctuary-maybe/-/sanctuary-maybe-1.0.0.tgz#03cd226d933ec89270e4495a965733390e843afc"
integrity sha512-4TUjIxznxTZ1dh8Zw4PRhaVkzY8KIZ4GGsOXBytOSV83MRRGkuz7wJHj3bfh2i9lOekbjf0Oal6v7IF6uDiYvg==
dependencies:
sanctuary-show "1.0.x"
sanctuary-type-classes "9.0.0"

sanctuary-pair@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sanctuary-pair/-/sanctuary-pair-1.0.0.tgz#eaf8121f0ba3064e5e0b09bb624bc3885209886a"
integrity sha512-fqXCO6boMLW7ZHrjc573u5maNdytIrNxeaotBBGrvbEVqiNeA6VH4eGARMLTCRdgOtW94aF5EUkBZCzvXLSujQ==
dependencies:
sanctuary-show "1.0.x"
sanctuary-type-classes "9.0.0"

sanctuary-show@1.0.0, sanctuary-show@1.0.x:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sanctuary-show/-/sanctuary-show-1.0.0.tgz#72deb4812f9decec850e03286807dca1c97a1d61"
integrity sha512-63UqNGr5M6wkzKp6eGc/Gy6JBIV2PbzPd3q88+0F9z0qydAQsCWJ+7e4oor39rEEwj2GkZMDEhqGuiMl9eEnYw==

sanctuary-type-classes@9.0.0, sanctuary-type-classes@9.0.x:
version "9.0.0"
resolved "https://registry.yarnpkg.com/sanctuary-type-classes/-/sanctuary-type-classes-9.0.0.tgz#b44741ca67fa650cbd314e1ad318d730ce1309a4"
integrity sha512-rFW27f3D622kxKravpGU9OjWn66fnDjDjGPvoYo4hEoBg2ocypvp0R9cs0YovKL3jTO+PTceUBh5tYZ+l9ay3g==
dependencies:
sanctuary-type-identifiers "1.0.x"

Expand All @@ -9761,13 +9792,17 @@ sanctuary-type-identifiers@2.0.1, sanctuary-type-identifiers@2.0.x:
resolved "https://registry.yarnpkg.com/sanctuary-type-identifiers/-/sanctuary-type-identifiers-2.0.1.tgz#fc524cf6dd92cebfcbb0dd9509eff193159a20ed"
integrity sha512-1u8HupVZIup/7x3lgNawWvTUH9ya2rrf4HMfbaoP1xPwYujZsKJ0OlcD1HnE8acsUjRk1QMPX4flLZ6qewqjyA==

sanctuary@^0.13.2:
version "0.13.2"
resolved "https://registry.yarnpkg.com/sanctuary/-/sanctuary-0.13.2.tgz#ed1c9c2f2b1745d659ee3457954c8b1154f8d4a8"
integrity sha512-qRyvZ25ANG2kIO7blYe/ImjaL0bp/Jy03HrzSwf6k3nh5TaeCXYvPk/HwEYU8lS2yVjp0Bds+uOsAx+1FsvVDA==
dependencies:
sanctuary-def "0.12.1"
sanctuary-type-classes "6.0.0"
sanctuary@^0.15.0:
version "0.15.1"
resolved "https://registry.yarnpkg.com/sanctuary/-/sanctuary-0.15.1.tgz#c5f0efdc28f8698af63615ae02b052fa902def22"
integrity sha512-guMq+RqXcABprELHRJJF0iHaqb1ErUkbyYN5KviAeQ2OM3WvaDz1GoKWQyj+lHUrprbMXCiJjrk3QVfiSeAERg==
dependencies:
sanctuary-def "0.18.1"
sanctuary-either "1.0.0"
sanctuary-maybe "1.0.0"
sanctuary-pair "1.0.0"
sanctuary-show "1.0.0"
sanctuary-type-classes "9.0.0"
sanctuary-type-identifiers "2.0.1"

sass-lint@^1.13.1:
Expand Down
Loading