1//JqueryCookie To JSCookie 2(function (factory) { 3 if (typeof define === 'function' && define.amd) { 4 // AMD 5 define(['js-cookie'], factory); 6 } else if (typeof exports === 'object') { 7 // CommonJS / Node 8 module.exports = factory(require('js-cookie')); 9 } else { 10 // ç覽å¨å ¨å 11 factory(window.Cookies); 12 } 13}(function (Cookies) { 14 15 if (typeof window.$ === 'undefined') { 16 window.$ = {}; // ç¢ºä¿æ $ 17 } 18 19 /** 20 * $.cookie API 21 * ç¨æ³ï¼ 22 * $.cookie('name'); // åå¼ 23 * $.cookie('name', 'value'); // è¨å® 24 * $.cookie('name', 'value', opts); // è¨å®(帶é¸é ) 25 * $.cookie(); // åææ cookies 26 */ 27 $.cookie = function (name, value, options) { 28 if (typeof name === 'undefined') { 29 return Cookies.get(); 30 } 31 32 if (typeof value !== 'undefined') { 33 // ç¹æ®èçèå¯«æ³ path: "/;SameSite=Strict" 34 if (options && typeof options.path === 'string' && options.path.includes(';SameSite=')) { 35 const parts = options.path.split(';'); 36 options.path = parts[0]; // ä¿çç實çè·¯å¾ 37 const sameSitePart = parts.find(p => p.trim().startsWith('SameSite=')); 38 if (sameSitePart) { 39 options.sameSite = sameSitePart.split('=')[1]; 40 } 41 } 42 return Cookies.set(name, value, options); 43 } 44 45 return Cookies.get(name); 46 }; 47 48 /** 49 * $.removeCookie API 50 * ç¨æ³ï¼ 51 * $.removeCookie('name'); 52 * $.removeCookie('name', opts); 53 */ 54 $.removeCookie = function (name, options) { 55 Cookies.remove(name, options); 56 }; 57 58}))
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.