New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@streamlayer/feature-gamification

Package Overview
Dependencies
Maintainers
14
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@streamlayer/feature-gamification - npm Package Compare versions

Comparing version 0.21.0 to 0.21.1

35

lib/detail.js
import { createMapStore } from '@streamlayer/sdk-web-interfaces';
import { deepmerge } from '@fastify/deepmerge';
import { computed } from 'nanostores';
import { getQuestionByUser } from './queries';
const mergeArray = (options) => (target, source) => {
let i = 0;
const tl = target.length;
const sl = source.length;
const il = Math.max(tl, sl);
const result = new Array(il);
for (i = 0; i < il; ++i) {
if (i < sl) {
result[i] = options.deepmerge(target[i], source[i]);
}
else {
result[i] = options.clone(target[i]);
}
}
return result;
};
const mergeQuestion = deepmerge({ mergeArray });
export const detail = (transport, $openedQuestionId, $feedList) => {

@@ -30,5 +48,20 @@ const $store = computed([$openedQuestionId, $feedList], (openedQuestion, feedList) => {

const updateExtendedQuestion = (question) => {
$extendedStore.set({ data: question });
const currentQuestion = $extendedStore.get().data;
if (currentQuestion) {
/**
* We do not merge youVoted property, because it
* can be overwritten by the subscription response,
* which does not include user-specific data.
*/
for (const answer of question?.answers || []) {
if (answer.youVoted !== true) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete answer.youVoted;
}
}
}
$extendedStore.set({ data: mergeQuestion(currentQuestion, question) });
};
return { $store, $extendedStore, updateExtendedQuestion };
};

15

package.json
{
"name": "@streamlayer/feature-gamification",
"version": "0.21.0",
"version": "0.21.1",
"peerDependencies": {
"@bufbuild/protobuf": "^1.4.2",
"@streamlayer/sl-eslib": "^5.53.5",
"@fastify/deepmerge": "*",
"nanostores": "^0.9.5",
"@streamlayer/sdk-web-interfaces": "^0.18.10",
"@streamlayer/sdk-web-core": "^0.17.3",
"@streamlayer/sdk-web-api": "^0.0.1",
"@streamlayer/sdk-web-types": "^0.18.0",
"@streamlayer/sdk-web-storage": "^0.3.10",
"@streamlayer/sdk-web-notifications": "^0.10.9",
"@streamlayer/sdk-web-logger": "^0.5.10"
"@streamlayer/sdk-web-core": "^0.17.4",
"@streamlayer/sdk-web-interfaces": "^0.18.11",
"@streamlayer/sdk-web-logger": "^0.0.1",
"@streamlayer/sdk-web-notifications": "^0.10.10",
"@streamlayer/sdk-web-storage": "^0.0.1",
"@streamlayer/sdk-web-types": "^0.18.1"
},

@@ -16,0 +17,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc