MCPcopy
hub / github.com/sequelize/sequelize / set

Function set

test/unit/instance/set.test.js:91–100  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

89 phoneNumber: {
90 type: DataTypes.STRING,
91 set(val) {
92 if (typeof val === 'object' && val !== null) {
93 val = `00${val.country}${val.area}${val.local}`;
94 }
95 if (typeof val === 'string') {
96 // Canonicalize phone number
97 val = val.replace(/^\+/, '00').replace(/\(0\)|[\s+/.\-()]/g, '');
98 }
99 this.setDataValue('phoneNumber', val);
100 }
101 }
102 });
103

Callers

nothing calls this directly

Calls 1

setDataValueMethod · 0.80

Tested by

no test coverage detected