@files-stack/core
Advanced tools
Comparing version 0.0.26-7 to 0.0.26-8
@@ -397,2 +397,5 @@ module.exports = | ||
}); | ||
const sorter = ramda_1.sortBy(ramda_1.compose(ramda_1.toLower, ramda_1.prop('name'))); | ||
files = sorter(files); | ||
directories = sorter(directories); | ||
return directories.concat(files); | ||
@@ -419,3 +422,3 @@ }; | ||
} | ||
return arr2.every((a2, i) => (arr1[i] && arr1[i] == a2)); | ||
return arr2.every((a2, i) => (arr1[i] && arr1[i] === a2)); | ||
}; | ||
@@ -425,2 +428,29 @@ exports.getFileExt = name => { | ||
}; | ||
exports.addEditorHistory = (editorWrappers, editorId, resource) => { | ||
const index = ramda_1.findIndex(ramda_1.propEq('editorId', editorId))(editorWrappers); | ||
if (index !== -1) { | ||
let history = editorWrappers[index].history || []; | ||
history = ramda_1.filter(item => item !== resource, history); | ||
editorWrappers[index].history = [...history, resource]; | ||
} | ||
return [...editorWrappers]; | ||
}; | ||
exports.removeEditorHistory = (editorWrappers, editorId, resource) => { | ||
const index = ramda_1.findIndex(ramda_1.propEq('editorId', editorId))(editorWrappers); | ||
if (index !== -1) { | ||
const history = ramda_1.filter(item => item !== resource, editorWrappers[index].history); | ||
editorWrappers[index].history = history; | ||
} | ||
return [...editorWrappers]; | ||
}; | ||
exports.getLastEditorHistory = (editorWrappers, editorId) => { | ||
const index = ramda_1.findIndex(ramda_1.propEq('editorId', editorId))(editorWrappers); | ||
if (index !== -1) { | ||
const history = editorWrappers[index].history; | ||
if (history.length) { | ||
return history[history.length - 1]; | ||
} | ||
} | ||
return ''; | ||
}; | ||
@@ -427,0 +457,0 @@ |
@@ -11,1 +11,4 @@ import { ICoreFileStat } from './interfaces'; | ||
export declare const getFileExt: (name: any) => any; | ||
export declare const addEditorHistory: (editorWrappers: any, editorId: any, resource: any) => any[]; | ||
export declare const removeEditorHistory: (editorWrappers: any, editorId: any, resource: any) => any[]; | ||
export declare const getLastEditorHistory: (editorWrappers: any, editorId: any) => any; |
{ | ||
"name": "@files-stack/core", | ||
"version": "0.0.26-7", | ||
"version": "0.0.26-8", | ||
"description": "files core for higher packages to depend on", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45925
612