MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / addDefaultSignatureImg

Function addDefaultSignatureImg

apps/OpenSign/src/constant/Utils.js:2685–2717  ·  view source on GitHub ↗
(xyPosition, defaultSignImg, type)

Source from the content-addressed store, hash-verified

2683
2684//function for add default signature or image for all requested location
2685export const addDefaultSignatureImg = (xyPosition, defaultSignImg, type) => {
2686 let xyDefaultPos = [];
2687 for (let i = 0; i < xyPosition.length; i++) {
2688 const getXYdata = xyPosition[i].pos;
2689 const getPageNo = xyPosition[i].pageNumber;
2690 const getPosData = getXYdata;
2691
2692 const addSign = getPosData.map((position) => {
2693 if (position.type) {
2694 if (position?.type === type) {
2695 return {
2696 ...position,
2697 SignUrl: defaultSignImg,
2698 ImageType: "default",
2699 options: { ...position.options, response: defaultSignImg }
2700 };
2701 }
2702 } else if (position && !position.isStamp) {
2703 return {
2704 ...position,
2705 SignUrl: defaultSignImg,
2706 ImageType: "default",
2707 options: { ...position.options, response: defaultSignImg }
2708 };
2709 }
2710 return position;
2711 });
2712
2713 const newXypos = { pageNumber: getPageNo, pos: addSign };
2714 xyDefaultPos.push(newXypos);
2715 }
2716 return xyDefaultPos;
2717};
2718
2719//function for get month
2720export const getMonth = (date) => {

Callers 1

addDefaultSignatureFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected