Socket
Socket
Sign inDemoInstall

@snailycad/utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snailycad/utils - npm Package Compare versions

Comparing version 1.68.7 to 1.74.0

2

dist/api-url.js

@@ -6,3 +6,3 @@ 'use strict';

if (process.env.NODE_ENV === "development") {
return "http://localhost:8080/v1";
return "http://192.168.6.41:8080/v1";
}

@@ -9,0 +9,0 @@ if (envUrl.endsWith("/v1")) {

@@ -6,3 +6,2 @@ 'use strict';

function generateCallsign(unit, template) {
var _a;
const isCombined = !("citizenId" in unit) || "officers" in unit || "deputies" in unit;

@@ -19,6 +18,6 @@ const _template = getTemplateFromUnit({ template, unit });

const replacers = {
department: (_a = unit.department) == null ? void 0 : _a.callsign,
department: unit.department?.callsign,
callsign1: unit.callsign,
callsign2: unit.callsign2,
division: division == null ? void 0 : division.callsign,
division: division?.callsign,
incremental: unit.incremental

@@ -29,3 +28,2 @@ };

function getTemplateFromUnit({ unit, template }) {
var _a;
const isCombined = !("citizenId" in unit) || "officers" in unit || "deputies" in unit;

@@ -35,5 +33,5 @@ if (isCombined) {

}
return unit.userDefinedCallsign || ((_a = unit.department) == null ? void 0 : _a.customTemplate) || template;
return unit.userDefinedCallsign || unit.department?.customTemplate || template;
}
exports.generateCallsign = generateCallsign;

@@ -12,3 +12,2 @@ 'use strict';

function formatCaseNumber(record, template) {
var _a, _b;
if (!template) {

@@ -20,3 +19,3 @@ return `#${record.caseNumber}`;

const replacers = {
department: (_b = (_a = record.officer) == null ? void 0 : _a.department) == null ? void 0 : _b.callsign,
department: record.officer?.department?.callsign,
month: format__default.default(createdAt, "MM"),

@@ -23,0 +22,0 @@ year: format__default.default(createdAt, "yyyy"),

@@ -6,3 +6,2 @@ 'use strict';

function slateDataToString(data) {
var _a, _b;
const string = [];

@@ -15,3 +14,3 @@ if (!data)

if (slate.Element.isElement(item) && item.type === "bulleted-list") {
const children = ((_a = item.children) == null ? void 0 : _a.flatMap((c) => c.children).map((v) => v == null ? void 0 : v.text)) ?? [];
const children = item.children?.flatMap((c) => c.children).map((v) => v?.text) ?? [];
string.push(children.join(" "));

@@ -21,3 +20,3 @@ continue;

if (slate.Element.isElement(item)) {
(_b = item.children) == null ? void 0 : _b.forEach((child) => {
item.children?.forEach((child) => {
string.push(child.text.trim());

@@ -24,0 +23,0 @@ });

{
"name": "@snailycad/utils",
"version": "1.68.7",
"version": "1.74.0",
"main": "./dist/index.js",

@@ -71,16 +71,15 @@ "module": "./dist/index.mjs",

"scripts": {
"build": "yarn tsup",
"watch": "yarn tsup --watch --silent=false",
"typecheck": "yarn tsc --noEmit",
"test:watch": "yarn vitest --watch",
"test": "yarn vitest run"
"build": "pnpm tsup",
"watch": "pnpm tsup --watch --silent=false",
"typecheck": "pnpm tsc --noEmit",
"test:watch": "pnpm vitest --watch",
"test": "pnpm vitest run"
},
"devDependencies": {
"@snailycad/types": "^1.68.7",
"@types/node": "^20.8.0",
"c8": "^8.0.1",
"tslib": "^2.6.1",
"tsup": "6.6.2",
"typescript": "^5.1.6",
"vite": "^4.4.8",
"vitest": "^0.34.0"
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vitest": "^0.34.6"
},

@@ -94,3 +93,3 @@ "tsup": {

"platform": "node",
"target": "node16",
"target": "node18",
"silent": true,

@@ -104,3 +103,12 @@ "treeshake": true,

"sideEffects": false,
"gitHead": "bf6800923a2800a2fd70de430d428df347f879d8"
"dependencies": {
"@snailycad/types": "^1.74.0",
"date-fns": "^2.30.0",
"slate": "0.94.1",
"slate-history": "^0.93.0",
"slate-react": "^0.99.0",
"tslib": "^2.6.2",
"undici": "5.25.3"
},
"gitHead": "fab926778dfc44ba319eae2f795af788bfe0f7ad"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc