Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/Schoolmouv-team/vuex-awesome-async
npm i @schoolmouv/vuex-awesome-async
Dans le main.js:
import VueState from '@schoolmouv/vuex-awesome-async';
Vue.use(VueState);
import Vue from 'vue';
import { wrapStore } from '@schoolmouv/vuex-awesome-async';
const { wrapMutations, wrapActions, wrapGetters, wrapState } = wrapStore(
'store',
);
const state = wrapState({});
const getters = wrapGetters({});
const actions = wrapActions({});
const mutations = wrapMutations({});
export default {
state,
getters,
actions,
mutations,
};
<template>
<div class="loader" :class="{ 'is-loading': isLoading }">
<slot :name="slotName">
<div class="loading">
<div class="icon-spinner3" v-if="isLoading"></div>
</div>
<div class="error" v-if="hasError">{{ errorMessage }}</div>
</slot>
</div>
</template>
<script>
export default {
name: 'Loader',
props: {
store: {
type: [Array, String],
default: () => [],
},
errorMessage: {
type: String,
default: '',
},
},
computed: {
slotName() {
if (this.isLoading) return 'loading';
if (this.hasError) return 'error';
return 'default';
},
storeArray() {
return Array.isArray(this.store) ? this.store : [this.store];
},
isLoading() {
if (this.$isServer) return false;
return this.storeArray.reduce((loading, store) => {
return loading || this.isStoreLoading(store);
}, false);
},
hasError() {
return (
this.storeArray.reduce((loading, store) => {
return loading || this.storeHasError(store);
}, false)
);
},
},
};
</script>
<Loader :store="['store1', 'store2']">
<div>
Async content to display
</div>
<div slot="error">
An error occurred
</div>
<div slot="loading">
Display custom logger
</div>
</Loader>
PluginOptions
wrapStore
wrapState
wrapGetters
wrapActions
wrapMutations
Mixin
Loader
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.