How to use the vuetify/es5/util/helpers.getObjectValueByPath function in vuetify

To help you get started, we’ve selected a few vuetify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuetifyjs / vuetify / packages / vuetifyjs.com / src / translation / router.js View on Github external
// Get git logs for both source and locale
  const localeLog = await getLog(localePath)
  const sourceLog = await getLog(sourcePath)

  // If file is not commited, there's not much we can do
  if (localeLog.total === 0) return 'unchanged'

  // If file is newer than latest commit
  // and value is changed then it's new
  const { mtime } = await fs.stat(localePath)
  const modifiedDate = new Date(mtime)
  const commitDate = new Date(localeLog.latest.date)
  if (modifiedDate > commitDate) {
    const commitJson = await getJsonContent(localePath, localeLog.latest.hash)
    if (helpers.getObjectValueByPath(commitJson, fileKey) !== helpers.getObjectValueByPath(localeJson, fileKey)) return 'new'
  }

  const latestSourceCommitDate = new Date(sourceLog.latest.date)
  const latestLocaleCommitDate = new Date(localeLog.latest.date)

  // If source has been updated after latest locale
  // then we might have a mismatch
  if (latestSourceCommitDate > latestLocaleCommitDate) {
    const previousCommit = getPreviousCommit(sourceLog, localeLog.latest)

    if (!previousCommit) throw new Error('asdasdas')

    const oldJson = await getJsonContent(sourcePath, previousCommit.hash)
    const newJson = await getJsonContent(sourcePath, sourceLog.latest.hash)

    const changes = diffJson.diff(oldJson, newJson)
github vuetifyjs / vuetify / packages / vuetifyjs.com / src / translation / router.js View on Github external
async function checkStatus (locale, key) {
  const { sourcePath, localePath, fileKey } = getPaths(locale, key)

  setupCache(sourcePath)
  setupCache(localePath)

  // If no file exists yet
  // translation is missing
  if (!fs.existsSync(localePath)) return 'missing'

  // If file exists but no key found
  // then we are missing translation
  const localeJson = await fs.readJson(localePath)
  if (!helpers.getObjectValueByPath(localeJson, fileKey)) return 'missing'

  // Get git logs for both source and locale
  const localeLog = await getLog(localePath)
  const sourceLog = await getLog(sourcePath)

  // If file is not commited, there's not much we can do
  if (localeLog.total === 0) return 'unchanged'

  // If file is newer than latest commit
  // and value is changed then it's new
  const { mtime } = await fs.stat(localePath)
  const modifiedDate = new Date(mtime)
  const commitDate = new Date(localeLog.latest.date)
  if (modifiedDate > commitDate) {
    const commitJson = await getJsonContent(localePath, localeLog.latest.hash)
    if (helpers.getObjectValueByPath(commitJson, fileKey) !== helpers.getObjectValueByPath(localeJson, fileKey)) return 'new'
github vuetifyjs / vuetify / packages / vuetifyjs.com / src / components / core / TableOfContents.vue View on Github external
items () {
        const [ section, name ] = this.name.split('/')
        const kebab = upperFirst(camelCase(section))

        return getObjectValueByPath(
          this.tablesOfContents,
          `${kebab}.${name}`,
          []
        ).map(item => ({
          ...item,
          offsetTop: 0,
          target: null
        }))
      }
    },
github vuetifyjs / vuetify / packages / vuetifyjs.com / src / components / doc / Parameters.vue View on Github external
for (let i = 0; i < keys.length; i++) {
            const key = keys[i]
            const fn = this[`gen${capitalize(key)}`]

            if (fn) {
              newItem[key] = fn(newItem[key], item)
            }
          }

          newItem.description = this.genDescription(item.name || item, item)
          newItem.newIn = getObjectValueByPath(
            this.newIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          newItem.deprecatedIn = getObjectValueByPath(
            this.deprecatedIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          if (newItem.deprecatedIn === false) continue

          if (!newItem.newIn && newItem.source) {
            newItem.newIn = getObjectValueByPath(
              this.newIn,
              `${this.type}.${newItem.source}.${newItem.name}`
            )
          }

          if (!newItem.deprecatedIn && newItem.source) {
            newItem.deprecatedIn = getObjectValueByPath(
              this.deprecatedIn,
github vuetifyjs / vuetify / packages / docs / src / components / doc / Parameters.vue View on Github external
newItem.description = this.genDescription(item.name || item, item)
          newItem.newIn = getObjectValueByPath(
            this.newIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          newItem.deprecatedIn = getObjectValueByPath(
            this.deprecatedIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          if (newItem.deprecatedIn === false) continue

          if (!newItem.newIn && newItem.source) {
            newItem.newIn = getObjectValueByPath(
              this.newIn,
              `${this.type}.${newItem.source}.${newItem.name}`
            )
          }

          if (!newItem.deprecatedIn && newItem.source) {
            newItem.deprecatedIn = getObjectValueByPath(
              this.deprecatedIn,
              `${this.type}.${newItem.source}.${newItem.name}`
            )
          }

          items[source].push(newItem)
        }

        return items
github vuetifyjs / vuetify / packages / vuetifyjs.com / src / components / doc / Parameters.vue View on Github external
const newItem = item !== Object(item)
            ? { name: item }
            : Object.assign({}, item)

          const keys = Object.keys(newItem)
          for (let i = 0; i < keys.length; i++) {
            const key = keys[i]
            const fn = this[`gen${capitalize(key)}`]

            if (fn) {
              newItem[key] = fn(newItem[key], item)
            }
          }

          newItem.description = this.genDescription(item.name || item, item)
          newItem.newIn = getObjectValueByPath(
            this.newIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          newItem.deprecatedIn = getObjectValueByPath(
            this.deprecatedIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          if (newItem.deprecatedIn === false) continue

          if (!newItem.newIn && newItem.source) {
            newItem.newIn = getObjectValueByPath(
              this.newIn,
              `${this.type}.${newItem.source}.${newItem.name}`
            )
github vuetifyjs / vuetify / packages / docs / src / components / doc / Parameters.vue View on Github external
newItem.deprecatedIn = getObjectValueByPath(
            this.deprecatedIn,
            `${this.type}.${this.target}.${newItem.name}`
          )

          if (newItem.deprecatedIn === false) continue

          if (!newItem.newIn && newItem.source) {
            newItem.newIn = getObjectValueByPath(
              this.newIn,
              `${this.type}.${newItem.source}.${newItem.name}`
            )
          }

          if (!newItem.deprecatedIn && newItem.source) {
            newItem.deprecatedIn = getObjectValueByPath(
              this.deprecatedIn,
              `${this.type}.${newItem.source}.${newItem.name}`
            )
          }

          items[source].push(newItem)
        }

        return items
      },
      missingItems () {