@advertima/snapshot
TypeScript icon, indicating that this package has built-in type declarations

5.1.0 • Public • Published

snapshot

Build Status npm version codecov Minfied size Minified + gzip size

POISnapshot models Javascript utilities to decode to a POISnapshot

Installation

$ npm install @advertima/snapshot --save

The @advertima/snapshot type definitions are included in the npm package.

Basics

import { POISnapshot } from '@advertima/snapshot';

// Decode binary snapshot
const snapshot = POISnapshot.decode(someBinaryData);

Test Utils

We provide you an easy way to create a POISnapshot instance of a PersonDetection instance for your tests.

import {
  PersonDetectionGenerator,
  POISnapshotGenerator,
  ContentMessageGenerator,
} from '@advertima/snapshot';

const person = PersonDetectionGenerator.generate({ age: 27, gender: 'male', y: 1.4 });

const params1 = { age: 27, gender: 'female', name: 'toto' };
const params2 = { age: 28, gender: 'male', name: 'titi' };
const snapshot = POISnapshotGenerator.generate([params1, params2]);

const contentMessage = ContentMessageGenerator.generate({
  localTimestamp: 1537362300000,
  contentId: '1',
  name: 'start',
  personPutIds: [],
  poi: 1,
});

License

@advertima/snapshot is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @advertima/snapshot

Weekly Downloads

2

Version

5.1.0

License

none

Unpacked Size

825 kB

Total Files

275

Last publish

Collaborators

  • advertima-admin