diff --git a/.yarn/cache/@esbuild-darwin-arm64-npm-0.21.5-62349c1520-10.zip b/.yarn/cache/@esbuild-darwin-arm64-npm-0.21.5-62349c1520-10.zip new file mode 100644 index 00000000000..cf67cd850e8 Binary files /dev/null and b/.yarn/cache/@esbuild-darwin-arm64-npm-0.21.5-62349c1520-10.zip differ diff --git a/.yarn/cache/@esbuild-linux-x64-npm-0.21.5-88079726c4-10.zip b/.yarn/cache/@esbuild-linux-x64-npm-0.21.5-88079726c4-10.zip deleted file mode 100644 index 2a3a835a4e3..00000000000 Binary files a/.yarn/cache/@esbuild-linux-x64-npm-0.21.5-88079726c4-10.zip and /dev/null differ diff --git a/.yarn/cache/@next-swc-linux-x64-gnu-npm-14.2.10-c8787ddfc6-10.zip b/.yarn/cache/@next-swc-darwin-arm64-npm-14.2.10-ee14b48ab4-10.zip similarity index 71% rename from .yarn/cache/@next-swc-linux-x64-gnu-npm-14.2.10-c8787ddfc6-10.zip rename to .yarn/cache/@next-swc-darwin-arm64-npm-14.2.10-ee14b48ab4-10.zip index d606f24cbe2..6a01873282a 100644 Binary files a/.yarn/cache/@next-swc-linux-x64-gnu-npm-14.2.10-c8787ddfc6-10.zip and b/.yarn/cache/@next-swc-darwin-arm64-npm-14.2.10-ee14b48ab4-10.zip differ diff --git a/.yarn/cache/fsevents-patch-6b67494872-10.zip b/.yarn/cache/fsevents-patch-6b67494872-10.zip new file mode 100644 index 00000000000..9887ada72d9 Binary files /dev/null and b/.yarn/cache/fsevents-patch-6b67494872-10.zip differ diff --git a/.yarn/cache/rambda-npm-9.3.0-c54ccccbeb-e4e17aa2de.zip b/.yarn/cache/rambda-npm-9.3.0-c54ccccbeb-e4e17aa2de.zip new file mode 100644 index 00000000000..69b249f933a Binary files /dev/null and b/.yarn/cache/rambda-npm-9.3.0-c54ccccbeb-e4e17aa2de.zip differ diff --git a/package.json b/package.json index 4b98ac9ea04..62546b6979a 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "morgan": "1.10.0", "path-to-regexp": "6.3.0", "polyfill-crypto.getrandomvalues": "1.0.0", + "rambda": "^9.3.0", "ramda": "0.30.1", "react": "18.3.1", "react-dom": "18.3.1", diff --git a/src/app/components/Ad/Amp/index.tsx b/src/app/components/Ad/Amp/index.tsx index 9f2def66fe9..796398738ff 100644 --- a/src/app/components/Ad/Amp/index.tsx +++ b/src/app/components/Ad/Amp/index.tsx @@ -3,7 +3,7 @@ import { jsx } from '@emotion/react'; import React, { useContext } from 'react'; import { Helmet } from 'react-helmet'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { RequestContext } from '#contexts/RequestContext'; import { AMP_ACCESS_JS, diff --git a/src/app/components/Ad/Canonical/index.tsx b/src/app/components/Ad/Canonical/index.tsx index aeb057feb87..f6b2df78f02 100644 --- a/src/app/components/Ad/Canonical/index.tsx +++ b/src/app/components/Ad/Canonical/index.tsx @@ -3,7 +3,7 @@ import { jsx } from '@emotion/react'; import React, { useEffect, useContext } from 'react'; import { Helmet } from 'react-helmet'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import useLocation from '#hooks/useLocation'; import isLive from '../../../lib/utilities/isLive'; import useOperaMiniDetection from '../../../hooks/useOperaMiniDetection'; diff --git a/src/app/components/Byline/index.tsx b/src/app/components/Byline/index.tsx index fa23614d08a..8a47ed4c050 100644 --- a/src/app/components/Byline/index.tsx +++ b/src/app/components/Byline/index.tsx @@ -2,7 +2,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import React, { useContext, PropsWithChildren } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { OptimoBylineBlock } from '#app/models/types/optimo'; import { ServiceContext } from '../../contexts/ServiceContext'; import VisuallyHiddenText from '../VisuallyHiddenText'; diff --git a/src/app/components/Byline/utilities/bylineExtractor/index.tsx b/src/app/components/Byline/utilities/bylineExtractor/index.tsx index 989b0ccae71..7b8808cab40 100644 --- a/src/app/components/Byline/utilities/bylineExtractor/index.tsx +++ b/src/app/components/Byline/utilities/bylineExtractor/index.tsx @@ -2,7 +2,7 @@ import { OptimoBylineContributorBlock, OptimoBylineContributorMetadataBlock, } from '#app/models/types/optimo'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import buildIChefURL from '../../../../lib/utilities/ichefURL'; const pathOrZeroIndexModelBlocks = ( diff --git a/src/app/components/Byline/utilities/categoryName/index.test.ts b/src/app/components/Byline/utilities/categoryName/index.test.ts index 21ccc0b2054..305e7095f4e 100644 --- a/src/app/components/Byline/utilities/categoryName/index.test.ts +++ b/src/app/components/Byline/utilities/categoryName/index.test.ts @@ -1,4 +1,4 @@ -import clone from 'ramda/src/clone'; +import { clone } from 'rambda'; import categoryName from '.'; import { passportTaggings, diff --git a/src/app/components/Byline/utilities/categoryName/index.ts b/src/app/components/Byline/utilities/categoryName/index.ts index c5ffa78f933..b7c890fdf45 100644 --- a/src/app/components/Byline/utilities/categoryName/index.ts +++ b/src/app/components/Byline/utilities/categoryName/index.ts @@ -1,5 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; -import isEmpty from 'ramda/src/isEmpty'; +import { pathOr, isEmpty } from 'rambda'; import { MetadataFormats, MetadataTaggings, diff --git a/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.js b/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.js index 7aaa6d33abe..c1b112c1bf1 100644 --- a/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.js +++ b/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.js @@ -1,5 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; -import isEmpty from 'ramda/src/isEmpty'; +import { pathOr, isEmpty } from 'rambda'; const getAuthorTwitterHandle = articleContentBlocks => { const [firstByline, ...otherBylines] = articleContentBlocks.filter( diff --git a/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.test.js b/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.test.js index ca8277531c6..eadf3bc78ed 100644 --- a/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.test.js +++ b/src/app/components/Byline/utilities/getAuthorTwitterHandle/index.test.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import getAuthorTwitterHandle from '.'; import { contentBlockWithByline, diff --git a/src/app/components/Caption/index.tsx b/src/app/components/Caption/index.tsx index a06177b81d2..8de48a37b9d 100644 --- a/src/app/components/Caption/index.tsx +++ b/src/app/components/Caption/index.tsx @@ -3,7 +3,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { ServiceContext } from '#app/contexts/ServiceContext'; import Blocks from '#app/legacy/containers/Blocks'; import { OptimoBlock } from '#app/models/types/optimo'; diff --git a/src/app/components/ChartbeatAnalytics/utils/index.ts b/src/app/components/ChartbeatAnalytics/utils/index.ts index e8020036253..30ae0c62a54 100644 --- a/src/app/components/ChartbeatAnalytics/utils/index.ts +++ b/src/app/components/ChartbeatAnalytics/utils/index.ts @@ -1,7 +1,5 @@ import Cookie from 'js-cookie'; -import find from 'ramda/src/find'; -import propSatisfies from 'ramda/src/propSatisfies'; -import includes from 'ramda/src/includes'; +import { find, propSatisfies, includes } from 'rambda'; import onClient from '../../../lib/utilities/onClient'; import { getReferrer } from '../../../lib/analyticsUtils'; import { diff --git a/src/app/components/Curation/CurationPromo/index.tsx b/src/app/components/Curation/CurationPromo/index.tsx index 99479edad32..3b40580e9ea 100644 --- a/src/app/components/Curation/CurationPromo/index.tsx +++ b/src/app/components/Curation/CurationPromo/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable jsx-a11y/aria-role */ import React, { useContext } from 'react'; import moment from 'moment'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import formatDuration from '#app/lib/utilities/formatDuration'; import Promo from '#components/Promo'; import { Summary } from '#app/models/types/curationData'; diff --git a/src/app/components/Curation/HierarchicalGrid/index.tsx b/src/app/components/Curation/HierarchicalGrid/index.tsx index 9490de1711b..e16ca9d46a6 100644 --- a/src/app/components/Curation/HierarchicalGrid/index.tsx +++ b/src/app/components/Curation/HierarchicalGrid/index.tsx @@ -3,7 +3,7 @@ import { useContext } from 'react'; import { css, jsx, Theme } from '@emotion/react'; import moment from 'moment'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import VisuallyHiddenText from '../../VisuallyHiddenText'; import formatDuration from '../../../lib/utilities/formatDuration'; import Promo from '../../../legacy/components/Promo'; diff --git a/src/app/components/DecoratedInlineLink/index.tsx b/src/app/components/DecoratedInlineLink/index.tsx index 2e1e6e95a8f..2806ec86f18 100644 --- a/src/app/components/DecoratedInlineLink/index.tsx +++ b/src/app/components/DecoratedInlineLink/index.tsx @@ -2,7 +2,7 @@ import { jsx } from '@emotion/react'; import React, { useContext } from 'react'; import { ServiceContext } from '#app/contexts/ServiceContext'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import Blocks from '#app/legacy/containers/Blocks'; import makeRelativeUrlPath from '#app/lib/utilities/makeRelativeUrlPath'; import { OptimoBlock } from '#app/models/types/optimo'; diff --git a/src/app/components/Disclaimer/index.tsx b/src/app/components/Disclaimer/index.tsx index 1435c0e8abd..6ee5af5da81 100644 --- a/src/app/components/Disclaimer/index.tsx +++ b/src/app/components/Disclaimer/index.tsx @@ -1,7 +1,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import { useContext, PropsWithChildren } from 'react'; -import isEmpty from 'ramda/src/isEmpty'; +import { isEmpty } from 'rambda'; import { GridItemLarge } from '../../legacy/components/Grid'; import { ServiceContext } from '../../contexts/ServiceContext'; import { RequestContext } from '../../contexts/RequestContext'; diff --git a/src/app/components/EmbedConsentBanner/ConsentBanner.tsx b/src/app/components/EmbedConsentBanner/ConsentBanner.tsx index cea86b27296..238295a713f 100644 --- a/src/app/components/EmbedConsentBanner/ConsentBanner.tsx +++ b/src/app/components/EmbedConsentBanner/ConsentBanner.tsx @@ -1,7 +1,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import { useContext, MouseEvent } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { RequestContext } from '#app/contexts/RequestContext'; import { LIVE_PAGE } from '#app/routes/utils/pageTypes'; diff --git a/src/app/components/Embeds/OEmbed/index.tsx b/src/app/components/Embeds/OEmbed/index.tsx index 688bb3401e3..971cde552f0 100644 --- a/src/app/components/Embeds/OEmbed/index.tsx +++ b/src/app/components/Embeds/OEmbed/index.tsx @@ -2,7 +2,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { RequestContext } from '../../../contexts/RequestContext'; import { ServiceContext } from '../../../contexts/ServiceContext'; import EmbedHtml from '../EmbedHtml'; diff --git a/src/app/components/Embeds/UnsupportedEmbed/index.tsx b/src/app/components/Embeds/UnsupportedEmbed/index.tsx index b3f86875f81..93e0151c8c5 100644 --- a/src/app/components/Embeds/UnsupportedEmbed/index.tsx +++ b/src/app/components/Embeds/UnsupportedEmbed/index.tsx @@ -2,7 +2,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { RequestContext } from '../../../contexts/RequestContext'; import { ServiceContext } from '../../../contexts/ServiceContext'; import EmbedError from '../EmbedError'; diff --git a/src/app/components/Embeds/Uploader/index.tsx b/src/app/components/Embeds/Uploader/index.tsx index 19193a3f219..f834f7865d2 100644 --- a/src/app/components/Embeds/Uploader/index.tsx +++ b/src/app/components/Embeds/Uploader/index.tsx @@ -1,7 +1,7 @@ /** @jsx jsx */ import { useContext } from 'react'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import { jsx } from '@emotion/react'; import { ServiceContext } from '../../../contexts/ServiceContext'; import Paragraph from '../../Paragraph'; diff --git a/src/app/components/FrostedGlassPromo/index.tsx b/src/app/components/FrostedGlassPromo/index.tsx index 4224738fb8a..14a4587cbf6 100644 --- a/src/app/components/FrostedGlassPromo/index.tsx +++ b/src/app/components/FrostedGlassPromo/index.tsx @@ -2,7 +2,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import React, { PropsWithChildren, useContext } from 'react'; -import pick from 'ramda/src/pick'; +import { pick } from 'rambda'; import Lazyload from 'react-lazyload'; import IMAGE from '../Image'; diff --git a/src/app/components/FrostedGlassPromo/withData.tsx b/src/app/components/FrostedGlassPromo/withData.tsx index 71ce4c5418c..faa3dd98f8d 100644 --- a/src/app/components/FrostedGlassPromo/withData.tsx +++ b/src/app/components/FrostedGlassPromo/withData.tsx @@ -1,9 +1,9 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; import { PropsWithChildren, useContext } from 'react'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; -import pick from 'ramda/src/pick'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; +import { pick } from 'rambda'; import PromoTimestamp from '../../legacy/components/Promo/timestamp'; import getOriginCode from '../../lib/utilities/imageSrcHelpers/originCode'; diff --git a/src/app/components/Header/ScriptLink/index.tsx b/src/app/components/Header/ScriptLink/index.tsx index f47e971704d..df2f6f71cc5 100644 --- a/src/app/components/Header/ScriptLink/index.tsx +++ b/src/app/components/Header/ScriptLink/index.tsx @@ -2,7 +2,7 @@ import { useContext } from 'react'; import { jsx } from '@emotion/react'; import { compile } from 'path-to-regexp'; -import clone from 'ramda/src/clone'; +import { clone } from 'rambda'; import { useRouteMatch } from 'react-router-dom'; import useToggle from '#hooks/useToggle'; import { Services, Variants } from '#app/models/types/global'; diff --git a/src/app/components/LinkedData/index.test.tsx b/src/app/components/LinkedData/index.test.tsx index 0c32f814c0d..f96627cbf66 100644 --- a/src/app/components/LinkedData/index.test.tsx +++ b/src/app/components/LinkedData/index.test.tsx @@ -1,6 +1,6 @@ import React, { ReactNode } from 'react'; import Helmet from 'react-helmet'; -import assocPath from 'ramda/src/assocPath'; +import { assocPath } from 'rambda'; import { RequestContextProvider } from '#contexts/RequestContext'; import { ARTICLE_PAGE } from '#app/routes/utils/pageTypes'; import { ServiceContextProvider } from '../../contexts/ServiceContext'; diff --git a/src/app/components/MostRead/Amp/index.tsx b/src/app/components/MostRead/Amp/index.tsx index 22c06b5c875..e8bf19852ab 100644 --- a/src/app/components/MostRead/Amp/index.tsx +++ b/src/app/components/MostRead/Amp/index.tsx @@ -7,7 +7,7 @@ import { AMP_MUSTACHE_JS, AMP_SCRIPT_JS, } from '#psammead/psammead-assets/src/amp-boilerplate'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { ServiceContext } from '../../../contexts/ServiceContext'; import { MostReadItemWrapper, MostReadLink } from '../Canonical/Item'; import MostReadRank from '../Canonical/Rank'; diff --git a/src/app/components/OptimizelyRecommendations/index.tsx b/src/app/components/OptimizelyRecommendations/index.tsx index b34b126a70d..2b614339e90 100644 --- a/src/app/components/OptimizelyRecommendations/index.tsx +++ b/src/app/components/OptimizelyRecommendations/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import CpsRecommendations from '#containers/CpsRecommendations'; import { OptimizelyExperiment } from '@optimizely/react-sdk'; import OPTIMIZELY_CONFIG from '#lib/config/optimizely'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { Article } from '#app/models/types/optimo'; // 005_brasil_recommendations_experiment diff --git a/src/app/components/PageLayoutWrapper/index.tsx b/src/app/components/PageLayoutWrapper/index.tsx index e038f041808..e48b6f48ced 100644 --- a/src/app/components/PageLayoutWrapper/index.tsx +++ b/src/app/components/PageLayoutWrapper/index.tsx @@ -4,7 +4,7 @@ import React, { PropsWithChildren, useContext } from 'react'; import { jsx } from '@emotion/react'; import { Helmet } from 'react-helmet'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import GlobalStyles from '#psammead/psammead-styles/src/global-styles'; import { PageTypes } from '#app/models/types/global'; diff --git a/src/app/components/Pagination/buildBlocks.ts b/src/app/components/Pagination/buildBlocks.ts index 059bc435b78..a5f393aef3b 100644 --- a/src/app/components/Pagination/buildBlocks.ts +++ b/src/app/components/Pagination/buildBlocks.ts @@ -1,5 +1,5 @@ -import pipe from 'ramda/src/pipe'; -import clone from 'ramda/src/clone'; +import { pipe } from 'rambda'; +import { clone } from 'rambda'; import findNClosestIndices from '#lib/utilities/findNClosestIndicies'; export const VISIBILITY = { diff --git a/src/app/components/RelatedContentSection/RelatedContentItem/index.tsx b/src/app/components/RelatedContentSection/RelatedContentItem/index.tsx index fa2a9f11c1e..bf05a048257 100644 --- a/src/app/components/RelatedContentSection/RelatedContentItem/index.tsx +++ b/src/app/components/RelatedContentSection/RelatedContentItem/index.tsx @@ -2,12 +2,11 @@ import { jsx } from '@emotion/react'; import { forwardRef } from 'react'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr, isEmpty } from 'rambda'; import { createSrcsets } from '#lib/utilities/srcSet'; import buildIChefURL from '#app/lib/utilities/ichefURL'; import Promo from '#components/OptimoPromos'; -import isEmpty from 'ramda/src/isEmpty'; import styles from './index.styles'; import { EventTrackingBlock } from '../../../models/types/eventTracking'; diff --git a/src/app/components/RelatedContentSection/index.tsx b/src/app/components/RelatedContentSection/index.tsx index 199b4933826..4e55c45ba12 100644 --- a/src/app/components/RelatedContentSection/index.tsx +++ b/src/app/components/RelatedContentSection/index.tsx @@ -3,15 +3,17 @@ import { useContext } from 'react'; import { jsx, useTheme } from '@emotion/react'; import SectionLabel from '#psammead/psammead-section-label/src'; -import pathOr from 'ramda/src/pathOr'; -import pathEq from 'ramda/src/pathEq'; -import path from 'ramda/src/path'; -import tail from 'ramda/src/tail'; -import slice from 'ramda/src/slice'; -import identity from 'ramda/src/identity'; -import last from 'ramda/src/last'; -import filter from 'ramda/src/filter'; -import pipe from 'ramda/src/pipe'; +import { + pathOr, + path, + pathEq, + tail, + slice, + identity, + last, + filter, + pipe, +} from 'rambda'; import useViewTracker from '#hooks/useViewTracker'; import { ServiceContext } from '../../contexts/ServiceContext'; @@ -108,7 +110,7 @@ const RelatedContentSection = ({ content }: { content: OptimoBlock[] }) => { const eventTrackingDataSend = path(['block'], eventTrackingData); const viewRef = useViewTracker(eventTrackingDataSend); - if (!pathEq('relatedContent', ['type'], blocks)) return null; + if (!pathEq(['type'], 'relatedContent', blocks)) return null; if (!blocks) return null; @@ -116,7 +118,7 @@ const RelatedContentSection = ({ content }: { content: OptimoBlock[] }) => { const LABEL_ID = 'related-content-heading'; const customTitle = - pathEq('title', [0, 'type'], items) && + pathEq([0, 'type'], 'title', items) && pathOr( [], [0, 'model', 'blocks', 0, 'model', 'blocks', 0, 'model', 'text'], diff --git a/src/app/components/ThemeProvider/themes/serbian/cyr.ts b/src/app/components/ThemeProvider/themes/serbian/cyr.ts index a189359d7e1..dd0c37bf885 100644 --- a/src/app/components/ThemeProvider/themes/serbian/cyr.ts +++ b/src/app/components/ThemeProvider/themes/serbian/cyr.ts @@ -1,4 +1,4 @@ -import { mergeDeepLeft } from 'ramda'; +import { mergeDeepLeft } from 'rambda'; import cyrillicScript from '../../fontScripts/cyrillic'; import withThemeProvider from '../../withThemeProvider'; import baseSerbianTheme from './base'; diff --git a/src/app/components/ThemeProvider/themes/serbian/lat.ts b/src/app/components/ThemeProvider/themes/serbian/lat.ts index 8b7afbbd3cf..5eb7122f42b 100644 --- a/src/app/components/ThemeProvider/themes/serbian/lat.ts +++ b/src/app/components/ThemeProvider/themes/serbian/lat.ts @@ -1,4 +1,4 @@ -import { mergeDeepLeft } from 'ramda'; +import { mergeDeepLeft } from 'rambda'; import latinWithDiacriticsScript from '../../fontScripts/latinWithDiacritics'; import withThemeProvider from '../../withThemeProvider'; import baseSerbianTheme from './base'; diff --git a/src/app/components/ThemeProvider/themes/uzbek/cyr.ts b/src/app/components/ThemeProvider/themes/uzbek/cyr.ts index ca03ea480cf..ee8d881b363 100644 --- a/src/app/components/ThemeProvider/themes/uzbek/cyr.ts +++ b/src/app/components/ThemeProvider/themes/uzbek/cyr.ts @@ -1,4 +1,4 @@ -import { mergeDeepLeft } from 'ramda'; +import { mergeDeepLeft } from 'rambda'; import cyrillicScript from '../../fontScripts/cyrillic'; import withThemeProvider from '../../withThemeProvider'; import baseUzbekTheme from './base'; diff --git a/src/app/components/ThemeProvider/themes/uzbek/lat.ts b/src/app/components/ThemeProvider/themes/uzbek/lat.ts index 447441c03f5..69d74b32a2d 100644 --- a/src/app/components/ThemeProvider/themes/uzbek/lat.ts +++ b/src/app/components/ThemeProvider/themes/uzbek/lat.ts @@ -1,4 +1,4 @@ -import { mergeDeepLeft } from 'ramda'; +import { mergeDeepLeft } from 'rambda'; import latinWithDiacriticsScript from '../../fontScripts/latinWithDiacritics'; import withThemeProvider from '../../withThemeProvider'; import baseUzbekTheme from './base'; diff --git a/src/app/contexts/ToggleContext/reducer.tsx b/src/app/contexts/ToggleContext/reducer.tsx index aecf4ffbcfc..0df61068062 100644 --- a/src/app/contexts/ToggleContext/reducer.tsx +++ b/src/app/contexts/ToggleContext/reducer.tsx @@ -1,5 +1,5 @@ import { Toggles } from '#app/models/types/global'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; type ReducerProps = { toggleState: Toggles; diff --git a/src/app/hooks/useClickTrackerHandler/clickTypes.js b/src/app/hooks/useClickTrackerHandler/clickTypes.js index d37fa386659..0b8643d8ee3 100644 --- a/src/app/hooks/useClickTrackerHandler/clickTypes.js +++ b/src/app/hooks/useClickTrackerHandler/clickTypes.js @@ -1,5 +1,4 @@ -import pathSatisfies from 'ramda/src/pathSatisfies'; -import startsWith from 'ramda/src/startsWith'; +import { pathSatisfies, startsWith } from 'rambda'; const isLeftClick = button => button === 0; const isMiddleClick = button => button === 1 || button === 4; // middle click for IE is 4 diff --git a/src/app/hooks/useClickTrackerHandler/index.jsx b/src/app/hooks/useClickTrackerHandler/index.jsx index 8b16abe6ea0..cbd07fd0441 100644 --- a/src/app/hooks/useClickTrackerHandler/index.jsx +++ b/src/app/hooks/useClickTrackerHandler/index.jsx @@ -1,7 +1,7 @@ /* eslint-disable no-console */ import { useContext, useCallback, useState } from 'react'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import { EventTrackingContext } from '../../contexts/EventTrackingContext'; import useTrackingToggle from '../useTrackingToggle'; diff --git a/src/app/hooks/useImageColour/utils.js b/src/app/hooks/useImageColour/utils.js index 83381eb2433..e8bfaa80076 100644 --- a/src/app/hooks/useImageColour/utils.js +++ b/src/app/hooks/useImageColour/utils.js @@ -1,4 +1,4 @@ -import is from 'ramda/src/is'; +import { is } from 'rambda'; // https://stackoverflow.com/a/5624139 export const hexToRgb = hex => { diff --git a/src/app/hooks/useViewTracker/index.jsx b/src/app/hooks/useViewTracker/index.jsx index 4066c430a62..4dce6692032 100644 --- a/src/app/hooks/useViewTracker/index.jsx +++ b/src/app/hooks/useViewTracker/index.jsx @@ -1,7 +1,5 @@ import { useContext, useEffect, useState, useRef } from 'react'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; -import prop from 'ramda/src/prop'; +import { path, pathOr, prop } from 'rambda'; import { sendEventBeacon } from '../../components/ATIAnalytics/beacon'; import { EventTrackingContext } from '../../contexts/EventTrackingContext'; diff --git a/src/app/legacy/components/Promo/index.jsx b/src/app/legacy/components/Promo/index.jsx index d62503b20ef..34025541a66 100644 --- a/src/app/legacy/components/Promo/index.jsx +++ b/src/app/legacy/components/Promo/index.jsx @@ -1,10 +1,10 @@ import React, { useContext, useMemo } from 'react'; import styled from '@emotion/styled'; -import partition from 'ramda/src/partition'; +import { partition } from 'rambda'; import { ServiceContext } from '../../../contexts/ServiceContext'; -import Image from './image'; +import Image from './image' import MediaIcon, { TYPES } from './media-icon'; import Heading from './heading'; import Body from './body'; diff --git a/src/app/legacy/components/RadioSchedule/ScheduleItemHeader/index.jsx b/src/app/legacy/components/RadioSchedule/ScheduleItemHeader/index.jsx index f9f25938029..279be32db15 100644 --- a/src/app/legacy/components/RadioSchedule/ScheduleItemHeader/index.jsx +++ b/src/app/legacy/components/RadioSchedule/ScheduleItemHeader/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { formatUnixTimestamp } from '#psammead/psammead-timestamp-container/src/utilities'; import detokenise from '#psammead/psammead-detokeniser/src'; import LiveLabel from '#app/components/LiveLabel'; diff --git a/src/app/legacy/components/ScrollablePromo/Promo/index.jsx b/src/app/legacy/components/ScrollablePromo/Promo/index.jsx index a2a71a52e7b..419d1c59b40 100644 --- a/src/app/legacy/components/ScrollablePromo/Promo/index.jsx +++ b/src/app/legacy/components/ScrollablePromo/Promo/index.jsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import { getPica } from '#psammead/gel-foundations/src/typography'; import { getSerifBold } from '#psammead/psammead-styles/src/font-styles'; import { Link } from '#psammead/psammead-story-promo/src'; diff --git a/src/app/legacy/components/ScrollablePromo/index.jsx b/src/app/legacy/components/ScrollablePromo/index.jsx index 31bf3d4a399..f43d48aa0c8 100644 --- a/src/app/legacy/components/ScrollablePromo/index.jsx +++ b/src/app/legacy/components/ScrollablePromo/index.jsx @@ -7,10 +7,7 @@ import { import { getDoublePica } from '#psammead/gel-foundations/src/typography'; import { getSansRegular } from '#psammead/psammead-styles/src/font-styles'; import styled from '@emotion/styled'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; -import isEmpty from 'ramda/src/isEmpty'; -import tail from 'ramda/src/tail'; +import { path, pathOr, isEmpty, tail } from 'rambda'; import { GEL_GROUP_0_SCREEN_WIDTH_MIN, GEL_GROUP_2_SCREEN_WIDTH_MIN, diff --git a/src/app/legacy/containers/App/App.jsx b/src/app/legacy/containers/App/App.jsx index bb7d57690b4..f9e38429ecf 100644 --- a/src/app/legacy/containers/App/App.jsx +++ b/src/app/legacy/containers/App/App.jsx @@ -1,7 +1,5 @@ import { renderRoutes } from 'react-router-config'; -import pick from 'ramda/src/pick'; -import mergeAll from 'ramda/src/mergeAll'; -import path from 'ramda/src/path'; +import { pick, mergeAll, path } from 'rambda'; import getRouteProps from '#app/routes/utils/fetchPageData/utils/getRouteProps'; import routes from '#app/routes'; diff --git a/src/app/legacy/containers/Blocks/index.jsx b/src/app/legacy/containers/Blocks/index.jsx index 7537b4bcff2..da346a71168 100644 --- a/src/app/legacy/containers/Blocks/index.jsx +++ b/src/app/legacy/containers/Blocks/index.jsx @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import styled from '@emotion/styled'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; const Clearer = styled.div` clear: both; diff --git a/src/app/legacy/containers/BulletedList/index.jsx b/src/app/legacy/containers/BulletedList/index.jsx index 96dd136ef49..ec43d35bd22 100644 --- a/src/app/legacy/containers/BulletedList/index.jsx +++ b/src/app/legacy/containers/BulletedList/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from '@emotion/styled'; -import pick from 'ramda/src/pick'; +import { pick } from 'rambda'; import { GEL_SPACING_TRPL } from '#psammead/gel-foundations/src/spacings'; import { GridItemMedium } from '#components/Grid'; import useViewTracker from '#hooks/useViewTracker'; diff --git a/src/app/legacy/containers/Bulletin/index.jsx b/src/app/legacy/containers/Bulletin/index.jsx index dbfc1591e31..c96fc4f321e 100644 --- a/src/app/legacy/containers/Bulletin/index.jsx +++ b/src/app/legacy/containers/Bulletin/index.jsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import Bulletin from '#psammead/psammead-bulletin/src'; import { createSrcsets } from '#lib/utilities/srcSet'; import buildIChefURL from '#lib/utilities/ichefURL'; diff --git a/src/app/legacy/containers/Bulletin/index.stories.jsx b/src/app/legacy/containers/Bulletin/index.stories.jsx index 186c27dee59..67b9993a8bf 100644 --- a/src/app/legacy/containers/Bulletin/index.stories.jsx +++ b/src/app/legacy/containers/Bulletin/index.stories.jsx @@ -9,7 +9,7 @@ import { radioBulletinItem, liveRadioBulletinItem, } from './fixtureData'; -import { dissocPath } from 'ramda'; +import { dissocPath } from 'rambda'; const tvFixture = tvBulletinItem; const audioFixture = radioBulletinItem; diff --git a/src/app/legacy/containers/ConsentBanner/useConsentBanners/setCookieOven.js b/src/app/legacy/containers/ConsentBanner/useConsentBanners/setCookieOven.js index 04cd6cfaf1c..82122bfa24c 100644 --- a/src/app/legacy/containers/ConsentBanner/useConsentBanners/setCookieOven.js +++ b/src/app/legacy/containers/ConsentBanner/useConsentBanners/setCookieOven.js @@ -1,5 +1,5 @@ import 'isomorphic-fetch'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import getCookieOvenEndpoints from './getCookieOvenEndpoints'; diff --git a/src/app/legacy/containers/CpsFeaturesAnalysis/index.jsx b/src/app/legacy/containers/CpsFeaturesAnalysis/index.jsx index 9a3ef7c475a..3b5a3bab1f4 100644 --- a/src/app/legacy/containers/CpsFeaturesAnalysis/index.jsx +++ b/src/app/legacy/containers/CpsFeaturesAnalysis/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { StoryPromoLi, StoryPromoUl, diff --git a/src/app/legacy/containers/CpsRecommendations/RecommendationsPromo/utility/index.ts b/src/app/legacy/containers/CpsRecommendations/RecommendationsPromo/utility/index.ts index d5dd87e399b..88ab2ee5033 100644 --- a/src/app/legacy/containers/CpsRecommendations/RecommendationsPromo/utility/index.ts +++ b/src/app/legacy/containers/CpsRecommendations/RecommendationsPromo/utility/index.ts @@ -1,5 +1,4 @@ -import path from 'ramda/src/path'; -import hasPath from 'ramda/src/hasPath'; +import { path, hasPath } from 'rambda'; import getOriginCode from '../../../../../lib/utilities/imageSrcHelpers/originCode'; import getLocator from '../../../../../lib/utilities/imageSrcHelpers/locator'; import { diff --git a/src/app/legacy/containers/CpsRecommendations/RecommendationsPromoList/index.test.jsx b/src/app/legacy/containers/CpsRecommendations/RecommendationsPromoList/index.test.jsx index e1999c3b3ec..4c4e3df2ccd 100644 --- a/src/app/legacy/containers/CpsRecommendations/RecommendationsPromoList/index.test.jsx +++ b/src/app/legacy/containers/CpsRecommendations/RecommendationsPromoList/index.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import pidginPageData from '#data/pidgin/cpsAssets/tori-49450859'; import { ToggleContextProvider } from '#contexts/ToggleContext'; import * as clickTracking from '#hooks/useClickTrackerHandler'; diff --git a/src/app/legacy/containers/CpsRecommendations/index.jsx b/src/app/legacy/containers/CpsRecommendations/index.jsx index eb9c7beb69a..88c072ac76f 100644 --- a/src/app/legacy/containers/CpsRecommendations/index.jsx +++ b/src/app/legacy/containers/CpsRecommendations/index.jsx @@ -6,8 +6,8 @@ import { GEL_GROUP_3_SCREEN_WIDTH_MIN, GEL_GROUP_4_SCREEN_WIDTH_MIN, } from '#psammead/gel-foundations/src/breakpoints'; -import pathOr from 'ramda/src/pathOr'; -import path from 'ramda/src/path'; +import { pathOr } from 'rambda'; +import { path } from 'rambda'; import { GEL_SPACING, GEL_SPACING_DBL, diff --git a/src/app/legacy/containers/EpisodeList/Episode.jsx b/src/app/legacy/containers/EpisodeList/Episode.jsx index be958e68527..055b772a451 100644 --- a/src/app/legacy/containers/EpisodeList/Episode.jsx +++ b/src/app/legacy/containers/EpisodeList/Episode.jsx @@ -1,12 +1,12 @@ import React, { Children, cloneElement, forwardRef } from 'react'; import styled from '@emotion/styled'; import { GEL_SPACING_DBL } from '#psammead/gel-foundations/src/spacings'; -import tail from 'ramda/src/tail'; +import { tail } from 'rambda'; import { GEL_GROUP_2_SCREEN_WIDTH_MIN, GEL_GROUP_3_SCREEN_WIDTH_MIN, } from '#psammead/gel-foundations/src/breakpoints'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import Image from './Image'; import { withEpisodeContext } from './helpers'; diff --git a/src/app/legacy/containers/EpisodeList/Image.jsx b/src/app/legacy/containers/EpisodeList/Image.jsx index c30002ad50d..79c5b5b598c 100644 --- a/src/app/legacy/containers/EpisodeList/Image.jsx +++ b/src/app/legacy/containers/EpisodeList/Image.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import omit from 'ramda/src/omit'; +import { omit } from 'rambda'; import styled from '@emotion/styled'; import { mediaIcons } from '#psammead/psammead-assets/src/svgs'; import { getMinion } from '#psammead/gel-foundations/src/typography'; diff --git a/src/app/legacy/containers/EpisodeList/RecentAudioEpisodes/index.jsx b/src/app/legacy/containers/EpisodeList/RecentAudioEpisodes/index.jsx index fe0d37c8a99..6b62bc4d6c4 100644 --- a/src/app/legacy/containers/EpisodeList/RecentAudioEpisodes/index.jsx +++ b/src/app/legacy/containers/EpisodeList/RecentAudioEpisodes/index.jsx @@ -1,7 +1,7 @@ /* eslint-disable jsx-a11y/aria-role */ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { formatDuration, formatUnixTimestamp, diff --git a/src/app/legacy/containers/EpisodeList/RecentVideoEpisodes/index.jsx b/src/app/legacy/containers/EpisodeList/RecentVideoEpisodes/index.jsx index 1facc9f732b..b9da8b70858 100644 --- a/src/app/legacy/containers/EpisodeList/RecentVideoEpisodes/index.jsx +++ b/src/app/legacy/containers/EpisodeList/RecentVideoEpisodes/index.jsx @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import Timestamp from '#psammead/psammead-timestamp-container/src'; import { formatDuration, diff --git a/src/app/legacy/containers/FauxHeadline/index.jsx b/src/app/legacy/containers/FauxHeadline/index.jsx index fde2814cbe1..9495682f407 100644 --- a/src/app/legacy/containers/FauxHeadline/index.jsx +++ b/src/app/legacy/containers/FauxHeadline/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import { GEL_SPACING, GEL_SPACING_DBL, diff --git a/src/app/legacy/containers/FrontPageStoryRows/testHelpers.js b/src/app/legacy/containers/FrontPageStoryRows/testHelpers.js index cf59225ef57..ba4b5b37bbd 100644 --- a/src/app/legacy/containers/FrontPageStoryRows/testHelpers.js +++ b/src/app/legacy/containers/FrontPageStoryRows/testHelpers.js @@ -1,5 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; -import take from 'ramda/src/take'; +import { pathOr, take } from 'rambda'; import { v4 as uuid } from 'uuid'; import { data as serbianFrontPageData } from '#data/serbian/frontpage/lat'; import { data as urduFrontPageData } from '#data/urdu/frontpage'; diff --git a/src/app/legacy/containers/Gist/index.jsx b/src/app/legacy/containers/Gist/index.jsx index 3cabb5dd180..a4690372d23 100644 --- a/src/app/legacy/containers/Gist/index.jsx +++ b/src/app/legacy/containers/Gist/index.jsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import styled from '@emotion/styled'; import { useTheme } from '@emotion/react'; import { diff --git a/src/app/legacy/containers/Headings/index.jsx b/src/app/legacy/containers/Headings/index.jsx index ca466648a3b..497eb4cd0d5 100644 --- a/src/app/legacy/containers/Headings/index.jsx +++ b/src/app/legacy/containers/Headings/index.jsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import styled from '@emotion/styled'; import { Headline, SubHeading } from '#psammead/psammead-headings/src'; import idSanitiser from '#lib/utilities/idSanitiser'; diff --git a/src/app/legacy/containers/IndexPageSection/index.jsx b/src/app/legacy/containers/IndexPageSection/index.jsx index ec26e129f59..c51f78565c5 100644 --- a/src/app/legacy/containers/IndexPageSection/index.jsx +++ b/src/app/legacy/containers/IndexPageSection/index.jsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; import makeRelativeUrlPath from '#lib/utilities/makeRelativeUrlPath'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { GEL_GROUP_3_SCREEN_WIDTH_MIN, GEL_GROUP_3_SCREEN_WIDTH_MAX, diff --git a/src/app/legacy/containers/IndexPageSection/index.stories.jsx b/src/app/legacy/containers/IndexPageSection/index.stories.jsx index 51497672712..8dbea3fb9b0 100644 --- a/src/app/legacy/containers/IndexPageSection/index.stories.jsx +++ b/src/app/legacy/containers/IndexPageSection/index.stories.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { ToggleContextProvider } from '#contexts/ToggleContext'; import { data as serbianData } from '#data/serbian/frontpage/lat.json'; import { RequestContextProvider } from '#contexts/RequestContext'; diff --git a/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.jsx b/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.jsx index 54d39d2558f..5b9c8c1f27e 100644 --- a/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.jsx +++ b/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.jsx @@ -1,4 +1,4 @@ -import dropWhile from 'ramda/src/dropWhile'; +import { dropWhile } from 'rambda'; import { getHeadline, getUrl } from '#lib/utilities/getStoryPromoInfo'; const MAX_ALLOWED_ITEMS_FIRST_SECTION = 13; diff --git a/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx b/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx index bb043fc95e6..a7fc4ccf390 100644 --- a/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx +++ b/src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx @@ -1,5 +1,4 @@ -import range from 'ramda/src/range'; -import { +import { range } from 'rambda';import { getAllowedItems, removeFirstSlotRadioBulletin, removeTVBulletinsIfNotAVLiveStream, diff --git a/src/app/legacy/containers/IndexPageSection/utilities/rowDetails.jsx b/src/app/legacy/containers/IndexPageSection/utilities/rowDetails.jsx index 501ce0bdefc..9808b8e6ad7 100644 --- a/src/app/legacy/containers/IndexPageSection/utilities/rowDetails.jsx +++ b/src/app/legacy/containers/IndexPageSection/utilities/rowDetails.jsx @@ -1,4 +1,4 @@ -import flatten from 'ramda/src/flatten'; +import { flatten } from 'rambda'; import { TopRow, LeadingRow, RegularRow } from '../../FrontPageStoryRows'; const getFirstRowComponent = rowLength => { diff --git a/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.jsx b/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.jsx index 4d8ce7305b8..2ce4333b491 100644 --- a/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.jsx +++ b/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.jsx @@ -1,4 +1,4 @@ -import splitEvery from 'ramda/src/splitEvery'; +import { splitEvery } from 'rambda'; // Split the top row stories out into their own list const splitFirstRow = (items, isFirstSection) => { diff --git a/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx b/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx index 16e05b099d5..a656a72c482 100644 --- a/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx +++ b/src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx @@ -1,4 +1,4 @@ -import range from 'ramda/src/range'; +import { range } from 'rambda'; import getRows from './storyRowsSplitter'; const numberOfStories = { diff --git a/src/app/legacy/containers/InlineLink/index.jsx b/src/app/legacy/containers/InlineLink/index.jsx index 45138ddac7f..db14df379e1 100644 --- a/src/app/legacy/containers/InlineLink/index.jsx +++ b/src/app/legacy/containers/InlineLink/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import InlineLink from '#psammead/psammead-inline-link/src'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import makeRelativeUrlPath from '#lib/utilities/makeRelativeUrlPath'; import { ServiceContext } from '../../../contexts/ServiceContext'; import Blocks from '../Blocks'; diff --git a/src/app/legacy/containers/OnDemandImage/index.jsx b/src/app/legacy/containers/OnDemandImage/index.jsx index 5e78f404af3..548518dc12a 100644 --- a/src/app/legacy/containers/OnDemandImage/index.jsx +++ b/src/app/legacy/containers/OnDemandImage/index.jsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import is from 'ramda/src/is'; +import { is } from 'rambda'; import styled from '@emotion/styled'; import { GEL_SPACING_QUAD, diff --git a/src/app/legacy/containers/PageHandlers/withHashChangeHandler/index.jsx b/src/app/legacy/containers/PageHandlers/withHashChangeHandler/index.jsx index a9bce21aaee..8bfe254c7c8 100644 --- a/src/app/legacy/containers/PageHandlers/withHashChangeHandler/index.jsx +++ b/src/app/legacy/containers/PageHandlers/withHashChangeHandler/index.jsx @@ -1,6 +1,6 @@ import React, { memo, useEffect } from 'react'; -import path from 'ramda/src/path'; -import pipe from 'ramda/src/pipe'; +import { path } from 'rambda'; +import { pipe } from 'rambda'; import isHashChangeOnSamePath from './isHashChangeOnSamePath'; diff --git a/src/app/legacy/containers/PodcastExternalLinks/index.jsx b/src/app/legacy/containers/PodcastExternalLinks/index.jsx index dc462475665..9bdb8b36763 100644 --- a/src/app/legacy/containers/PodcastExternalLinks/index.jsx +++ b/src/app/legacy/containers/PodcastExternalLinks/index.jsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/aria-role */ import React, { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import styled from '@emotion/styled'; import { getSansRegular } from '#psammead/psammead-styles/src/font-styles'; import { diff --git a/src/app/legacy/containers/PodcastPromo/Inline.jsx b/src/app/legacy/containers/PodcastPromo/Inline.jsx index 9491f6ebb4e..d1b04450494 100644 --- a/src/app/legacy/containers/PodcastPromo/Inline.jsx +++ b/src/app/legacy/containers/PodcastPromo/Inline.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { GEL_SPACING_HLF, GEL_SPACING, diff --git a/src/app/legacy/containers/PodcastPromo/index.test.jsx b/src/app/legacy/containers/PodcastPromo/index.test.jsx index 75a52b8252f..7325e76177a 100644 --- a/src/app/legacy/containers/PodcastPromo/index.test.jsx +++ b/src/app/legacy/containers/PodcastPromo/index.test.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import dissocPath from 'ramda/src/dissocPath'; -import identity from 'ramda/src/identity'; + +import { dissocPath, identity } from 'rambda'; import { ToggleContextProvider } from '#contexts/ToggleContext'; diff --git a/src/app/legacy/containers/PodcastPromo/shared.js b/src/app/legacy/containers/PodcastPromo/shared.js index 07ad7d092ed..46803f11d32 100644 --- a/src/app/legacy/containers/PodcastPromo/shared.js +++ b/src/app/legacy/containers/PodcastPromo/shared.js @@ -1,4 +1,4 @@ -import path from 'ramda/src/path'; +import { path } from 'rambda'; import makeRelativeUrlPath from '#lib/utilities/makeRelativeUrlPath'; import { getMimeType } from '#lib/utilities/srcSet'; diff --git a/src/app/legacy/containers/RadioSchedule/index.jsx b/src/app/legacy/containers/RadioSchedule/index.jsx index 999c449fda9..0a4047cf4c0 100644 --- a/src/app/legacy/containers/RadioSchedule/index.jsx +++ b/src/app/legacy/containers/RadioSchedule/index.jsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { RequestContext } from '#contexts/RequestContext'; import useLocation from '#hooks/useLocation'; import useToggle from '#hooks/useToggle'; diff --git a/src/app/legacy/containers/RadioSchedule/utilities/evaluateScheduleData.js b/src/app/legacy/containers/RadioSchedule/utilities/evaluateScheduleData.js index ee689c88771..6291fdb612d 100644 --- a/src/app/legacy/containers/RadioSchedule/utilities/evaluateScheduleData.js +++ b/src/app/legacy/containers/RadioSchedule/utilities/evaluateScheduleData.js @@ -1,6 +1,4 @@ -import findLastIndex from 'ramda/src/findLastIndex'; -import propSatisfies from 'ramda/src/propSatisfies'; -import path from 'ramda/src/path'; +import { path, propSatisfies, findLastIndex } from 'rambda'; export const getLastProgramIndex = ({ schedules, currentTime }) => { return findLastIndex( diff --git a/src/app/legacy/containers/RadioSchedule/utilities/processRadioSchedule.js b/src/app/legacy/containers/RadioSchedule/utilities/processRadioSchedule.js index 7a66f23a834..84c2b9acc78 100644 --- a/src/app/legacy/containers/RadioSchedule/utilities/processRadioSchedule.js +++ b/src/app/legacy/containers/RadioSchedule/utilities/processRadioSchedule.js @@ -1,4 +1,4 @@ -import path from 'ramda/src/path'; +import { path } from 'rambda'; import nodeLogger from '#lib/logger.node'; import { RADIO_SCHEDULE_DATA_INCOMPLETE_ERROR } from '#lib/logger.const'; import { diff --git a/src/app/legacy/containers/RelatedTopics/index.jsx b/src/app/legacy/containers/RelatedTopics/index.jsx index 258cb0de5c2..803d29e922a 100644 --- a/src/app/legacy/containers/RelatedTopics/index.jsx +++ b/src/app/legacy/containers/RelatedTopics/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import { TopicTag, TopicTags } from '#psammead/psammead-topic-tags/src'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import SectionLabel from '#psammead/psammead-section-label/src'; import styled from '@emotion/styled'; import { GEL_SPACING_QUIN } from '#psammead/gel-foundations/src/spacings'; diff --git a/src/app/legacy/containers/SocialEmbed/common/translations.js b/src/app/legacy/containers/SocialEmbed/common/translations.js index a70bd070b19..72e7c71a7e8 100644 --- a/src/app/legacy/containers/SocialEmbed/common/translations.js +++ b/src/app/legacy/containers/SocialEmbed/common/translations.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; const createTranslations = ({ translations, index }) => { const skipLinkText = pathOr( diff --git a/src/app/legacy/containers/StoryPromo/IndexAlsos/index.jsx b/src/app/legacy/containers/StoryPromo/IndexAlsos/index.jsx index 07a6d441a0d..304e2640dc2 100644 --- a/src/app/legacy/containers/StoryPromo/IndexAlsos/index.jsx +++ b/src/app/legacy/containers/StoryPromo/IndexAlsos/index.jsx @@ -1,5 +1,5 @@ import React, { useContext, Fragment } from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import MediaIndicator from '#psammead/psammead-media-indicator/src'; import { IndexAlsos, diff --git a/src/app/legacy/containers/StoryPromo/IndexAlsos/index.test.jsx b/src/app/legacy/containers/StoryPromo/IndexAlsos/index.test.jsx index d0020890fa3..8e9396be9d2 100644 --- a/src/app/legacy/containers/StoryPromo/IndexAlsos/index.test.jsx +++ b/src/app/legacy/containers/StoryPromo/IndexAlsos/index.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import compose from 'ramda/src/compose'; +import { compose } from 'rambda'; import { shouldMatchSnapshot, suppressPropWarnings, diff --git a/src/app/legacy/containers/StoryPromo/LinkContents/index.jsx b/src/app/legacy/containers/StoryPromo/LinkContents/index.jsx index f25ac084277..f8f5070f01e 100644 --- a/src/app/legacy/containers/StoryPromo/LinkContents/index.jsx +++ b/src/app/legacy/containers/StoryPromo/LinkContents/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import moment from 'moment-timezone'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import formatDuration from '#lib/utilities/formatDuration'; import { getHeadline } from '#lib/utilities/getStoryPromoInfo'; import { ServiceContext } from '../../../../contexts/ServiceContext'; diff --git a/src/app/legacy/containers/StoryPromo/LinkContents/index.test.jsx b/src/app/legacy/containers/StoryPromo/LinkContents/index.test.jsx index 87e229f6619..148ec972083 100644 --- a/src/app/legacy/containers/StoryPromo/LinkContents/index.test.jsx +++ b/src/app/legacy/containers/StoryPromo/LinkContents/index.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import compose from 'ramda/src/compose'; +import { compose } from 'rambda'; import { render } from '@testing-library/react'; import { MEDIA_ASSET_PAGE, diff --git a/src/app/legacy/containers/StoryPromo/MediaIndicator/index.jsx b/src/app/legacy/containers/StoryPromo/MediaIndicator/index.jsx index 8b0a8f69640..4257933144b 100644 --- a/src/app/legacy/containers/StoryPromo/MediaIndicator/index.jsx +++ b/src/app/legacy/containers/StoryPromo/MediaIndicator/index.jsx @@ -3,8 +3,8 @@ import moment from 'moment-timezone'; import styled from '@emotion/styled'; import MediaIndicator from '#psammead/psammead-media-indicator/src'; import { GEL_SPACING_HLF } from '#psammead/gel-foundations/src/spacings'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import formatDuration from '#lib/utilities/formatDuration'; import { isPgl, isMap } from '../utilities'; diff --git a/src/app/legacy/containers/StoryPromo/index.jsx b/src/app/legacy/containers/StoryPromo/index.jsx index 2bd4bfb2fd1..0999c9a9d1f 100644 --- a/src/app/legacy/containers/StoryPromo/index.jsx +++ b/src/app/legacy/containers/StoryPromo/index.jsx @@ -6,7 +6,7 @@ import StoryPromo, { Link, } from '#psammead/psammead-story-promo/src'; import { GEL_GROUP_4_SCREEN_WIDTH_MIN } from '#psammead/gel-foundations/src/breakpoints'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import LiveLabel from '#app/components/LiveLabel'; import ImagePlaceholder from '#psammead/psammead-image-placeholder/src'; import { RequestContext } from '#contexts/RequestContext'; diff --git a/src/app/legacy/containers/StoryPromo/index.stories.jsx b/src/app/legacy/containers/StoryPromo/index.stories.jsx index 08b0c730aa8..01d38609860 100644 --- a/src/app/legacy/containers/StoryPromo/index.stories.jsx +++ b/src/app/legacy/containers/StoryPromo/index.stories.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { RequestContextProvider } from '#contexts/RequestContext'; import { ToggleContextProvider } from '#contexts/ToggleContext'; import { ARTICLE_PAGE, MEDIA_ASSET_PAGE } from '#app/routes/utils/pageTypes'; diff --git a/src/app/legacy/containers/StoryPromo/index.test.jsx b/src/app/legacy/containers/StoryPromo/index.test.jsx index 6894e104392..be9acc6c4d6 100644 --- a/src/app/legacy/containers/StoryPromo/index.test.jsx +++ b/src/app/legacy/containers/StoryPromo/index.test.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { render, cleanup } from '@testing-library/react'; -import deepClone from 'ramda/src/clone'; +import { clone as deepClone } from 'rambda'; import loggerMock from '#testHelpers/loggerMock'; import { MEDIA_MISSING } from '#lib/logger.const'; import { RequestContextProvider } from '#contexts/RequestContext'; diff --git a/src/app/legacy/containers/StoryPromo/useCombinedClickTrackerHandler.js b/src/app/legacy/containers/StoryPromo/useCombinedClickTrackerHandler.js index 58ce767e1ef..a4c9ac1b25e 100644 --- a/src/app/legacy/containers/StoryPromo/useCombinedClickTrackerHandler.js +++ b/src/app/legacy/containers/StoryPromo/useCombinedClickTrackerHandler.js @@ -1,4 +1,4 @@ -import path from 'ramda/src/path'; +import { path } from 'rambda'; import useClickTrackerHandler from '#hooks/useClickTrackerHandler'; diff --git a/src/app/legacy/containers/StoryPromo/utilities/index.js b/src/app/legacy/containers/StoryPromo/utilities/index.js index ba41afa5293..5afff15d57b 100644 --- a/src/app/legacy/containers/StoryPromo/utilities/index.js +++ b/src/app/legacy/containers/StoryPromo/utilities/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { MEDIA_ASSET_PAGE } from '#app/routes/utils/pageTypes'; // MAP is now either a Media Asset Page or a Media Article Page diff --git a/src/app/legacy/containers/VisuallyHiddenHeadline/index.jsx b/src/app/legacy/containers/VisuallyHiddenHeadline/index.jsx index ccb9a8fb7b4..38142f4623e 100644 --- a/src/app/legacy/containers/VisuallyHiddenHeadline/index.jsx +++ b/src/app/legacy/containers/VisuallyHiddenHeadline/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import VisuallyHiddenText from '../../../components/VisuallyHiddenText'; const VisuallyHiddenHeadline = props => ( diff --git a/src/app/legacy/psammead/psammead-image/src/index.amp.jsx b/src/app/legacy/psammead/psammead-image/src/index.amp.jsx index 80ccc1043e8..ebb7f860b34 100644 --- a/src/app/legacy/psammead/psammead-image/src/index.amp.jsx +++ b/src/app/legacy/psammead/psammead-image/src/index.amp.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import omit from 'ramda/src/omit'; +import { omit } from 'rambda'; // Prevents component outputting invalid HTML when styled with emotion const omitInvalidProps = omit([ diff --git a/src/app/legacy/psammead/psammead-test-helpers/src/index.js b/src/app/legacy/psammead/psammead-test-helpers/src/index.js index 8c8165bd6bb..dd31005a10b 100644 --- a/src/app/legacy/psammead/psammead-test-helpers/src/index.js +++ b/src/app/legacy/psammead/psammead-test-helpers/src/index.js @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -import deepClone from 'ramda/src/clone'; +import { clone as deepClone } from 'rambda'; export const shouldMatchSnapshot = (title, component) => { it(title, () => { diff --git a/src/app/lib/analyticsUtils/index.js b/src/app/lib/analyticsUtils/index.js index 72c5f15d48d..dda1af2c189 100644 --- a/src/app/lib/analyticsUtils/index.js +++ b/src/app/lib/analyticsUtils/index.js @@ -1,7 +1,7 @@ import Cookie from 'js-cookie'; import { v4 as uuid } from 'uuid'; -import pathOr from 'ramda/src/pathOr'; -import path from 'ramda/src/path'; +import { pathOr } from 'rambda'; +import { path } from 'rambda'; import Url from 'url-parse'; import onClient from '../utilities/onClient'; import isOperaProxy from '../utilities/isOperaProxy'; diff --git a/src/app/lib/analyticsUtils/indexPage/index.js b/src/app/lib/analyticsUtils/indexPage/index.js index 034db8fec69..97f1109dc50 100644 --- a/src/app/lib/analyticsUtils/indexPage/index.js +++ b/src/app/lib/analyticsUtils/indexPage/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { FRONT_PAGE, FEATURE_INDEX_PAGE, diff --git a/src/app/lib/utilities/episodeAvailability/ErrorMessage/index.jsx b/src/app/lib/utilities/episodeAvailability/ErrorMessage/index.jsx index 8a8b389e47c..f99c56a18fb 100644 --- a/src/app/lib/utilities/episodeAvailability/ErrorMessage/index.jsx +++ b/src/app/lib/utilities/episodeAvailability/ErrorMessage/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import styled from '@emotion/styled'; -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import { GEL_SPACING, GEL_SPACING_DBL, diff --git a/src/app/lib/utilities/episodeAvailability/index.js b/src/app/lib/utilities/episodeAvailability/index.js index fd2598572ad..b8a93a5dff6 100644 --- a/src/app/lib/utilities/episodeAvailability/index.js +++ b/src/app/lib/utilities/episodeAvailability/index.js @@ -1,5 +1,5 @@ -import pathOr from 'ramda/src/pathOr'; -import path from 'ramda/src/path'; +import { pathOr } from 'rambda'; +import { path } from 'rambda'; import nodeLogger from '#lib/logger.node'; import { EPISODE_EXPIRED, diff --git a/src/app/lib/utilities/episodeAvailability/index.test.js b/src/app/lib/utilities/episodeAvailability/index.test.js index 0a91d0150e5..2f2d71dc5fd 100644 --- a/src/app/lib/utilities/episodeAvailability/index.test.js +++ b/src/app/lib/utilities/episodeAvailability/index.test.js @@ -1,5 +1,5 @@ -import assocPath from 'ramda/src/assocPath'; -import pipe from 'ramda/src/pipe'; +import { assocPath } from 'rambda'; +import { pipe } from 'rambda'; import loggerMock from '#testHelpers/loggerMock'; import { EPISODE_EXPIRED, diff --git a/src/app/lib/utilities/findNthIndex/index.js b/src/app/lib/utilities/findNthIndex/index.js index 5743b0edff6..ee8b5ff7c36 100644 --- a/src/app/lib/utilities/findNthIndex/index.js +++ b/src/app/lib/utilities/findNthIndex/index.js @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import is from 'ramda/src/is'; +import { is } from 'rambda'; const validateInputs = (n, predicate, inputArray) => { if (!(Number.isInteger(n) && n > 0)) { diff --git a/src/app/lib/utilities/getMasterbrand/index.js b/src/app/lib/utilities/getMasterbrand/index.js index 1a108984027..c4b133d40f9 100644 --- a/src/app/lib/utilities/getMasterbrand/index.js +++ b/src/app/lib/utilities/getMasterbrand/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; const getMasterBrand = (externalId, liveRadioIdOverrides) => pathOr(externalId, ['masterBrand', externalId], liveRadioIdOverrides); diff --git a/src/app/lib/utilities/getStoryPromoInfo/index.jsx b/src/app/lib/utilities/getStoryPromoInfo/index.jsx index 30004f379e3..ed071057423 100644 --- a/src/app/lib/utilities/getStoryPromoInfo/index.jsx +++ b/src/app/lib/utilities/getStoryPromoInfo/index.jsx @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import makeRelativeUrlPath from '../makeRelativeUrlPath'; export const getAssetTypeCode = pathOr(null, ['assetTypeCode']); diff --git a/src/app/lib/utilities/logging/pathWithLogging/index.js b/src/app/lib/utilities/logging/pathWithLogging/index.js index 3ca555591dc..0f5665861ae 100644 --- a/src/app/lib/utilities/logging/pathWithLogging/index.js +++ b/src/app/lib/utilities/logging/pathWithLogging/index.js @@ -1,6 +1,4 @@ -import isNil from 'ramda/src/isNil'; -import path from 'ramda/src/path'; -import curry from 'ramda/src/curry'; +import { path, isNil, curry } from 'rambda'; import nodeLogger from '#lib/logger.node'; const logger = nodeLogger(__filename); diff --git a/src/app/lib/utilities/parseAssetData/index.test.ts b/src/app/lib/utilities/parseAssetData/index.test.ts index 01de070d549..ce7e4840f34 100644 --- a/src/app/lib/utilities/parseAssetData/index.test.ts +++ b/src/app/lib/utilities/parseAssetData/index.test.ts @@ -1,4 +1,4 @@ -import mergeDeepLeft from 'ramda/src/mergeDeepLeft'; +import { mergeDeepLeft } from 'rambda'; import { articleDataNews } from '#pages/ArticlePage/fixtureData'; import { getHeadline, diff --git a/src/app/lib/utilities/passport/index.js b/src/app/lib/utilities/passport/index.js index be0b7a1204e..b64eb88a82d 100644 --- a/src/app/lib/utilities/passport/index.js +++ b/src/app/lib/utilities/passport/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; export const getPassportHome = pageData => { const homeServiceUrl = pathOr( diff --git a/src/app/pages/ArticlePage/index.test.tsx b/src/app/pages/ArticlePage/index.test.tsx index 96499af100d..1c00e83c5c1 100644 --- a/src/app/pages/ArticlePage/index.test.tsx +++ b/src/app/pages/ArticlePage/index.test.tsx @@ -1,7 +1,7 @@ import React, { PropsWithChildren } from 'react'; import { Helmet } from 'react-helmet'; import { BrowserRouter } from 'react-router-dom'; -import mergeDeepLeft from 'ramda/src/mergeDeepLeft'; +import { mergeDeepLeft } from 'rambda'; import { RequestContextProvider } from '#contexts/RequestContext'; import { ToggleContextProvider } from '#contexts/ToggleContext'; import { diff --git a/src/app/pages/ErrorPage/index.jsx b/src/app/pages/ErrorPage/index.jsx index 57aa4fb9fde..e16a1fa91ef 100644 --- a/src/app/pages/ErrorPage/index.jsx +++ b/src/app/pages/ErrorPage/index.jsx @@ -1,4 +1,4 @@ -import pipe from 'ramda/src/pipe'; +import { pipe } from 'rambda'; import withContexts from '#containers/PageHandlers/withContexts'; import withPageWrapper from '#containers/PageHandlers/withPageWrapper'; import ErrorPage from './ErrorPage'; diff --git a/src/app/pages/FeatureIdxPage/FeatureIdxPage.jsx b/src/app/pages/FeatureIdxPage/FeatureIdxPage.jsx index 88b58087841..ab769f94641 100644 --- a/src/app/pages/FeatureIdxPage/FeatureIdxPage.jsx +++ b/src/app/pages/FeatureIdxPage/FeatureIdxPage.jsx @@ -1,6 +1,6 @@ import React, { useContext, Fragment } from 'react'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import IndexHeading from '#containers/IndexHeading'; import IndexPageContainer from '#components/PageLayout/IndexPageContainer'; import IndexPageSection from '#containers/IndexPageSection'; diff --git a/src/app/pages/FrontPage/FrontPage.jsx b/src/app/pages/FrontPage/FrontPage.jsx index 7c19db5e7d7..07554b727f0 100644 --- a/src/app/pages/FrontPage/FrontPage.jsx +++ b/src/app/pages/FrontPage/FrontPage.jsx @@ -1,6 +1,5 @@ import React, { Fragment, useContext } from 'react'; -import path from 'ramda/src/path'; -import findIndex from 'ramda/src/findIndex'; +import { path, findIndex } from 'rambda'; import styled from '@emotion/styled'; import { GEL_GROUP_4_SCREEN_WIDTH_MIN } from '#psammead/gel-foundations/src/breakpoints'; import ComscoreAnalytics from '#containers/ComscoreAnalytics'; diff --git a/src/app/pages/OnDemandAudioPage/OnDemandAudioPage.tsx b/src/app/pages/OnDemandAudioPage/OnDemandAudioPage.tsx index 76a7077aa82..020c14f0b88 100644 --- a/src/app/pages/OnDemandAudioPage/OnDemandAudioPage.tsx +++ b/src/app/pages/OnDemandAudioPage/OnDemandAudioPage.tsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; -import path from 'ramda/src/path'; -import is from 'ramda/src/is'; +import { path } from 'rambda'; +import { is } from 'rambda'; import ComscoreAnalytics from '#containers/ComscoreAnalytics'; import Grid, { GelPageGrid } from '#components/Grid'; import StyledRadioHeadingContainer from '#containers/OnDemandHeading/StyledRadioHeadingContainer'; diff --git a/src/app/pages/OnDemandAudioPage/index.test.tsx b/src/app/pages/OnDemandAudioPage/index.test.tsx index 8910e6c2ba8..07574aa748d 100644 --- a/src/app/pages/OnDemandAudioPage/index.test.tsx +++ b/src/app/pages/OnDemandAudioPage/index.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import assocPath from 'ramda/src/assocPath'; +import { assocPath } from 'rambda'; import pashtoPageData from '#data/pashto/bbc_pashto_radio/w3ct0lz1.json'; import koreanPageData from '#data/korean/bbc_korean_radio/w3ct0kn5.json'; import zhongwenPageData from '#data/zhongwen/bbc_cantonese_radio/w172xf3r5x8hw4v.json'; diff --git a/src/app/pages/OnDemandAudioPage/index.tsx b/src/app/pages/OnDemandAudioPage/index.tsx index 5ac2aeea6da..cb3d4e2db33 100644 --- a/src/app/pages/OnDemandAudioPage/index.tsx +++ b/src/app/pages/OnDemandAudioPage/index.tsx @@ -1,4 +1,4 @@ -import pipe from 'ramda/src/pipe'; +import { pipe } from 'rambda'; import withMediaError from '#lib/utilities/episodeAvailability/withMediaError'; import OnDemandAudioPage from './OnDemandAudioPage'; import applyBasicPageHandlers from '../utils/applyBasicPageHandlers'; diff --git a/src/app/pages/OnDemandTvPage/index.test.tsx b/src/app/pages/OnDemandTvPage/index.test.tsx index 862173d0286..67f1c414ede 100644 --- a/src/app/pages/OnDemandTvPage/index.test.tsx +++ b/src/app/pages/OnDemandTvPage/index.test.tsx @@ -1,6 +1,6 @@ import { FetchMock } from 'jest-fetch-mock'; import React from 'react'; -import assocPath from 'ramda/src/assocPath'; +import { assocPath } from 'rambda'; import pashtoPageData from '#data/pashto/bbc_pashto_tv/tv_programmes/w13xttn4.json'; import * as analyticsUtils from '#lib/analyticsUtils'; import getInitialData from '#app/routes/onDemandTV/getInitialData'; diff --git a/src/app/pages/OnDemandTvPage/index.tsx b/src/app/pages/OnDemandTvPage/index.tsx index 5259639e8df..bc23de44c56 100644 --- a/src/app/pages/OnDemandTvPage/index.tsx +++ b/src/app/pages/OnDemandTvPage/index.tsx @@ -1,4 +1,4 @@ -import pipe from 'ramda/src/pipe'; +import { pipe } from 'rambda'; import withMediaError from '#lib/utilities/episodeAvailability/withMediaError'; import OnDemandTvPage from './OnDemandTvPage'; import applyBasicPageHandlers from '../utils/applyBasicPageHandlers'; diff --git a/src/app/pages/TopicPage/TopicPage.jsx b/src/app/pages/TopicPage/TopicPage.jsx index e38118d00ed..27b7319376a 100644 --- a/src/app/pages/TopicPage/TopicPage.jsx +++ b/src/app/pages/TopicPage/TopicPage.jsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import path from 'ramda/src/path'; +import { path } from 'rambda'; import Curation from '#app/components/Curation'; import AdContainer from '../../components/Ad'; import ATIAnalytics from '../../components/ATIAnalytics'; diff --git a/src/app/pages/utils/applyBasicPageHandlers.js b/src/app/pages/utils/applyBasicPageHandlers.js index c9a1f81bf67..e1e7bf4ba2c 100644 --- a/src/app/pages/utils/applyBasicPageHandlers.js +++ b/src/app/pages/utils/applyBasicPageHandlers.js @@ -1,4 +1,4 @@ -import pipe from 'ramda/src/pipe'; +import { pipe } from 'rambda'; import withContexts from '#containers/PageHandlers/withContexts'; import withPageWrapper from '#containers/PageHandlers/withPageWrapper'; import withError from '#containers/PageHandlers/withError'; diff --git a/src/app/routes/article/getInitialData/index.ts b/src/app/routes/article/getInitialData/index.ts index 8478f90690a..0258bfdcef1 100644 --- a/src/app/routes/article/getInitialData/index.ts +++ b/src/app/routes/article/getInitialData/index.ts @@ -1,4 +1,4 @@ -import pipe from 'ramda/src/pipe'; +import { pipe } from 'rambda'; import nodeLogger from '../../../lib/logger.node'; import { Services, Toggles, Variants } from '../../../models/types/global'; import getOnwardsPageData from '../utils/getOnwardsData'; diff --git a/src/app/routes/article/utils/addAnalyticsCounterName.test.ts b/src/app/routes/article/utils/addAnalyticsCounterName.test.ts index 20a324fd8a5..a1e35c8800b 100644 --- a/src/app/routes/article/utils/addAnalyticsCounterName.test.ts +++ b/src/app/routes/article/utils/addAnalyticsCounterName.test.ts @@ -1,4 +1,4 @@ -import assocPath from 'ramda/src/assocPath'; +import { assocPath } from 'rambda'; import { data as legacyFIXData } from '#data/urdu/cpsAssets/science-51314202.json'; import { Article } from '#app/models/types/optimo'; diff --git a/src/app/routes/article/utils/addAnalyticsCounterName.ts b/src/app/routes/article/utils/addAnalyticsCounterName.ts index f4f28c4c564..7c963918aa5 100644 --- a/src/app/routes/article/utils/addAnalyticsCounterName.ts +++ b/src/app/routes/article/utils/addAnalyticsCounterName.ts @@ -1,5 +1,4 @@ -import assocPath from 'ramda/src/assocPath'; -import hasPath from 'ramda/src/hasPath'; +import { assocPath, hasPath } from 'rambda'; import { Article } from '#app/models/types/optimo'; const hasCounterName = hasPath(['metadata', 'analyticsLabels', 'counterName']); diff --git a/src/app/routes/article/utils/augmentWithDisclaimer.ts b/src/app/routes/article/utils/augmentWithDisclaimer.ts index 984aac711c0..2db5d3acbb3 100644 --- a/src/app/routes/article/utils/augmentWithDisclaimer.ts +++ b/src/app/routes/article/utils/augmentWithDisclaimer.ts @@ -1,14 +1,11 @@ -import pathOr from 'ramda/src/pathOr'; -import pathEq from 'ramda/src/pathEq'; -import assocPath from 'ramda/src/assocPath'; -import insert from 'ramda/src/insert'; +import { pathOr, pathEq, assocPath, insert } from 'rambda'; import { Article, OptimoBlock } from '#app/models/types/optimo'; import { Toggles } from '#app/models/types/global'; import { isSfv } from './paramChecks'; const getBlocks = pathOr([], ['content', 'model', 'blocks']); const setBlocks = assocPath(['content', 'model', 'blocks']); -const isDisclaimerToggledOn = pathEq(true, ['disclaimer', 'enabled']); +const isDisclaimerToggledOn = pathEq(['disclaimer', 'enabled'], true); const disclaimerBlock = { type: 'disclaimer', model: {}, diff --git a/src/app/routes/article/utils/getOnwardsData.ts b/src/app/routes/article/utils/getOnwardsData.ts index 4624095ff07..41d1897378f 100644 --- a/src/app/routes/article/utils/getOnwardsData.ts +++ b/src/app/routes/article/utils/getOnwardsData.ts @@ -1,6 +1,5 @@ import { Agent } from 'https'; -import path from 'ramda/src/path'; -import isEmpty from 'ramda/src/isEmpty'; +import { path, isEmpty } from 'rambda'; import { DATA_FETCH_ERROR } from '#lib/logger.const'; import getRecommendationsUrl from '#app/lib/utilities/getUrlHelpers/getRecommendationsUrl'; diff --git a/src/app/routes/frontPage/getInitialData/index.js b/src/app/routes/frontPage/getInitialData/index.js index c1dc7238802..3c0d3cc109e 100644 --- a/src/app/routes/frontPage/getInitialData/index.js +++ b/src/app/routes/frontPage/getInitialData/index.js @@ -1,5 +1,5 @@ -import pipe from 'ramda/src/pipe'; -import path from 'ramda/src/path'; +import { pipe } from 'rambda'; +import { path } from 'rambda'; import withRadioSchedule from '#app/routes/utils/withRadioSchedule'; import filterUnknownContentTypes from '#app/routes/utils/sharedDataTransformers/filterUnknownContentTypes'; import filterEmptyGroupItems from '#app/routes/utils/sharedDataTransformers/filterEmptyGroupItems'; diff --git a/src/app/routes/liveRadio/getInitialData/index.js b/src/app/routes/liveRadio/getInitialData/index.js index 17cff2be224..600acfe32b9 100644 --- a/src/app/routes/liveRadio/getInitialData/index.js +++ b/src/app/routes/liveRadio/getInitialData/index.js @@ -1,4 +1,4 @@ -import path from 'ramda/src/path'; +import { path } from 'rambda'; import withRadioSchedule from '#app/routes/utils/withRadioSchedule'; import fetchPageData from '../../utils/fetchPageData'; import overrideRendererOnTest from '../../utils/overrideRendererOnTest'; diff --git a/src/app/routes/onDemandAudio/getInitialData/index.test.ts b/src/app/routes/onDemandAudio/getInitialData/index.test.ts index 0285d500ce1..77944b92d54 100644 --- a/src/app/routes/onDemandAudio/getInitialData/index.test.ts +++ b/src/app/routes/onDemandAudio/getInitialData/index.test.ts @@ -1,5 +1,4 @@ -import mergeDeepLeft from 'ramda/src/mergeDeepLeft'; -import dissocPath from 'ramda/src/dissocPath'; +import { mergeDeepLeft, dissocPath } from 'rambda'; import loggerMock from '#testHelpers/loggerMock'; import onDemandRadioJson from '#data/pashto/bbc_pashto_radio/w3ct0lz1.json'; import podcastJson from '#data/arabic/podcasts/p02pc9qc/p08wtg4d.json'; diff --git a/src/app/routes/onDemandAudio/getInitialData/index.ts b/src/app/routes/onDemandAudio/getInitialData/index.ts index 0abc3bff5ed..610abbac0a4 100644 --- a/src/app/routes/onDemandAudio/getInitialData/index.ts +++ b/src/app/routes/onDemandAudio/getInitialData/index.ts @@ -1,5 +1,5 @@ -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import { RADIO_MISSING_FIELD, PODCAST_MISSING_FIELD } from '#lib/logger.const'; import getEpisodeAvailability, { getUrl, diff --git a/src/app/routes/onDemandAudio/tempData/podcastExternalLinks/index.js b/src/app/routes/onDemandAudio/tempData/podcastExternalLinks/index.js index 5f9a4d9e187..101294c0962 100644 --- a/src/app/routes/onDemandAudio/tempData/podcastExternalLinks/index.js +++ b/src/app/routes/onDemandAudio/tempData/podcastExternalLinks/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import nodeLogger from '#lib/logger.node'; import { PODCAST_SERVICE_MISSING } from '#lib/logger.const'; diff --git a/src/app/routes/onDemandTV/getInitialData/index.js b/src/app/routes/onDemandTV/getInitialData/index.js index 6b85c4c13f2..7851761a215 100644 --- a/src/app/routes/onDemandTV/getInitialData/index.js +++ b/src/app/routes/onDemandTV/getInitialData/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; import pathWithLogging, { LOG_LEVELS, } from '#lib/utilities/logging/pathWithLogging'; diff --git a/src/app/routes/onDemandTV/getInitialData/index.test.js b/src/app/routes/onDemandTV/getInitialData/index.test.js index 438a9ded7bd..c148c35b017 100644 --- a/src/app/routes/onDemandTV/getInitialData/index.test.js +++ b/src/app/routes/onDemandTV/getInitialData/index.test.js @@ -1,6 +1,4 @@ -import pipe from 'ramda/src/pipe'; -import dissocPath from 'ramda/src/dissocPath'; -import map from 'ramda/src/map'; +import { pipe, dissocPath, map } from 'rambda'; import loggerMock from '#testHelpers/loggerMock'; import onDemandTvJson from '#data/pashto/bbc_pashto_tv/tv_programmes/w13xttn4'; import { TV_MISSING_FIELD } from '#lib/logger.const'; diff --git a/src/app/routes/topic/getInitialData/index.test.js b/src/app/routes/topic/getInitialData/index.test.js index d8ce73e9de2..393070b4fed 100644 --- a/src/app/routes/topic/getInitialData/index.test.js +++ b/src/app/routes/topic/getInitialData/index.test.js @@ -1,4 +1,4 @@ -import assocPath from 'ramda/src/assocPath'; +import { assocPath } from 'rambda'; import * as fetchPageData from '../../utils/fetchPageData'; import getInitialData from '.'; import { TOPIC_PAGE } from '../../utils/pageTypes'; diff --git a/src/app/routes/utils/constructPageFetchUrl/index.ts b/src/app/routes/utils/constructPageFetchUrl/index.ts index 32c493f424c..7b965dc3534 100644 --- a/src/app/routes/utils/constructPageFetchUrl/index.ts +++ b/src/app/routes/utils/constructPageFetchUrl/index.ts @@ -1,5 +1,5 @@ import Url from 'url-parse'; -import pipe from 'ramda/src/pipe'; +import { pipe } from 'rambda'; import getEnvironment from '#app/routes/utils/getEnvironment'; import { getMostReadEndpoint } from '#app/lib/utilities/getUrlHelpers/getMostReadUrls'; import { getUrlPath } from '#lib/utilities/urlParser'; diff --git a/src/app/routes/utils/fetchPageData/utils/getRouteProps/index.js b/src/app/routes/utils/fetchPageData/utils/getRouteProps/index.js index 8ae0265e27a..7b66cffe07b 100644 --- a/src/app/routes/utils/fetchPageData/utils/getRouteProps/index.js +++ b/src/app/routes/utils/fetchPageData/utils/getRouteProps/index.js @@ -1,6 +1,6 @@ import { matchRoutes } from 'react-router-config'; -import path from 'ramda/src/path'; -import pathOr from 'ramda/src/pathOr'; +import { path } from 'rambda'; +import { pathOr } from 'rambda'; import { variantSanitiser } from '#lib/utilities/variantHandler'; import isAmpPath from '#app/routes/utils/isAmpPath'; import isAppPath from '#app/routes/utils/isAppPath'; diff --git a/src/app/routes/utils/getConfig/index.js b/src/app/routes/utils/getConfig/index.js index 01111e72b0e..f7da1690f2b 100644 --- a/src/app/routes/utils/getConfig/index.js +++ b/src/app/routes/utils/getConfig/index.js @@ -1,4 +1,4 @@ -import path from 'ramda/src/path'; +import { path } from 'rambda'; import nodeLogger from '#lib/logger.node'; const logger = nodeLogger(__filename); diff --git a/src/app/routes/utils/getPlaceholderImageUrl/index.js b/src/app/routes/utils/getPlaceholderImageUrl/index.js index 28e5013730f..bae84c85851 100644 --- a/src/app/routes/utils/getPlaceholderImageUrl/index.js +++ b/src/app/routes/utils/getPlaceholderImageUrl/index.js @@ -1,4 +1,4 @@ -import is from 'ramda/src/is'; +import { is } from 'rambda'; import { getEnvConfig } from '#app/lib/utilities/getEnvConfig'; export const FALLBACK_PLACEHOLDER_IMAGE_URL = `${ diff --git a/src/app/routes/utils/processRecentEpisodes/index.jsx b/src/app/routes/utils/processRecentEpisodes/index.jsx index 3eea38ba9e1..6e2c329be57 100644 --- a/src/app/routes/utils/processRecentEpisodes/index.jsx +++ b/src/app/routes/utils/processRecentEpisodes/index.jsx @@ -1,5 +1,5 @@ -import path from 'ramda/src/path'; -import is from 'ramda/src/is'; +import { path } from 'rambda'; +import { is } from 'rambda'; const validateEpisode = episode => { try { diff --git a/src/app/routes/utils/processRecentEpisodes/index.test.jsx b/src/app/routes/utils/processRecentEpisodes/index.test.jsx index 84cda0ebd3c..e4c060d8181 100644 --- a/src/app/routes/utils/processRecentEpisodes/index.test.jsx +++ b/src/app/routes/utils/processRecentEpisodes/index.test.jsx @@ -1,4 +1,4 @@ -import assocPath from 'ramda/src/assocPath'; +import { assocPath } from 'rambda'; import videoPageData from '#data/afrique/bbc_afrique_tv/tv_programmes/w13xttmz.json'; import audioPageData from '#data/indonesia/bbc_indonesian_radio/w13xtt0s.json'; import processRecentEpisodes from '.'; diff --git a/src/app/routes/utils/sharedDataTransformers/addIdsToGroups/index.js b/src/app/routes/utils/sharedDataTransformers/addIdsToGroups/index.js index 44244bdbc08..7d68459d911 100644 --- a/src/app/routes/utils/sharedDataTransformers/addIdsToGroups/index.js +++ b/src/app/routes/utils/sharedDataTransformers/addIdsToGroups/index.js @@ -1,5 +1,4 @@ -import path from 'ramda/src/path'; -import mergeDeepLeft from 'ramda/src/mergeDeepLeft'; +import { path, mergeDeepLeft } from 'rambda'; import addIdsToItems from '../addIdsToItems'; diff --git a/src/app/routes/utils/sharedDataTransformers/addIdsToItems/index.js b/src/app/routes/utils/sharedDataTransformers/addIdsToItems/index.js index 67edaa00636..160cda2e90d 100644 --- a/src/app/routes/utils/sharedDataTransformers/addIdsToItems/index.js +++ b/src/app/routes/utils/sharedDataTransformers/addIdsToItems/index.js @@ -1,7 +1,5 @@ import { v4 as uuid } from 'uuid'; -import lensPath from 'ramda/src/lensPath'; -import view from 'ramda/src/view'; -import set from 'ramda/src/set'; +import { lensPath, view, set } from 'rambda'; const addIdsToItem = ({ lens, customKeyName, recursive }) => diff --git a/src/app/routes/utils/sharedDataTransformers/filterEmptyGroupItems/index.js b/src/app/routes/utils/sharedDataTransformers/filterEmptyGroupItems/index.js index 917d6a49698..958f4eb4176 100644 --- a/src/app/routes/utils/sharedDataTransformers/filterEmptyGroupItems/index.js +++ b/src/app/routes/utils/sharedDataTransformers/filterEmptyGroupItems/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; const filterEmptyGroupItems = jsonRaw => { const json = jsonRaw; diff --git a/src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.js b/src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.js index c4c2374fbf2..c4797cfd33e 100644 --- a/src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.js +++ b/src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; const filterGroupsWithoutStraplines = data => { const groups = pathOr(null, ['content', 'groups'], data); diff --git a/src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.js b/src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.js index e03e16d9305..e24f87ada86 100644 --- a/src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.js +++ b/src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; const whitelist = ['STY', 'MAP', 'PGL', 'LIV', 'PRO']; const contentTypes = [ diff --git a/src/app/routes/utils/sharedDataTransformers/squashTopStories/index.js b/src/app/routes/utils/sharedDataTransformers/squashTopStories/index.js index ba7c68e1640..13134475753 100644 --- a/src/app/routes/utils/sharedDataTransformers/squashTopStories/index.js +++ b/src/app/routes/utils/sharedDataTransformers/squashTopStories/index.js @@ -1,4 +1,4 @@ -import pathOr from 'ramda/src/pathOr'; +import { pathOr } from 'rambda'; const squashKeys = [ 'responsive-top-stories', diff --git a/src/server/index.jsx b/src/server/index.jsx index 167af5e38eb..6e46516e3d2 100644 --- a/src/server/index.jsx +++ b/src/server/index.jsx @@ -1,8 +1,7 @@ /* eslint-disable camelcase */ import express from 'express'; import compression from 'compression'; -import ramdaPath from 'ramda/src/path'; -import omit from 'ramda/src/omit'; +import { path as rambdaPath, omit } from 'rambda'; // not part of react-helmet import helmet from 'helmet'; import routes from '#app/routes'; @@ -246,7 +245,7 @@ server.get( let { status } = data; // Set derivedPageType based on returned page data if (status === OK) { - derivedPageType = ramdaPath(['pageData', 'metadata', 'type'], data); + derivedPageType = rambdaPath(['pageData', 'metadata', 'type'], data); mvtExperiments = getMvtExperiments(headers, service, derivedPageType); data.mvtExperiments = mvtExperiments; diff --git a/yarn.lock b/yarn.lock index 6b628fba4c7..035d99a6439 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14756,6 +14756,13 @@ __metadata: languageName: node linkType: hard +"rambda@npm:^9.3.0": + version: 9.3.0 + resolution: "rambda@npm:9.3.0" + checksum: 10/e4e17aa2dee6fb0e0239c4963f9c42120ba3ceb8243c5a736a1b2d9ebc07f7ee1bd2476050b20f5c21bd2968f059e08a7626498b7cce8e7258996c786779717d + languageName: node + linkType: hard + "ramda@npm:0.30.1": version: 0.30.1 resolution: "ramda@npm:0.30.1" @@ -16035,6 +16042,7 @@ __metadata: path-to-regexp: "npm:6.3.0" polyfill-crypto.getrandomvalues: "npm:1.0.0" prettier: "npm:3.2.5" + rambda: "npm:^9.3.0" ramda: "npm:0.30.1" react: "npm:18.3.1" react-dom: "npm:18.3.1"