Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/dates

Package Overview
Dependencies
Maintainers
13
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/dates - npm Package Compare versions

Comparing version 1.0.0-sknext-beta.1 to 1.0.0-sknext-beta.2

41

build/ts/get-date-time-parts.js
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDateTimeParts = void 0;
var tslib_1 = require("tslib");
var decorators_1 = require("@shopify/decorators");

@@ -151,3 +172,3 @@ var utilities_1 = require("./utilities");

// In Microsoft Edge, Intl.DateTimeFormat returns invisible characters around the individual numbers
var _a = tslib_1.__read(timeString.split(':'), 3), dirtyHour = _a[0], dirtyMinute = _a[1], dirtySecond = _a[2];
var _a = __read(timeString.split(':'), 3), dirtyHour = _a[0], dirtyMinute = _a[1], dirtySecond = _a[2];
var rawHour = new RegExp(TWO_DIGIT_REGEX).exec(dirtyHour);

@@ -168,24 +189,24 @@ var rawMinute = new RegExp(TWO_DIGIT_REGEX).exec(dirtyMinute);

};
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('year'))
], DateTimeParts, "getYear", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('month'))
], DateTimeParts, "getMonth", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('day'))
], DateTimeParts, "getDay", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('weekday'))
], DateTimeParts, "getWeekday", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('hour'))
], DateTimeParts, "getHour", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('minute'))
], DateTimeParts, "getMinute", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('second'))
], DateTimeParts, "getSecond", null);
tslib_1.__decorate([
__decorate([
decorators_1.memoize(dateTimeCacheKey('timePartsFallback'))

@@ -192,0 +213,0 @@ ], DateTimeParts, "getTimePartsFallback", null);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./apply-time-zone-offset"), exports);
tslib_1.__exportStar(require("./constants"), exports);
tslib_1.__exportStar(require("./get-date-time-parts"), exports);
tslib_1.__exportStar(require("./get-time-zone-offset"), exports);
tslib_1.__exportStar(require("./is-future-date"), exports);
tslib_1.__exportStar(require("./is-less-than-one-day-ago"), exports);
tslib_1.__exportStar(require("./is-less-than-one-hour-ago"), exports);
tslib_1.__exportStar(require("./is-less-than-one-minute-ago"), exports);
tslib_1.__exportStar(require("./is-less-than-one-week-ago"), exports);
tslib_1.__exportStar(require("./is-less-than-one-week-away"), exports);
tslib_1.__exportStar(require("./is-less-than-one-year-ago"), exports);
tslib_1.__exportStar(require("./is-less-than-one-year-away"), exports);
tslib_1.__exportStar(require("./is-same-day"), exports);
tslib_1.__exportStar(require("./is-same-month"), exports);
tslib_1.__exportStar(require("./is-same-year"), exports);
tslib_1.__exportStar(require("./is-today"), exports);
tslib_1.__exportStar(require("./is-yesterday"), exports);
tslib_1.__exportStar(require("./is-tomorrow"), exports);
tslib_1.__exportStar(require("./parse-date-string"), exports);
tslib_1.__exportStar(require("./parse-date-string-parts"), exports);
tslib_1.__exportStar(require("./sanitise-date-string"), exports);
tslib_1.__exportStar(require("./unapply-time-zone-offset"), exports);
tslib_1.__exportStar(require("./map-deprecated-timezones"), exports);
tslib_1.__exportStar(require("./utilities"), exports);
__exportStar(require("./apply-time-zone-offset"), exports);
__exportStar(require("./constants"), exports);
__exportStar(require("./get-date-time-parts"), exports);
__exportStar(require("./get-time-zone-offset"), exports);
__exportStar(require("./is-future-date"), exports);
__exportStar(require("./is-less-than-one-day-ago"), exports);
__exportStar(require("./is-less-than-one-hour-ago"), exports);
__exportStar(require("./is-less-than-one-minute-ago"), exports);
__exportStar(require("./is-less-than-one-week-ago"), exports);
__exportStar(require("./is-less-than-one-week-away"), exports);
__exportStar(require("./is-less-than-one-year-ago"), exports);
__exportStar(require("./is-less-than-one-year-away"), exports);
__exportStar(require("./is-same-day"), exports);
__exportStar(require("./is-same-month"), exports);
__exportStar(require("./is-same-year"), exports);
__exportStar(require("./is-today"), exports);
__exportStar(require("./is-yesterday"), exports);
__exportStar(require("./is-tomorrow"), exports);
__exportStar(require("./parse-date-string"), exports);
__exportStar(require("./parse-date-string-parts"), exports);
__exportStar(require("./sanitise-date-string"), exports);
__exportStar(require("./unapply-time-zone-offset"), exports);
__exportStar(require("./map-deprecated-timezones"), exports);
__exportStar(require("./utilities"), exports);
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDateStringParts = void 0;
var tslib_1 = require("tslib");
/**

@@ -20,3 +35,3 @@ * Allowed date string formats

// slice the first regex part (the full match) off
var _a = tslib_1.__read(Array.from(dateTimeParts).slice(1), 11), year = _a[0], month = _a[1], day = _a[2], hour = _a[3], minute = _a[4], second = _a[5], millisecond = _a[6], timeZoneOffset = _a[7], sign = _a[8], timeZoneHour = _a[9], timeZoneMinute = _a[10];
var _a = __read(Array.from(dateTimeParts).slice(1), 11), year = _a[0], month = _a[1], day = _a[2], hour = _a[3], minute = _a[4], second = _a[5], millisecond = _a[6], timeZoneOffset = _a[7], sign = _a[8], timeZoneHour = _a[9], timeZoneMinute = _a[10];
return {

@@ -23,0 +38,0 @@ year: year,

"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.dateTimeFormatCacheKey = exports.formatDate = exports.memoizedGetDateTimeFormat = void 0;
var tslib_1 = require("tslib");
var intl = new Map();

@@ -34,3 +44,3 @@ function memoizedGetDateTimeFormat(locales, options) {

var adjustedDate = new Date(date.valueOf() - 12 * 60 * 60 * 1000);
return memoizedGetDateTimeFormat(locales, tslib_1.__assign(tslib_1.__assign({}, options), { timeZone: 'UTC' })).format(adjustedDate);
return memoizedGetDateTimeFormat(locales, __assign(__assign({}, options), { timeZone: 'UTC' })).format(adjustedDate);
}

@@ -37,0 +47,0 @@ return memoizedGetDateTimeFormat(locales, options).format(date);

@@ -8,2 +8,6 @@ # Changelog

<!-- ## [Unreleased] -->
- Added new types of builds (CommonJS, ESM, esnext, Node) for greater tree-shakability
## [0.4.0] - 2020-06-04

@@ -10,0 +14,0 @@

@@ -1,1 +0,1 @@

module.exports = require("./build/cjs/index");
module.exports = require("./build/node/index");
{
"name": "@shopify/dates",
"version": "1.0.0-sknext-beta.1",
"version": "1.0.0-sknext-beta.2",
"license": "MIT",

@@ -27,7 +27,6 @@ "description": "Lightweight date operations library",

"dependencies": {
"@shopify/decorators": "1.0.0-sknext-beta.1",
"tslib": "^1.9.3"
"@shopify/decorators": "1.0.0-sknext-beta.2"
},
"devDependencies": {
"@shopify/jest-dom-mocks": "1.0.0-sknext-beta.1"
"@shopify/jest-dom-mocks": "1.0.0-sknext-beta.2"
},

@@ -34,0 +33,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc