npm-check-extras
Version:
CLI app to check for outdated and unused dependencies, and run update/delete action over selected ones
14 lines (13 loc) • 578 B
JavaScript
import * as R from 'ramda';
import { action } from 'nanostores';
import { $selectedOptionsIndexes } from '../store/options.js';
import { $availableActions } from '../store.js';
export const addToSelected = action($selectedOptionsIndexes, 'addToSelected', (store, index) => {
if (!R.includes(index, store.get())) {
$selectedOptionsIndexes.set(R.append(index, store.get()));
}
return store.get();
});
export const isSelected = action($availableActions, 'isSelected', (store, option) => {
return R.any(R.pathEq(option, ['value', 'name']))(store.get());
});