Download wp-calypso/client/my-sites/comments/comment/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 583 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/comments/comment/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/comments/comment/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/comments/comment/utils.js
583 Bytes
| import { get } from 'lodash'; | |
| /** | |
| * Create a stripped down comment object containing only the bare minimum fields needed by CommentList's actions. | |
| * @param {Object} comment A comment object. | |
| * @returns {Object} A stripped down comment object. | |
| */ | |
| export const getMinimumComment = ( comment ) => ( { | |
| commentId: get( comment, 'ID' ), | |
| isLiked: get( comment, 'i_like' ), | |
| postId: get( comment, 'post.ID' ), | |
| status: get( comment, 'status' ), | |
| can_moderate: get( comment, 'can_moderate' ), | |
| } ); | |
| export function hasBlocks( comment = '' ) { | |
| return comment.includes( '<!-- wp:' ); | |
| } | |