@elek-io/core 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1097,9 +1097,6 @@ __export(node_exports, {
1097
1097
  assignDefaultIfMissing: () => assignDefaultIfMissing,
1098
1098
  files: () => files,
1099
1099
  folders: () => folders,
1100
- fromPath: () => fromPath,
1101
- getDuplicates: () => getDuplicates,
1102
- getRelativePath: () => getRelativePath,
1103
1100
  isNoError: () => isNoError,
1104
1101
  notEmpty: () => notEmpty,
1105
1102
  pathTo: () => pathTo,
@@ -1109,7 +1106,6 @@ __export(node_exports, {
1109
1106
  });
1110
1107
  var import_child_process = require("child_process");
1111
1108
  var import_fs_extra = __toESM(require("fs-extra"), 1);
1112
- var import_lodash_es = require("lodash-es");
1113
1109
  var import_os = __toESM(require("os"), 1);
1114
1110
  var import_path = __toESM(require("path"), 1);
1115
1111
  var workingDirectory = import_path.default.join(import_os.default.homedir(), "elek.io");
@@ -1170,22 +1166,6 @@ var pathTo = {
1170
1166
  return import_path.default.join(pathTo.lfs(projectId), `${id}.${language}.${extension}`);
1171
1167
  }
1172
1168
  };
1173
- var fromPath = {
1174
- projectId: (path) => {
1175
- const startsWith = "projects/";
1176
- const endsWith = "/";
1177
- const start = path.indexOf(startsWith) + startsWith.length;
1178
- if (start === -1) {
1179
- return void 0;
1180
- }
1181
- const end = path.indexOf(endsWith, start);
1182
- const result = path.substring(start, end === -1 ? path.length : end);
1183
- if (result && uuidSchema.safeParse(result).success) {
1184
- return result;
1185
- }
1186
- return void 0;
1187
- }
1188
- };
1189
1169
  function assignDefaultIfMissing(value, defaultsTo) {
1190
1170
  return Object.assign(defaultsTo, value);
1191
1171
  }
@@ -1260,25 +1240,6 @@ async function files(path, extension) {
1260
1240
  return dirent2.isFile();
1261
1241
  });
1262
1242
  }
1263
- function getRelativePath(path) {
1264
- let relativePath = path.replace(workingDirectory, "");
1265
- if (relativePath.startsWith("/")) {
1266
- relativePath = relativePath.substr(1);
1267
- }
1268
- return relativePath;
1269
- }
1270
- function getDuplicates(arr, key) {
1271
- const grouped = (0, import_lodash_es.groupBy)(arr, (item) => {
1272
- return item[key];
1273
- });
1274
- return (0, import_lodash_es.uniq)(
1275
- (0, import_lodash_es.flatten)(
1276
- (0, import_lodash_es.filter)(grouped, (item) => {
1277
- return item.length > 1;
1278
- })
1279
- )
1280
- );
1281
- }
1282
1243
 
1283
1244
  // src/service/AbstractCrudService.ts
1284
1245
  var AbstractCrudService = class {