From 90e6cb94e9c9a4d055a0983c9c7386daa48f61f9 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期四, 09 六月 2022 15:45:03 +0800
Subject: [PATCH] TODO#139893 [ FAQ 常見問題 -我進行預約後,顧問會用甚麼方式聯繫我? ] 文案調整

---
 PAMapp/node_modules/expect/build/utils.js |   42 +++++++++++++++++++++++++++++++++---------
 1 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/PAMapp/node_modules/expect/build/utils.js b/PAMapp/node_modules/expect/build/utils.js
index 1baa04f..66d3144 100644
--- a/PAMapp/node_modules/expect/build/utils.js
+++ b/PAMapp/node_modules/expect/build/utils.js
@@ -3,17 +3,18 @@
 Object.defineProperty(exports, '__esModule', {
   value: true
 });
+exports.arrayBufferEquality = void 0;
 exports.emptyObject = emptyObject;
-exports.isOneline =
-  exports.isError =
-  exports.partition =
-  exports.sparseArrayEquality =
-  exports.arrayBufferEquality =
-  exports.typeEquality =
+exports.typeEquality =
   exports.subsetEquality =
+  exports.sparseArrayEquality =
+  exports.pathAsArray =
+  exports.partition =
   exports.iterableEquality =
-  exports.getObjectSubset =
+  exports.isOneline =
+  exports.isError =
   exports.getPath =
+  exports.getObjectSubset =
     void 0;
 
 var _jestGetType = require('jest-get-type');
@@ -55,7 +56,7 @@
 
 const getPath = (object, propertyPath) => {
   if (!Array.isArray(propertyPath)) {
-    propertyPath = propertyPath.split('.');
+    propertyPath = pathAsArray(propertyPath);
   }
 
   if (propertyPath.length) {
@@ -402,10 +403,33 @@
   const result = [[], []];
   items.forEach(item => result[predicate(item) ? 0 : 1].push(item));
   return result;
-}; // Copied from https://github.com/graingert/angular.js/blob/a43574052e9775cbc1d7dd8a086752c979b0f020/src/Angular.js#L685-L693
+};
 
 exports.partition = partition;
 
+const pathAsArray = propertyPath => {
+  const properties = [];
+
+  if (propertyPath === '') {
+    properties.push('');
+    return properties;
+  } // will match everything that's not a dot or a bracket, and "" for consecutive dots.
+
+  const pattern = RegExp('[^.[\\]]+|(?=(?:\\.)(?:\\.|$))', 'g'); // Because the regex won't match a dot in the beginning of the path, if present.
+
+  if (propertyPath[0] === '.') {
+    properties.push('');
+  }
+
+  propertyPath.replace(pattern, match => {
+    properties.push(match);
+    return match;
+  });
+  return properties;
+}; // Copied from https://github.com/graingert/angular.js/blob/a43574052e9775cbc1d7dd8a086752c979b0f020/src/Angular.js#L685-L693
+
+exports.pathAsArray = pathAsArray;
+
 const isError = value => {
   switch (Object.prototype.toString.call(value)) {
     case '[object Error]':

--
Gitblit v1.8.0