Tabnine Logo For Javascript
ObjectChain.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
function
in
ObjectChain

Best JavaScript code snippets using lodash.ObjectChain.get(Showing top 15 results out of 315)

origin: morphy2k/broadcast-notification-system

constructor() {

  this.secret = db.settings.get('auth.secret').value();
  if (!this.secret) {
   this.secret = crypto.randomBytes(24).toString('hex');
   db.settings.get('auth').set('secret', this.secret).write();
  }

 }
origin: morphy2k/broadcast-notification-system

notifications() {

  this.durations.notification = db.settings.get('notification.duration').value();

  notification.check();
  setTimeout(() => this.notifications(), this.durations.notification);

 }
origin: morphy2k/broadcast-notification-system

get(type, category) {
  const queue = db.queue.get(`${category}.list`);

  if (queue.size().value()) {

   let element = queue.first().value(),
    obj = Object.assign({
     type
    }, element);

   this.queue.push(obj);
   queue.remove(element).write();

  }
 }
origin: morphy2k/broadcast-notification-system

cleanupBlacklist() {

  let time = new Date(),
   cleared = new Date(db.blacklist.get('cleared').value());

  cleared.setHours(cleared.getHours() + 1);

  if (time > cleared || cleared === 'Invalid Date') {
   db.blacklist.get('list').remove().write();
   db.blacklist.assign({
    cleared: new Date()
   }).write();
  }

 }
origin: morphy2k/broadcast-notification-system

cleanupQueue() {
  db.queue.get('follows.list').remove().write();
  db.queue.get('subscription.list').remove().write();
  db.queue.get('hosts.list').remove().write();
  db.queue.get('donations.list').remove().write();
  this.queue.length = 0;
 }
origin: morphy2k/broadcast-notification-system

get data() {
  return {
   feed: {
    list: db.stats.get('feed.list').value()
   },
   charts: {
    follows: db.stats.get('follows').value(),
    subscriptions: db.stats.get('subscriptions').value(),
    donations: db.stats.get('donations').value()
   }
  };

 }
origin: morphy2k/broadcast-notification-system

constructor() {

  this.email = db.settings.get('auth.email').value();

  if (process.env.NODE_ENV === 'development') {
   this.transporter = nodemailer.createTransport({
    jsonTransport: true
   });
  } else {
   this.transporter = nodemailer.createTransport(config.authentication.mail);
  }

 }
origin: morphy2k/broadcast-notification-system

constructor() {
  this.selected = db.settings.get('notification.template.selected').value();
  this.targetPath = path.resolve('./views/template');

  try {
   this.search();
   this.set(this.selected);
  } catch (e) {
   console.error(new Error(e));
  }

 }
origin: morphy2k/broadcast-notification-system

async api(name) {

  await stats.set();

  const enabled = db.settings.get(`api.${name}.enabled`).value();

  if (enabled) {
   await api[name].check();
   setTimeout(() => this.api(name), this.durations[name]);
  }

 }
origin: morphy2k/broadcast-notification-system

constructor(userId) {
  this.uri = `https://tmi.twitch.tv/hosts?include_logins=1&target=${userId}`;
  this.last = db.queue.get('hosts.last').value();
 }
origin: morphy2k/broadcast-notification-system

ifExpired() {

  const expDate = db.settings.get('auth.expiration_date').value() - 24 * 60 * 60,
   date = Math.floor(Date.now() / 1000);

  if (mail.address && (!expDate || date > expDate)) {
   console.info('JWT has been expired! A new token will be signed.');
   this.signToken();
  }

 }
origin: morphy2k/broadcast-notification-system

async get(type) {
  let data;

  if (db.settings.get(`notification.types.${type}`).value()) {

   try {
    data = await this[type].check();
   } catch (e) {
    console.error(new Error(e));
    return null;
   }
  } else {
   return null;
  }

  return data;
 }
origin: morphy2k/broadcast-notification-system

constructor() {
  if (db.settings.get('api.twitch.auth.token').value() &&
   !this.token) this.init();
 }
origin: morphy2k/broadcast-notification-system

send(data) {
  const enabled = db.settings.get('notification.enabled').value();
  if (enabled) io.sockets.emit('notification', data);
 }
origin: morphy2k/broadcast-notification-system

async get(type) {
  let data;

  if (db.settings.get(`notification.types.${type}`).value()) {
   try {
    data = await this[type].check();
   } catch (e) {
    console.error(new Error(e));
    return null;
   }
  } else {
   return null;
  }

  return data;
 }
lodash(npm)ObjectChainget

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • aws-sdk
    AWS SDK for JavaScript
  • mocha
    simple, flexible, fun test framework
  • axios
    Promise based HTTP client for the browser and node.js
  • winston
    A logger for just about everything.
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • debug
    small debugging utility
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now