@sparted/shared-library 0.0.17 → 0.0.18

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.
@@ -11,9 +11,9 @@ const updateLinkedList = (item, config) => {
11
11
  /**
12
12
  * This method should not update any ids.
13
13
  */
14
- const updatableProperties = _tslib.__rest(item, ["nextId", "previousId", "id"]);
14
+ const updatedProperties = _tslib.__rest(item, ["nextId", "previousId", "id"]);
15
15
  const currentItem = list.items[item.id];
16
- const newItems = Object.assign(Object.assign({}, list.items), { [item.id]: Object.assign(Object.assign({}, currentItem), updatableProperties) });
16
+ const newItems = Object.assign(Object.assign({}, list.items), { [item.id]: Object.assign({ nextId: currentItem.nextId, previousId: currentItem.previousId, id: currentItem.id }, updatedProperties) });
17
17
  return factory({
18
18
  headId: list.headId,
19
19
  items: newItems,
@@ -1 +1 @@
1
- {"version":3,"file":"update-linked-list.js","sources":["../../src/linked-list/update-linked-list.ts"],"sourcesContent":["import { ManipulationConfig, LinkedListItem } from './type';\nimport { assertPresence } from './linked-list-utils';\n\nexport const updateLinkedList = <T extends LinkedListItem>(item: T, config: ManipulationConfig<T>) => {\n const { list, factory } = config;\n\n assertPresence(item.id, list.items);\n\n /**\n * This method should not update any ids.\n */\n const { nextId, previousId, id, ...updatableProperties } = item;\n const currentItem = list.items[item.id];\n\n const newItems = {\n ...list.items,\n [item.id]: {\n ...currentItem,\n ...updatableProperties,\n },\n };\n\n return factory({\n headId: list.headId,\n items: newItems,\n });\n};\n"],"names":["assertPresence","__rest"],"mappings":";;;;;;;MAGa,gBAAgB,GAAG,CAA2B,IAAO,EAAG,MAA6B,KAAI;AACpG,IAAA,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAEjCA,8BAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AAEpC;;AAEG;AACH,IAAA,MAAmC,mBAAmB,GAAKC,aAAA,CAAA,IAAI,EAAzD,CAAA,QAAA,EAAA,YAAA,EAAA,IAAA,CAAkD,EAAQ;IAChE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAExC,IAAA,MAAM,QAAQ,GACT,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,KAAK,KACb,CAAC,IAAI,CAAC,EAAE,GACH,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,WAAW,CACX,EAAA,mBAAmB,IAEzB,CAAC;AAEF,IAAA,OAAO,OAAO,CAAC;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;AACnB,QAAA,KAAK,EAAE,QAAQ;AAChB,KAAA,CAAC,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"update-linked-list.js","sources":["../../src/linked-list/update-linked-list.ts"],"sourcesContent":["import { ManipulationConfig, LinkedListItem } from './type';\nimport { assertPresence } from './linked-list-utils';\n\nexport const updateLinkedList = <T extends LinkedListItem>(item: T, config: ManipulationConfig<T>) => {\n const { list, factory } = config;\n\n assertPresence(item.id, list.items);\n\n /**\n * This method should not update any ids.\n */\n const { nextId, previousId, id, ...updatedProperties } = item;\n const currentItem = list.items[item.id];\n\n const newItems = {\n ...list.items,\n [item.id]: {\n nextId: currentItem.nextId,\n previousId: currentItem.previousId,\n id: currentItem.id,\n ...updatedProperties,\n } as T,\n };\n\n return factory({\n headId: list.headId,\n items: newItems,\n });\n};\n"],"names":["assertPresence","__rest"],"mappings":";;;;;;;MAGa,gBAAgB,GAAG,CAA2B,IAAO,EAAG,MAA6B,KAAI;AACpG,IAAA,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAEjCA,8BAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AAEpC;;AAEG;AACH,IAAA,MAAmC,iBAAiB,GAAKC,aAAA,CAAA,IAAI,EAAvD,CAAA,QAAA,EAAA,YAAA,EAAA,IAAA,CAAgD,EAAQ;IAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAExC,IAAA,MAAM,QAAQ,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACT,IAAI,CAAC,KAAK,CACb,EAAA,EAAA,CAAC,IAAI,CAAC,EAAE,GAAG,MACT,CAAA,MAAA,CAAA,EAAA,MAAM,EAAE,WAAW,CAAC,MAAM,EAC1B,UAAU,EAAE,WAAW,CAAC,UAAU,EAClC,EAAE,EAAE,WAAW,CAAC,EAAE,EAAA,EACf,iBAAiB,CAChB,GACP,CAAC;AAEF,IAAA,OAAO,OAAO,CAAC;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;AACnB,QAAA,KAAK,EAAE,QAAQ;AAChB,KAAA,CAAC,CAAC;AACL;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": "Thomas <duprethomasfr@gmail.com>",
6
6
  "license": "MIT",