Socket
Socket
Sign inDemoInstall

yx-legend-data

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    yx-legend-data

legend core data module


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Legend Data

本项目主要存放埋点对象的数据结构、属性键,以及埋点的数据常量、初始化参数等。

背景

埋点SDK的需要支持多平台(Web、小程序、App等),由于每一个平台的底层API不太相同,所以针对每个平台都需要有一些单独的代码去实现。

所以,每个平台都会对应一个SDK,一个npm module。但是,埋点最后给服务端的数据其实是不尽相同的。 最终,我们决定将这些可复用的数据结构、类型定义都给抽离出来, 放在一个单独的npm module中去维护。

所有的SDK都将依赖于本项目。

极简加密

初期考虑过对称加密和非对称加密,也做了一些DEMO。最终,从开发时间以及后续维护的便利性,以及当前的产品需求决定,使用最简单的加密:混淆。

src/properties.ts 中,每个属性的键名都对应一个混淆值。规则也简单,从a-z,从0-n

服务端读取日志的时候,会根据这个Map,映射到原始的属性名称。

其他

项目相关的文档可以在 语雀 中查看以及维护。

FAQs

Last updated on 27 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc