How to use data - 10 common examples

To help you get started, we’ve selected a few data 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 xivanalysis / xivanalysis / src / parser / jobs / nin / modules / TrickAttackUsage.js View on Github external
_onCast(event) {
		const action = getDataBy(ACTIONS, 'id', event.ability.guid)
		if (action && action.onGcd && !(
			action.id === ACTIONS.TEN.id || action.id === ACTIONS.TEN_KASSATSU.id || action.id === ACTIONS.CHI.id || action.id === ACTIONS.JIN.id)) {
			// Don't count the individual mudras as GCDs for this - they'll make the count screw if Suiton wasn't set up pre-pull
			this._gcdCount++
		}
	}
github xivanalysis / xivanalysis / src / parser / jobs / mch / modules / Ammo.js View on Github external
_onCast(event) {
		this._ammoSpent = false // Reset the flag on every cast

		const action = getDataBy(ACTIONS, 'id', event.ability.guid)
		if (action && action.onGcd) {
			if (this._ammoCount > 0) {
				this._ammoSpent = true // If it's a GCD and we have ammo, flag it as as a spender
				if (this._badAmmoUses.hasOwnProperty(action.id)) {
					this._badAmmoUses[action.id]++
				}

				this._ammoCount--
			}
		}
	}
github xivanalysis / xivanalysis / src / parser / jobs / smn / modules / Demis.js View on Github external
_onPlayerCast(event) {
		// Ignore autos
		const action = getDataBy(ACTIONS, 'id', event.ability.guid)
		if (!action || action.autoAttack) { return }

		// Track player actions during demi
		if (this.gauge.demiSummoned() &&
			(action.onGcd || PLAYER_DEMI_ACTIONS.includes(event.ability.guid))
		) {
			this._current.casts.push(event)
		}
	}
github futurize / future-io / lib / wrap-function.js View on Github external
function wrapper (/* arguments */) {
          try {
            const result = f.apply(null, arguments)
            if (isPromise(result)) {
              return new Task((reject, resolve) => result.then(resolve, reject))
            } else if (isTask(result)) {
              return result
            } else {
              return Task.of(result)
            }
          } catch (error) {
            return Task.rejected(error)
          }
        },
        Array.prototype.slice.call(arguments)
github philbot9 / youtube-comment-api / test / fetch-comments.js View on Github external
it('fetches a comment page without a pageToken', function () {
    var videoId = 'abc1234'
    var commentPage = { comment: 'page' }

    var fetchCommentsTask = td.replace('../lib/youtube-comments-task-wrapper')
    var fetchComments = require('../lib/fetch-comments')

    td.when(fetchCommentsTask(videoId), { ignoreExtraArgs: true })
      .thenReturn(Task.of(commentPage))

    return fetchComments(videoId)
      .then(function (p) {
        expect(p).to.deep.equal(commentPage)
      })
  })
github researchspace / researchspace / metaphacts-platform / web / src / main / api / services / WorkflowService.ts View on Github external
).flatMap(metadataGraph => {
                    if (metadataGraph.length !== 0) {
                        triples.push(Rdf.triple(subject,
                            VocabWorkflow.metadata, workflowMetadataIri));
                        metadataGraph.forEach(item => {
                            triples.push(Rdf.triple(item.s, item.p, item.o));
                        });
                    }
                    const workflowGraph = Rdf.graph(triples);
                    return this.ldpService.addResource(
                        workflowGraph,
                        Maybe.Just(subjectIri)
                    );
                });
            } catch (error) {
github researchspace / researchspace / researchspace / web / src / main / components / search / web-components / SemanticSearchContextualizedResult.tsx View on Github external
private selectRelation = (option: {value: Model.Relation}) => {
    const relation = Maybe.Just(option.value);
    this.props.context.setVisualizationContext(relation);
    this.setState({relation});
  }
github researchspace / researchspace / researchspace / web / src / main / components / arguments / AssertionsStore.ts View on Github external
([assertionPg, bs]) => {
        const service = new LdpService(rso.AssertionsContainer.value);
        if (assertion.iri.isJust) {
          return service.update(assertion.iri.get(), assertionPg.graph).map(
            _ => ({assertion: assertion.iri.get(), beliefs: bs})
          );
        } else {
          return new LdpService(rso.AssertionsContainer.value).addResource(
            assertionPg.graph, Maybe.Just(assertionIri.value)
          ).map(
            iri => ({assertion: iri, beliefs: bs})
          );
        }
      }
    );
github researchspace / researchspace / researchspace / web / src / main / components / arguments / BeliefsUtil.ts View on Github external
function savePropositionSet(
  propositions: PropositionSet, beliefIri: Rdf.Iri, belief: Belief
): Kefir.Property {
  const propositionSetIri = createPropositionIri(beliefIri);
  const propositionSetGraph = serializePropSet(belief, propositions);
  const service = ldpc(rso.PropositionsContainer.value);
  if (belief.iri.isJust) {
    return service.update(propositionSetIri, propositionSetGraph);
  }
  return service.addResource(
    propositionSetGraph, maybe.Just(propositionSetIri.value)
  );
}
github researchspace / researchspace / researchspace / web / src / main / components / arguments / ArgumentsStore.ts View on Github external
argumentGraph =>
      container.addResource(
        argumentGraph, Maybe.Just(argumentIri.value)
      )
  );

data

A Javascript data representation library.

Unknown
Latest version published 12 years ago

Package Health Score

36 / 100
Full package analysis